Dodatek D. Avtomatizacija TortoiseSVN

Kazalo

Ukazi TortoiseSVN
Tsvncmd URL handler
Ukazi TortoiseIDiff
TortoiseUDiff Commands

Ker je vse ukaze TortoiseSVN možno krmiliti preko parameterov ukazne vrstice, lahko za avtomatizacijo uporabite paketno datoteko ali pa ukaze in pogovorna okna poganjate z določeni parameteri znotraj drugih programov (n. pr. iz vašega priljubljenega urejevalnika besedil).

Pomembno

Upoštevajte, da je TortoiseSVN odjemalec z grafičnim uporabniškim vmesnikom, to poglavje pa vam pove, kako lahko prikažete okna programa TortoiseSVN, tako da od uporabnika pridobite informacije. Če želite napisati ukazno datoteko, ki ne potrebuje vnosa s strani uporabnika, namesto TortoiseSVN uporabite uradni odjemalec Subversion za ukazno vrstico.

Ukazi TortoiseSVN

Program TortoiseSVN se imenuje TortoiseProc.exe. Vse ukaze kličemo s parametrom /command:abcd, kjer je abcd ime zahtevanega ukaza. Večina ukazov potrebuje vsaj eno pot kot parameter, ki ga podamo z /path:"neka\pot". V spodnji tabeli ukaz ustreza /command:abcd, pot pa parametru /path:"neka\pot".

There's a special command that does not require the parameter /command:abcd but, if nothing is specified on the command line, starts the project monitor instead. If /tray is specified, the project monitor starts hidden and only adds its icon to the system tray.

Ker nekateri ukazi sprejmejo seznam ciljnih poti (n. pr. ko objavljate več datotek), lahko podamo parametru /path več poti, ki jih ločimo z znakom *.

You can also specify a file which contains a list of paths, separated by newlines. The file must be in UTF-16 format, without a BOM. If you pass such a file, use /pathfile instead of /path. To have TortoiseProc delete that file after the command is finished, you can pass the parameter /deletepathfile. If you don't pass /deletepathfile, you have to delete the file yourself or the file gets left behind.

Pogovorno okno, ki se uporablja pri objavah, posodobitvah in ostalih ukazih običajno ostane odprto dokler ne pritisnemo na gumb V redu. To obnašanje lahko spremenimo z nastavitvami aplikacije. Vendar se bo pogovorno okno zaprlo v vsakem primeru - če ga pokličete iz paketne datoteke ali iz kontekstnega menija.

Za nastavitev druge lokacije konfiguracijske datoteke uporabite parameter /configdir:"pot\do\konfiguracijske\mape". S tem preprišete privzete vrednosti, vključno z zapisi v registru.

To close the progress dialog at the end of a command automatically without using the permanent setting you can pass the /closeonend parameter.

  • /closeonend:0 okna ne zapri samodejno

  • /closeonend:1 samodejno zapri, če ni napak

  • /closeonend:2 samodejno zapri, če ni napak in sporov

  • /closeonend:3 samodejno zapri, če ni napak, sporov ali spajanj

To close the progress dialog for local operations if there were no errors or conflicts, pass the /closeforlocal parameter.

Spodnja tabela prikazuje vse ukaze, do katerih lahko dostopate preko programa TortoiseProc.exe. Ko smo že omenili zgoraj, uporabljamo obliko /command:abcd. V tabeli smo zaradi varčevanja s prostorom opustili predpono /command.

Tabela D.1. Seznam ukazov in možnosti

UkazOpis
:aboutPokaže pogovorno okno "O programu". Prikaže se tudi, če ne podamo pokaza.
:log

