11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced TopicsThe most recent revision prior to, or equal to, BASE, in which an item changed.PREVThe revision immediately before the last revision in which an item changed. Technically,this boils down to COMMITTED#1.As can be derived from their descriptions, the PREV, BASE, and COMMITTED revisionkeywords are used only when referring to a working copy path—they don't apply to repositoryURLs. HEAD, on the other hand, can be used in conjunction <strong>with</strong> both of these pathtypes.Here are some examples of revision keywords in action:$ svn diff -r PREV:COMMITTED foo.c# shows the last change committed to foo.c$ svn log -r HEAD# shows log message for the latest repository commit$ svn diff -r HEAD# compares your working copy (<strong>with</strong> all of its local changes) to the# latest version of that tree in the repository$ svn diff -r BASE:HEAD foo.c# compares the unmodified version of foo.c <strong>with</strong> the latest version of# foo.c in the repository$ svn log -r BASE:HEAD# shows all commit logs for the current versioned directory since you# last updated$ svn update -r PREV foo.c# rewinds the last change on foo.c, decreasing foo.c's working revision$ svn diff -r BASE:14 foo.c# compares the unmodified version of foo.c <strong>with</strong> the way foo.c looked# in revision 14Revision DatesRevision numbers reveal nothing about the world outside the version control system, butsometimes you need to correlate a moment in real time <strong>with</strong> a moment in version history.To facilitate this, the --revision (-r) option can also accept as input date specifierswrapped in curly braces ({ and }). <strong>Subversion</strong> accepts the standard ISO-8601 date andtime formats, plus a few others. Here are some examples. (Remember to use quotesaround any date that contains spaces.)$ svn checkout -r {2006-02-17}$ svn checkout -r {15:30}$ svn checkout -r {15:30:00.200000}$ svn checkout -r {"2006-02-17 15:30"}$ svn checkout -r {"2006-02-17 15:30 +0230"}$ svn checkout -r {2006-02-17T15:30}$ svn checkout -r {2006-02-17T15:30Z}$ svn checkout -r {2006-02-17T15:30-04:00}$ svn checkout -r {20060217T1530}$ svn checkout -r {20060217T1530Z}$ svn checkout -r {20060217T1530-0500}…When you specify a date, <strong>Subversion</strong> resolves that date to the most recent revision of therepository as of that date, and then continues to operate against that resolved revision41

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

Saved successfully!

Ooh no, something went wrong!