3.7 Other Useful Commands

While not as frequently used as the commands previously discussed in this chapter, you occasionally need the following commands.

3.7.1 svn cleanup

When Subversion modifies your working copy (or any information within .svn), it tries to do so as safely as possible. Before changing anything, it writes its intentions to a log file, executes the commands in the log file, then removes the log file (this is similar in design to a journaled filesystem). If a Subversion operation is interrupted (if the process is killed, or if the machine crashes, for example), the log files remain on disk. By re-executing the log files, Subversion can complete the previously started operation, and your working copy can get itself back into a consistent state.

And this is exactly what svn cleanup does: it searches your working copy and runs any leftover logs, removing locks in the process. If Subversion ever tells you that some part of your working copy is locked, then this is the command that you should run. Also, svn status will display an L next to locked items:

$ svn status   L    somedir M      somedir/foo.c  $ svn cleanup $ svn status M      somedir/foo.c

3.7.2 svn import

The svn import command is a quick way to copy an unversioned tree of files into a repository, creating intermediate directories as necessary.

$ svnadmin create /usr/local/svn/newrepos $ svn import mytree file:///usr/local/svn/newrepos/some/project Adding         mytree/foo.c Adding         mytree/bar.c Adding         mytree/subdir Adding         mytree/subdir/quux.h Committed revision 1.

The previous example copied the contents of directory mytree under the directory some/project in the repository:

$ svn ls file:///usr/local/svn/newrepos/some/project bar.c foo.c subdir/



Version Control with Subversion
Version Control with Subversion
ISBN: 0596510330
EAN: 2147483647
Year: 2003
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net