Tag Archive for 'log'

Subversion Tip of the Week

Getting More Out of SVN Log

Apache Subversion‘s ‘SVN log’ is a useful command, allowing you to view the entire history of a directory, including who made changes to the directory, at what revision, the exact time, and any accompanying log messages.

In it’s most basic form, a simple ‘SVN log’ command will give you a printout of everything that’s changed in your entire directory, across all revisions:

svn log

However, there’s plenty of options if you need to tailor ‘SVN log’s output. If this is far too much information, you can specify a particular revision:

svn log -r14

svn log 2

Or, if you’re after all the available information about this particular revision, add the verbose option to your command:

svn log -r14 -v

svn log 3

Alternatively, if you do not need to review the log message, you can add the quiet option to suppress this piece of information:

svn log -r14 -q

svn log 4

Of course, both of these options can also be applied to an entire directory:

svn log -q
svn log -v

When the two options are combined, ‘svn log’ prints just the file names:

svn log -q -v

svn log 5

Looking for an easy-to-use cross platform Subversion client? Claim your free 30 day trial of SmartSVN Professional by visiting: www.smartsvn.com/download

Changing Log Messages in SmartSVN

When performing commits, it’s good practice to leave as much information as possible in your log messages. However, at some point you may need to add, delete or alter information contained within the log messages for previous revisions. In this post, we’ll show you how to modify your log messages in SmartSVN, with just a few mouse clicks.

Note, to change log messages, you must first have created a pre-revprop-change hook. The pre-revprop-change template can be located in the ‘hooks’ folder on your local machine.

Right-click on the post-revprop-change template and select the ‘Edit’ option. You can then enter an appropriate script and begin modifying log messages for previous revisions.

1) To modify the log history of your currently checked out project, select the ‘Log…’ option from SmartSVN’s ‘Query’ menu.

2) In the subsequent Log dialog, you can review log information including:

  •  Revision number
  • Who performed the commit
  • The commit message
  • Time of the commit
  • Number of files altered in the revision
  • The repository URL
3) To change the current log message, right click on the message’s text and select the ‘Change commit message…’ option.

4) This will open the ‘Change Commit Message’ dialog. Make your changes, and click ‘Ok’ to update the log message.

Not yet tried SmartSVN? Download your free trial of SmartSVN Professional today. 

SmartSVN: Getting More out of the Log Menu

In our previous ‘Exploring the Log Menu in SmartSVN’ post, we showed how to access the Log menu, and began to explore some of the options available from this screen. In this follow-up post, we show you how to get the most out of SmartSVN‘s Log menu, by leveraging some additional Log options.

1) The ‘Edit’ menu:

 

 

 

 

 

 

  • Stop – cancels any currently running operations.
  • Open – opens the selected revision, file or directory.
  • Copy Message – copies the log message of the selected revision.
  • Copy Name – copies the name of the selected file. Note, if more than one file is selected, all the names will be copied, with a new name on each line.
  • Copy Path – copies the path of the selected file, relative to the log context root. Note, if more than one file is selected, all the paths will be copied, with a new path on each line.
  • Customize… – allows you to customize the accelerators. Clicking ‘Customize’ opens the ‘Accelerator’ dialog.

 

 

 

 

 

 

 

 

 

To create a new accelerator, or change an existing one, select a Menu Item and click the ‘Accelerator’ field at the bottom of the screen.

 

 

 

 

Press the key combination you wish to add and click ‘Assign’ to confirm. If you ever need to restore the default accelerators, select the appropriate Menu Item and click ‘Reset.’

2)    The ‘View’ Menu

 

 

 

  • Skip Unchanged Revisions – skip revisions where the selected entry did not actually change (but was reported due to a copy operation on one of its parents.)
  • Revision Files/Directories – adds/removes the Directories/Files view at the bottom of the Log Menu homescreen.

3)    The ‘Modify’ Menu

 

 

 

 

  • Change Commit Message… – changes the commit message of the selected revision. Selecting this will open a dialog where you can enter a new log message.

 

 

 

 

 

 

 

 

  • Merge Revision – merges the selected item.
  • Rollback Revision… – rolls the selected item back to the version currently stored in the working copy. Select the item you wish to roll back, followed by ‘Rollback Revision…’ Note, this rollback will only happen at the local level, you must commit your changes back to the repository to make them permanent.

4) The Query Menu

 

 

 

 

 

 

 

  • Show Changes – allows you to compare two  revisions, files or directories. Depending on what you’re comparing, SmartSVN will either open ‘File Compare,’ ‘Properties Compare’ or ‘Revision Compare.’
  • Compare with Working Copy – compare a revision or file against the working copy. Selecting this option will open the ‘File/Revision Compare’ dialog. Note, this option is only applicable for revisions of file logs.

 

 

 

 

 

 

  • Log…. – when a file is selected, this option displays the complete log. In the subsequent dialog, select the time range for reviewing the log (e.g ‘the last two weeks,’ ‘the previous 100 revisions’ or ‘from X date to Y date) and select ‘Ok.’

 

 

 

 

 

 

 

 

 

 

  • Revision Graph –launches the revision graph for the selected entry. The graph output consists of nodes (representing a specific entry at a specific revision in the repository) branches and links.
  • Annotate – The ‘annotate’ dialog shows the contents of a selected file, prefixed by information on when this line was last changed.

Remember, you can catch up on the rest of our intro to SmartSVN series:

Exploring the Log Menu in SmartSVN

SmartSVN’s ‘Log’ option allows Apache Subversion users to view the change history of a specified file/directory, through a powerful Log Menu. In this post, we’ll show you how to access the Log Menu, and explore some of the additional options available through this menu.