Opens the log dialog. The /path specifies the file or folder for which the log should be shown. Additional options can be set:

  • /startrev:xxx,

  • /endrev:xxx,

  • /strict enables the 'stop-on-copy' checkbox,

  • /merge enables the 'include merged revisions' checkbox,

  • /datemin:"{datestring}" sets the start date of the filter, and

  • /datemax:"{datestring}" sets the end date of the filter. The date format is the same as used for svn date revisions.

  • /findstring:"filterstring" fills in the filter text,

  • /findtext forces the filter to use text, not regex, or

  • /findregex forces the filter to use regex, not simple text search, and

  • /findtype:X with X being a number between 0 and 511. The numbers are the sum of the following options:

    • /findtype:0 filter by everything

    • /findtype:1 filter by messages

    • /findtype:2 filter by path

    • /findtype:4 filter by authors

    • /findtype:8 filter by revisions

    • /findtype:16 not used

    • /findtype:32 filter by bug ID

    • /findtype:64 not used

    • /findtype:128 filter by date

    • /findtype:256 filter by date range

  • If /outfile:path\to\file is specified, the selected revisions are written to that file when the log dialog is closed. The revisions are written in the same format as is used to specify revisions in the merge dialog.

An svn date revision can be in one of the following formats:

  • {2006-02-17}

  • {15:30}

  • {15:30:00.200000}

  • {"2006-02-17 15:30"}

  • {"2006-02-17 15:30 +0230"}

  • {2006-02-17T15:30}

  • {2006-02-17T15:30Z}

  • {2006-02-17T15:30-04:00}

  • {20060217T1530}

  • {20060217T1530Z}

  • {20060217T1530-0500}

