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

Subversion Complete Reference

--strict

Causes Subversion to use strict semantics, a notion which is rather vague unless talking about specific subcommands.

--targets FILENAME

Tells Subversion to get the list of files that you wish to operate on from the filename you provide instead of listing all the files on the command line.

--username NAME

Indicates that you are providing your username for authentication on the command line—otherwise, if it is needed, Subversion will prompt you for it.

--verbose (-v)

Requests that the client print out as much information as it can while running any subcommand. This may result in Subversion printing out additional fields, detailed information about every file, or additional information regarding its actions.

--version

Prints the client version info. This information not only includes the version number of the client, but also a listing of all repository access modules that the client can use to access a Subversion repository.

--xml

Prints output in XML format.

svn Subcommands

164

Subversion Complete Reference

Name

svn add -- Add files, directories, or symbolic links.

svn add

Synopsis

svn add PATH...

Description

Add files, directories, or symbolic links to your working copy and schedule them for addition to the repository. They will be uploaded and added to the repository on your next commit. If you add something and change your mind before committing, you can unschedule the addition using svn revert.

Alternate Names

None

Changes

Working Copy

Accesses Repository

No

Switches

--targets FILENAME --non-recursive (-N) --quiet (-q) --config-dir DIR --auto-props --no-auto-props --force

Examples

To add a file to your working copy:

$ svn add foo.c A foo.c

When adding a directory, the default behavior of svn add is to recurse:

$ svn add testdir

A

testdir

A

testdir/a

A

testdir/b

A

testdir/c

A

testdir/d

165

Subversion Complete Reference

You can add a directory without adding its contents:

$ svn add --non-recursive otherdir A otherdir

Normally, the command svn add * will skip over any directories that are already under version control. Sometimes, however, you may want to add every unversioned object in your working copy, including those hiding deeper down. Passing the --force option makes svn add recurse into versioned directories:

$ svn add * --force

A

foo.c

A

somedir/bar.c

A

otherdir/docs/baz.doc

[...]

 

166

Subversion Complete Reference

Name

svn blame -- Show author and revision information in-line for the specified files or URLs.

svn blame

Synopsis

svn blame TARGET...

Description

Show author and revision information in-line for the specified files or URLs. Each line of text is annotated at the beginning with the author (username) and the revision number for the last change to that line.

Alternate Names

praise, annotate, ann

Changes

Nothing

Accesses Repository

Yes

Switches

--revision (-r) REV --username USER --password PASS --no-auth-cache --non-interactive --config-dir DIR --verbose

Examples

If you want to see blame annotated source for readme.txt in your test repository:

$ svn blame http://svn.red-bean.com/repos/test/readme.txt 3 sally This is a README file.

5 harry You should read this.

167

Subversion Complete Reference

Name

svn cat -- Output the contents of the specified files or URLs.

svn cat

Synopsis

svn cat TARGET[@REV]...

Description

Output the contents of the specified files or URLs. For listing the contents of directories, see svn list.

Alternate Names

None

Changes

Nothing

Accesses Repository

Yes

Switches

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

Examples

If you want to view readme.txt in your repository without checking it out:

$ svn cat http://svn.red-bean.com/repos/test/readme.txt This is a README file.

You should read this.

Tip

If your working copy is out of date (or you have local modifications) and you want to see the HEAD revision of a file in your working copy, svn cat will automatically fetch the HEAD revision when you give it a path:

$ cat foo.c

This file is in my local working copy and has changes that I've made.

168

Subversion Complete Reference

$ svn cat foo.c

Latest revision fresh from the repository!

169

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