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

Subversion Complete Reference

Name

svn checkout -- Check out a working copy from a repository.

svn checkout

Synopsis

svn checkout URL[@REV]... [PATH]

Description

Check out a working copy from a repository. If PATH is omitted, the basename of the URL will be used as the destination. If multiple URLs are given each will be checked out into a subdirectory of PATH, with the name of the subdirectory being the basename of the URL.

Alternate Names

co

Changes

Creates a working copy.

Accesses Repository

Yes

Switches

--revision (-r) REV --quiet (-q) --non-recursive (-N) --username USER --password PASS --no-auth-cache --non-interactive --config-dir DIR

Examples

Check out a working copy into a directory called mine:

$ svn checkout file:///tmp/repos/test mine A mine/a

A mine/b

Checked out revision 2. $ ls

mine

Check out 2 different directories into two separate working copies:

$ svn checkout file:///tmp/repos/test file:///tmp/repos/quiz

170

Subversion Complete Reference

A test/a A test/b

Checked out revision 2. A quiz/l

A quiz/m

Checked out revision 2. $ ls

quiz test

Check out 2 different directories into two separate working copies, but place both into a directory called workingcopies:

$ svn checkout file:///tmp/repos/test file:///tmp/repos/quiz working-copies A working-copies/test/a

A working-copies/test/b Checked out revision 2. A working-copies/quiz/l A working-copies/quiz/m Checked out revision 2. $ ls

working-copies

If you interrupt a checkout (or something else interrupts your checkout like loss of connectivity, etc.), you can restart it either by issuing the identical checkout command again, or by updating the incomplete working copy:

$ svn checkout file:///tmp/repos/test test A test/a

A test/b ^C

svn: The operation was interrupted svn: caught SIGINT

$ svn checkout file:///tmp/repos/test test A test/c

A test/d ^C

svn: The operation was interrupted svn: caught SIGINT

$ cd test

$ svn update A test/e

A test/f

Updated to revision 3.

171

Subversion Complete Reference

Name

svn cleanup -- Recursively clean up the working copy.

svn cleanup

Synopsis

svn cleanup [PATH...]

Description

Recursively clean up the working copy, removing locks resuming unfinished operations. If you ever get a “working copy locked” error, run this command to remove stale locks and get your working copy into a usable state again. See Appendix B, Troubleshooting.

If, for some reason, an svn update fails due to a problem running an external diff program (e.g. user input or network failure), pass the --diff3-cmd to allow cleanup to complete any merging with your external diff program. You can also specify any configuration directory with the --config-dir switch, but you should need these switches extremely infrequently.

Alternate Names

None

Changes

Working copy

Accesses Repository

No

Switches

--diff3-cmd CMD

--config-dir DIR

Examples

Well, there's not much to the examples here as svn cleanup generates no output. If you pass no PATH, “.” is used.

$ svn cleanup

$ svn cleanup /path/to/working-copy

172

Subversion Complete Reference

Name

svn commit -- Send changes from your working copy to the repository.

svn commit

Synopsis

svn commit [PATH...]

Description

Send changes from your working copy to the repository. If you do not supply a log message with your commit by using either the --file or --message switch, svn will launch your editor for you to compose a commit message. See the editor-cmd section in the section called “Config”.

Tip

If you begin a commit and Subversion launches your editor to compose the commit message, you can still abort without committing your changes. If you want to cancel your commit, just quit your editor without saving your commit message and Subversion will prompt you to either abort the commit, continue with no message, or edit the message again.

Alternate Names

ci (short for “check in”; not “co”, which is short for “checkout”)

Changes

Working copy, repository

Accesses Repository

Yes

Switches

--message (-m) TEXT --file (-F) FILE --quiet (-q) --non-recursive (-N) --targets FILENAME --force-log --username USER --password PASS --no-auth-cache --non-interactive --encoding ENC --config-dir DIR

Examples

Commit a simple modification to a file with the commit message on the command line and an implicit target of your current directory (“.”):

173

Subversion Complete Reference

$ svn commit -m "added howto section." Sending a

Transmitting file data . Committed revision 3.

Commit a modification to the file foo.c (explicitly specified on the command line) with the commit message in a file named msg:

$ svn commit -F msg foo.c Sending foo.c Transmitting file data . Committed revision 5.

If you want to use a file that's under version control for your commit message with --file, you need to pass the - -force-log switch:

$ svn commit --file file_under_vc.txt foo.c

svn: The log message file is under version control

svn: Log message file is a versioned file; use '--force-log' to override

$ svn commit --force-log --file file_under_vc.txt foo.c Sending foo.c

Transmitting file data . Committed revision 6.

To commit a file scheduled for deletion:

$ svn commit -m "removed file 'c'." Deleting c

Committed revision 7.

174

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