11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basic Usagelog will provide you <strong>with</strong> a record of who made changes to a file or directory, at what revisionit changed, the time and date of that revision, and—if it was provided—the log messagethat accompanied the commit:$ svn log------------------------------------------------------------------------r3 | sally | 2008-05-15 23:09:28 -0500 (Thu, 15 May 2008) | 1 lineAdded include lines and corrected # of cheese slices.------------------------------------------------------------------------r2 | harry | 2008-05-14 18:43:15 -0500 (Wed, 14 May 2008) | 1 lineAdded main() methods.------------------------------------------------------------------------r1 | sally | 2008-05-10 19:50:31 -0500 (Sat, 10 May 2008) | 1 lineInitial import------------------------------------------------------------------------Note that the log messages are printed in reverse chronological order by default. If youwish to see a different range of revisions in a particular order or just a single revision, passthe --revision (-r) option:$ svn log -r 5:19 # shows logs 5 through 19 in chronological order$ svn log -r 19:5 # shows logs 5 through 19 in reverse order$ svn log -r 8 # shows log for revision 8You can also examine the log history of a single file or directory. For example:$ svn log foo.c…$ svn log http://foo.com/svn/trunk/code/foo.c…These will display log messages only for those revisions in which the working file (or URL)changed.Why Does svn log Not Show Me What I Just Committed?If you make a commit and immediately type svn log <strong>with</strong> no arguments, you maynotice that your most recent commit doesn't show up in the list of log messages. Thisis due to a combination of the behavior of svn commit and the default behavior ofsvn log. First, when you commit changes to the repository, svn bumps only the revisionof files (and directories) that it commits, so usually the parent directory remainsat the older revision (See the section called “Updates and commits are separate” foran explanation of why). svn log then defaults to fetching the history of the directory atits current revision, and thus you don't see the newly committed changes. The solutionhere is to either update your working copy or explicitly provide a revision numberto svn log by using the --revision (-r) option.If you want even more information about a file or directory, svn log also takes a --verbose (-v) option. Because <strong>Subversion</strong> allows you to move and copy files and directories,it is important to be able to track path changes in the filesystem. So, in verbosemode, svn log will include a list of changed paths in a revision in its output:34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!