To access the Log Menu:

1) Select the file/directory you wish to view the change history for and click the ‘Log’ button (alternatively, open the ‘Query’ menu and select ‘Log…’)

 

 

 

 

2) In the ‘Show directory log’ dialog, select the time period you wish to review. In this example, we’ll set SmartSVN to review ‘the Last 2 weeks.’ Click ‘Ok.’

 

 

 

 

 

 

 

 

 

 

Tip. Select the ‘Stop logging on copied locations’ checkbox to prevent SmartSVN from tracking further changes when it encounters a revision where the file/directory has been copied from another location.

3) The Log window will open automatically. This screen consists of several different sections:

  • Revisions table – displays the different revisions and their attributes, including the log message.
  • Revision Info – select a particular revision to see all the information about this revision in the Revision Info pane.
  • Search Author and Commit Message – allows you to filter out certain revisions.
  • Directories – displays the Directories/Files view for the selected revision.

 

 

 

 

 

 

Log Menu Options

There are some additional options available from this dialog:

1) ‘Show More…’ – accessed by selecting the ‘Log’ menu. This option allows you to extend the displayed log range.

 

 

 

 

 

In the ‘Show More’ dialog, you can increase the number of displayed revisions (for example, by increasing the date range, or requesting to see the ‘previous X revisions.’)

 

 

 

 

 

 

 

 

 

2) Export to File – accessed through the ‘Log’ menu. This option exports the log data to a file.

 

 

 

 

 

In the ‘Export to File’ dialog, you can either export ‘All Revisions’ or ‘Selected revisions,’ and choose from several different formats (XML, HTML, Plain text, or Custom). You must also specify the Output file, which is where the log information will be written.

 

 

 

 

 

 

 

These are just some of the options available through SmartSVN’s powerful Log Menu. We’ll be covering more of these in our next post.

If you haven’t already tried SmartSVN, download your free SmartSVN Foundation edition today http://smartsvn.com/

Remember, you can catch up on the rest of our intro to SmartSVN series:

Introduction to Apache Subversion

What is Apache Subversion?

Subversion is an Apache-licensed, open source software versioning and version control system that can track changes to files, folders and directories. It can also be used to recover previous versions of data, and examine the history of how a particular dataset has changed. Subversion can operate across networks, encouraging collaboration by allowing team members at various locations to work on the same set of data. Subversion can be used to manage any collection of files – web pages, binaries, documentation – not just source code!

Downloading and Installing Apache Subversion

Certified open source Apache Subversion binaries are available to download from http://www.wandisco.com/subversion/download

To install, open the file to launch the setup wizard and follow the onscreen instructions to define which components you wish to install, and the install location. Enter the name of your server, the host port, and define the repository and repository location prefix – and hit install.

Alternatively, uberSVN makes Subversion easy and intuitive to use, and is free to download and free to use.

Creating your first repository

Once Subversion is installed, the first thing you need to do is create a repository. To create your first repository, open the command line, change the current directory to where you want to create your repository, and run the ‘svnadmin’ command:

svnadmin create {directory name}

Checking out a Project

To start working on your project, you must check out a working copy of the repository. This is achieved with the ‘checkout’ command:

svn checkout file {file location}

Commit Your Changes

Once you’ve made some changes to your working copy, you’ll want to push your changes to the server. Perform an “svn update” and an “svn diff” to test your changes, and resolve any warnings raised by Subversion, before committing. Once you’ve finished checking your modifications, and are ready to store the new revision in the repository, run the ‘commit’ command:

svn commit {path}

Get other people’s changes

When someone else performs a commit to the repository, you’ll need to pull those changes into your working copy, to ensure the latest trunk changes are compatible with what you’re doing in your working copy. Changes can be pulled into your working copy with the update command:

svn update {file name}
or
svn update {directory name}

Adding Files to a Project

Now you know how to checkout a working copy and commit changes back to the repository – but as you continue to develop your working copy, you may wish to add some new files to your project. When adding new files to Subversion, you need to tell the Subversion server about the files with the following command:

svn add {file name}
or
svn add {directory name}

Note that the new files won’t appear in the repository until you perform an ‘svn commit’ and send them to the repository.

Deleting Files from a Project

If at some point you want to remove these files from Subversion, run the delete command:

svn delete {file name}
or
svn delete {directory name}

Again, you must perform a commit before the file is deleted from the repository. You can also run ‘svn list’ to confirm that the file was successfully deleted from the repository.

And if you get stuck…..

The ‘svn –help’ function provides a summary of available commands or, for more information on a particular command, use:

svn help {command}

Other useful commands

  • svn status {path} – prints the status of working copy files and directories.
  • svn diff – display the differences between two revisions.
  • svn merge – applies the differences between two sources to a working copy path.
  • svn move SRC DST – think of this as ‘svn copy’ that automatically deletes the source file. This command moves a file or directory in your working copy, or in the repository. Note that Subversion does not support cross-repository moving, so it is impossible to move files across repositories with this command.
  • svn list – allows you to view the content of the Subversion repository, without having to download a working copy.
  • svn log – Subversion remembers every change made to your files and directories. This command displays the commit log messages. By default, it will show the information for the current working directory of your working copy. Alternatively, different paths can be specified.

Need more info?

On June 14th, 2012 we will be hosting a free ‘Introduction to Subversion’ webinar. This course is intended as a primer for new users or people who are thinking of making the jump to Subversion, and will cover the following topics:

  • Repository basics – creating and organizing
  • Checkouts, working folders, editing files and checkins
  • Reporting on changes
  • Simple branching
  • Simple merging

This webinar is free to attend, but places are limited so register now to avoid disappointment.