04.08.2013 Views

Version Control with Subversion - Electrical and Computer ...

Version Control with Subversion - Electrical and Computer ...

Version Control with Subversion - Electrical and Computer ...

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.

svn diff<br />

It could be a file, or the root of a copied directory. + means the item is part of a subtree scheduled for<br />

addition-<strong>with</strong>-history, i.e. some parent got copied, <strong>and</strong> it's just coming along for the ride. M + means<br />

the item is part of a subtree scheduled for addition-<strong>with</strong>-history, <strong>and</strong> it has local modifications. When<br />

you commit, first the parent will be added-<strong>with</strong>-history (copied), which means this file will automatically<br />

exist in the copy. Then the local modifications will be uploaded into the copy.<br />

The fifth column will only show whitespace or an S. This signifies that the file or directory has been<br />

switched from the path of the rest of the working copy (using svn switch) to a branch.<br />

The sixth column shows information about locks, which is further explained in the section called<br />

“Locking”. (These are not the same locks as the ones indicated by an L in the third column; see Three<br />

meanings of “lock”.)<br />

If you pass a specific path to svn status, it gives you information about that item alone:<br />

$ svn status stuff/fish.c<br />

D stuff/fish.c<br />

Guided Tour<br />

svn status also has a --verbose (-v) switch, which will show you the status of every item in your<br />

working copy, even if it has not been changed:<br />

$ svn status --verbose<br />

M 44 23 sally README<br />

44 30 sally INSTALL<br />

M 44 20 harry bar.c<br />

44 18 ira stuff<br />

44 35 harry stuff/trout.c<br />

D 44 19 ira stuff/fish.c<br />

44 21 sally stuff/things<br />

A 0 ? ? stuff/things/bloo.h<br />

44 36 harry stuff/things/gloo.c<br />

This is the “long form” output of svn status. The first column remains the same, but the second column<br />

shows the working-revision of the item. The third <strong>and</strong> fourth columns show the revision in which the<br />

item last changed, <strong>and</strong> who changed it.<br />

None of the above invocations to svn status contact the repository, they work only locally by comparing<br />

the metadata in the .svn directory <strong>with</strong> the working copy. Finally, there is the --show-updates (u)<br />

switch, which contacts the repository <strong>and</strong> adds information about things that are out-of-date:<br />

$ svn status --show-updates --verbose<br />

M * 44 23 sally README<br />

M 44 20 harry bar.c<br />

* 44 35 harry stuff/trout.c<br />

D 44 19 ira stuff/fish.c<br />

A 0 ? ? stuff/things/bloo.h<br />

Status against revision: 46<br />

Notice the two asterisks: if you were to run svn update at this point, you would receive changes to<br />

README <strong>and</strong> trout.c. This tells you some very useful information—you'll need to update <strong>and</strong> get the<br />

server changes on README before you commit, or the repository will reject your commit for being outof-date.<br />

(More on this subject later.)<br />

30

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

Saved successfully!

Ooh no, something went wrong!