Manuals

Poglavje 6. Program SubWCRev

Kazalo

Program SubWCRev za ukazno vrtico
Zamenjava ključnih besed
Primer uprabe ključne besede
Vmesnik COM

SubWCRev je konzolna aplikacija, ki se uporablja za pridobivanje informacij o stanju delovne kopije z možnostjo zamenjave ključnih besed v predlogi. Postopek se pogosto uporablja kot del procesa gradnje projekta. S tem se v elemente projekta, ki se gradi, vnese informacije o delovni kopiji. Tipičen primer uporabe je prikaz številke revizije v pogovornem oknu O programu.

Program SubWCRev za ukazno vrtico

SubWCRev reads the Subversion status of all files in a working copy, excluding externals by default. It records the highest commit revision number found, and the commit timestamp of that revision, it also records whether there are local modifications in the working copy, or mixed update revisions. The revision number, update revision range and modification status are displayed on stdout.

SubWCRev.exe is called from the command line or a script, and is controlled using the command line parameters.

SubWCRev WorkingCopyPath [SrcVersionFile DstVersionFile] [-nmdfe]
      

PotDelovneKopije je pot do delovne kopije, ki se preverja. SubWCRev lahko uporabljate le na delovni kopiji, ne pa tudi neposredno na skladišču. Pot je lahko absolutna ali relativna na trenutno mapo.

Če želite, da SubWCRev opravi zamenjavo ključnih besed, tako da so polja revizija in naslov URL shranjena v besedilni datoteki, morate podati predlogo IzvirnaDatoteka in izhodno datoteko CiljnaDatoteka, ki vsebuje zamenjano verzijo predloge.

You can specify ignore patterns for SubWCRev to prevent specific files and paths from being considered. The patterns are read from a file named .subwcrevignore. The file is read from the specified path, and also from the working copy root. If the file does not exist, no files or paths are ignored. The .subwcrevignore file can contain multiple patterns, separated by newlines. The patterns are matched against the paths relative to the repository root and paths relative to the path of the .subwcrevignore file. For example, to ignore all files in the doc folder of the TortoiseSVN working copy, the .subwcrevignore would contain the following lines:

/trunk/doc
/trunk/doc/*

Or, assuming the .subwcrevignore file is in the working copy root which is checked out from trunk, using the patterns

doc
doc/*

is the same as the example above.

To ignore all images, the ignore patterns could be set like this:

*.png
*.jpg
*.ico
*.bmp

Pomembno

The ignore patterns are case-sensitive, just like Subversion is.

Namig

To create a file with a starting dot in the Windows explorer, enter .subwcrevignore.. Note the trailing dot.

There are a number of optional switches which affect the way SubWCRev works. If you use more than one, they must be specified as a single group, e.g. -nm, not -n -m.

Tabela 6.1. Seznam stikal ukazne vrstice, ki so na voljo

PreklopOpis
-nOb uporabi tega stikala se SubWCRev zaključi s številko napake ERRORLEVEL 7, če delovna kopija vsebuje krajevne spremembe. To stikalo se uporablja, da se prepreči gradnja projekta, ki vsebuje neobjavljene spremembe.
-NIf this switch is given, SubWCRev will exit with ERRORLEVEL 11 if the working copy contains unversioned items that are not ignored.
-mOb uporabi tega stikala se SubWCRev zaključi s številko napake ERRORLEVEL 8, če delovna kopija vsebuje mešane revizije. To stikalo se uporablja, da se prepreči gradnja projekta, ki vsebuje delno posodoboljeno delovno kopijo.
-dOb uporabi tega stikala se SubWCRev zaključi s številko napake ERRORLEVEL 9, če ciljna datoteka že obstaja.
-fOb uporabi tega stikala SubWCRev pri iskanju najvišje revizije vključi tudi mape. Po privzetih nastavitvah se išče najvišja revizija le na datotekah.
-eOb uporabi tega stikala SubWCRev pregleda mape, ki so označene z lastnostjo svn:externals, vendar le, če se nahajajo v istem skladišču. Privzeta nastavitev ne upošteva zunanjih datotek.
-EIf this switch is given, same as -e, but it ignores the externals with explicit revisions, when the revision range inside of them is only the given explicit revision in the properties. So it doesn't lead to mixed revisions.
-xOb uporabi tega stikala SubWCRev izpiše številke revizij v šestnajstiški obliki
-XOb uporabi tega stikala SubWCRev izpiše številke revizij v šestnajstiški obliki s predpono '0X'.
-FIf this switch is given, SubWCRev will ignore any .subwcrevignore files and include all files.
-qIf this switch is given, SubWCRev will perform the keyword substitution without showing working copy status on stdout.


If there is no error, SubWCRev returns zero. But in case an error occurs, the error message is written to stderr and shown in the console. And the returned error codes are:

Tabela 6.2. List of SubWCRev error codes

Error CodeOpis
1Syntax error. One or more command line parameters are invalid.
2The file or folder specified on the command line was not found.
3The input file could not be opened, or the target file could not be created.
4Could not allocate memory. This could happen if e.g. the source file is too big.
5The source file can not be scanned properly.
6SVN error: Subversion returned with an error when SubWCRev tried to find the information from the working copy.
7The working copy has local modifications. This requires the -n switch.
8The working copy has mixed revisions. This requires the -m switch.
9The output file already exists. This requires the -d switch.
10The specified path is not a working copy or part or one.
11The working copy has unversioned files or folders in it. This requires the -N switch.


TortoiseSVN homepage