:checkoutOpens the checkout dialog. The /path specifies the target directory and the /url specifies the URL to checkout from. If you specify the key /blockpathadjustments, the automatic checkout path adjustments are blocked. The /revision:XXX specifies the revision to check out.
:importOpens the import dialog. The /path specifies the directory with the data to import. You can also specify the /logmsg switch to pass a predefined log message to the import dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:pot, where pot points to a file containing the log message.
:updateUpdates the working copy in /path to HEAD. If the option /rev is given then a dialog is shown to ask the user to which revision the update should go. To avoid the dialog specify a revision number /rev:1234. Other options are /nonrecursive, /ignoreexternals and /ignoreexternals. The /stickydepth indicates that the specified depth should be sticky, creating a sparse checkout. The /skipprechecks can be set to skip all checks that are done before an update. If this is specified, then the Show log button is disabled, and the context menu to show diffs is also disabled after the update.
:commitOdpre pogovorno okno za objave. /path določa ciljno mapo ali seznam datotek za objavo. Določite lahko tudi stikalo /logmsg, s katerim določite sporočilo dnevniškega zapisa. Če pa ne želite podati sporočila v ukazni vrstici, uporabite /logmsgfile:pot, kjer pot kaže na datoteko, ki vsebuje sporočilo zapisa. Za izpolnitev polja ID hrošča (če ste pravilno nastavili integracijo s sledilnikom zadev) lahko uporabite /bugid:"številka hrošča".
:addDoda datoteke v /path v sistem verzioniranja.
:revertPovrne krajevne spremembe v delovni kopiji. /path pove, katere elemente je potrebno povrniti.
:cleanupCleans up interrupted or aborted operations and unlocks the working copy in /path. You also have to pass the /cleanup to actually do the cleanup. Use /noui to prevent the result dialog from popping up (either telling about the cleanup being finished or showing an error message). /noprogressui also disables the progress dialog. /nodlg disables showing the cleanup dialog where the user can choose what exactly should be done in the cleanup. The available actions can be specified with the options /cleanup for status cleanup, /breaklocks to break all locks, /revert to revert uncommitted changes, /delunversioned, /delignored, /refreshshell, /externals, /fixtimestamps and /vacuum.
:resolveOznači sporno datoteko, podano v /path, kot rešeno. Če je podana možnost /noquestion, se označevanje izvede brez uporanikove potrditve.
:repocreateV /path ustvari skladišče
:switchOpens the switch dialog. The /path specifies the target directory and /url the URL to switch to.
:exportExports the working copy in /path to another directory. If the /path points to an unversioned directory, a dialog will ask for an URL to export to the directory in /path. If you specify the key /blockpathadjustments, the automatic export path adjustments are blocked.
:dropexportExports the working copy in /path to the directory specified in /droptarget. This exporting does not use the export dialog but executes directly. The option /overwrite specifies that existing files are overwritten without user confirmation, and the option /autorename specifies that if files already exist, the exported files get automatically renamed to avoid overwriting them. The option /extended can specify either localchanges to only export files that got changed locally, or unversioned to also export all unversioned items as well.
:dropvendorCopies the folder in /path recursively to the directory specified in /droptarget. New files are added automatically, and missing files get removed in the target working copy, basically ensuring that source and destination are exactly the same. Specify /noui to skip the confirmation dialog, and /noprogressui to also disable showing the progress dialog.
:mergeOpens the merge dialog. The /path specifies the target directory. For merging a revision range, the following options are available: /fromurl:URL, /revrange:string. For merging two repository trees, the following options are available: /fromurl:URL, /tourl:URL, /fromrev:xxx and /torev:xxx.
:mergeallOdpre okno za spajanje. /path določa ciljno mapo.
:copyBrings up the branch/tag dialog. The /path is the working copy to branch/tag from. And the /url is the target URL. If the urls starts with a ^ it is assumed to be relative to the repository root. To already check the option Switch working copy to new branch/tag you can pass the /switchaftercopy switch. To check the option Create intermediate folders pass the /makeparents switch. You can also specify the /logmsg switch to pass a predefined log message to the branch/tag dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:pot, where pot points to a file containing the log message.
:settingsOdpre okno za nastavitve
:removeOdstrani datoteke v /path iz sistema Subversion.
:renamePreimenuje datoteko v /path. Novo ime vpišete v pogovornem oknu. Če se želite izgoniti vprašanju o preimenovanju podobnih datotek v enem koraku, podajte /noquestion.
:diffStarts the external diff program specified in the TortoiseSVN settings. The /path specifies the first file. If the option /path2 is set, then the diff program is started with those two files. If /path2 is omitted, then the diff is done between the file in /path and its BASE. If the specified file also has property modifications, the external diff tool is also started for each modified property. To prevent that, pass the option /ignoreprops. To explicitly set the revision numbers use /startrev:xxx and /endrev:xxx, and for the optional peg revision use /pegrevision:xxx. If /blame is set and /path2 is not set, then the diff is done by first blaming the files with the given revisions. The parameter /line:xxx specifies the line to jump to when the diff is shown.
:shelveShelves the specified paths in a new shelf. The option /shelfname:name specifies the name of the shelf. An optional log message can be specified with /logmsg:message. If option /checkpoint is passed, the modifications of the files are kept.
:unshelveApplies the shelf with the name /shelfname:name to the working copy path. By default the last version of the shelf is applied, but you can specify a version with /version:X.
:showcompare

Odvisno od naslovov URL in revizij, ki jih želite primerjati, se prikaže poenotena razlika (če je nastavljena možnost unified), seznam spremenjenih datotek ali (v primeru, da naslov URL kaže na datoteko) pregledovalnik sprememb za ti dve datoteki.

Možnosti url1, url2, revision1 in revision2 so obvezne, možnosti pegrevision, ignoreancestry, blame in unified pa opcijske.

If the specified url also has property modifications, the external diff tool is also started for each modified property. To prevent that, pass the option /ignoreprops.

If a unified diff is requested, an optional prettyprint option can be specified which will show the merge-info properties in a more user readable format.

:conflicteditorZažene urejevalnik sporov, ki je naveden v nastavitvah TortoiseSVN, s pravilnimi datotekami za sporno datoteko /path.
:relocateOdpre pogovorno okno za premestitev. /path določa pot delovne kopije za premestitev.
:helpOdpre datoteko pomoči.
:repostatusOpens the check-for-modifications dialog. The /path specifies the working copy directory. If /remote is specified, the dialog contacts the repository immediately on startup, as if the user clicked on the Check repository button.
:repobrowser

Starts the repository browser dialog, pointing to the URL of the working copy given in /path or /path points directly to an URL.

