Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Collins-Sussman B.Version control with Subversion 1.1.pdf
Скачиваний:
9
Добавлен:
23.08.2013
Размер:
1.53 Mб
Скачать

Guided Tour

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

svn cleanup

When Subversion modifies your working copy (or any information within .svn), it tries to do so as safely as possible. Before changing the working copy, Subversion writes its intentions to a log file. Next it executes the commands in the log file to apply the requested change. Finally, Subversion removes the log file. Architecturally, this is similar 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

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 list file:///usr/local/svn/newrepos/some/project bar.c

foo.c

subdir/

Note that after the import is finished, the original tree is not converted into a working copy. To start working, you still need to svn checkout a fresh working copy of the tree.

Summary

Now we've covered most of the Subversion client commands. Notable exceptions are those dealing with branching

40

Guided Tour

and merging (see Chapter 4, Branching and Merging) and properties (see the section called “Properties”). However, you may want to take a moment to skim through Chapter 9, Subversion Complete Reference to get an idea of all the many different commands that Subversion has—and how you can use them to make your work easier.

41

Соседние файлы в предмете Электротехника