An additional option /rev:xxx can be used to specify the revision which the repository browser should show. If the /rev:xxx is omitted, it defaults to HEAD.

If /path points to an URL, the /projectpropertiespath:path/to/wc specifies the path from where to read and use the project properties.

If /outfile:path\to\file is specified, the selected URL and revision are written to that file when the repository browser is closed. The first line in that text file contains the URL, the second line the revision in text format.

:ignoreDoda vse cilje v /path na seznam prezrtih elementov, to pomeni, da datotekam doda lastnost svn:ignore.
:blame

Odpre pogovorno okno Okrivi za datoteko, podano z opcijo /path.

Če sta nastavljevni možnosti /startrev in /endrev, se ne pojavi pogovorno okno za vnos območja revizij, ampak se uporabita navedeni vrednosti.

Če je nastavljena opcija /line:nnn, se ob zagonu TortoiseBlame prikaže navedena vrstica.

Podprte so tudi možnosti /ignoreeol, /ignorespaces in /ignoreallspaces.

:catShrani datoteko z naslova URL ali delovne kopije, navedene v /path, na lokacijo /savepath:pot. /revision:xxx predstavlja številko revizije. S tem lahko prevzamemo datoteko v določeni reviziji.
:createpatchCreates a patch file for the path given in /path. To skip the file Save-As dialog you can pass /savepath:pot to specify the path where to save the patch file to directly. To prevent the unified diff viewer from being started showing the patch file, pass /noview. If a unified diff is requested, an optional prettyprint option can be specified which will show the merge-info properties in a more user readable format.
:revisiongraph

Shows the revision graph for the path given in /path.

To create an image file of the revision graph for a specific path, but without showing the graph window, pass /output:path with the path to the output file. The output file must have an extension that the revision graph can actually export to. These are: .svg, .wmf, .png, .jpg, .bmp and .gif.

Since the revision graph has many options that affect how it is shown, you can also set the options to use when creating the output image file. Pass these options with /options:XXXX, where XXXX is a decimal value. The best way to find the required options is to start the revision graph the usual way, set all user-interface options and close the graph. Then the options you need to pass on the command line can be read from the registry HKCU\Software\TortoiseSVN\RevisionGraphOptions.

:lockZaklene datoteko ali vse datoteke v mapi, podani v /path. Pogovorno okno za zaklepanje se pojavi, da lahko uporabnik vnese sporočilo zaklepanja.
:unlockOdklene datoteko ali vse datoteke v mapi, podani v /path.
:rebuildiconcachePonovno zgradi predpomnilnik ikon sistema. Ta ukaz uporabite le v primeru, če se ikone na nek način poškodujejo. Neizogiben stranski učinek tega postopka je, da se ikone na namizju prerazporedijo po svoje. Če sporočila ne želite videti, podajte /noquestion.
:properties

Shows the properties dialog for the path given in /path.

For dealing with versioned properties this command requires a working copy.

Revision properties can be viewed/changed if /path is an URL and /rev:XXX is specified.

To open the properties dialog directly for a specific property, pass the property name as /property:name.

:sync

Exports/imports settings, either depending on whether the current settings or the exported settings are newer, or as specified.

If a path is passed with /path, then the path is used to store or read the settings from.

The parameter /askforpath will show a file open/save dialog for the user to chose the export/import path.

If neither /load nor /save is specified, then TortoiseSVN determines whether to export or import the settings by looking at which ones are more recent. If the export file is more recent than the current settings, then the settings are loaded from the file. If the current settings are more recent, then the settings are exported to the settings file.

If /load is specified, the settings are imported from the settings file.

If /save is specified, the current settings are exported to the settings file.

The parameter /local forces a settings export to include local settings, i.e. settings that refer to local paths.


Primeri (vpisati jih je potrebno v eno vrstico):

TortoiseProc.exe /command:commit
                 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
                 /logmsg:"sporočilo" /closeonend:0

TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0

TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
                 /startrev:50 /endrev:60 /closeonend:0