Example of SVN operation Batch Processing

Source: Internet
Author: User
Example of SVN operation Batch Processing

For one sentence: do not do what machines can do.

Every day I work with SVN, update, open directory, and repeat every day. Every time I write some commands, it's boring. If I don't talk about it, let's look at the following:

1 @ echo off
2 REM display
3 @ echo important items
4 @ echo ************************************* ***********************************
5 @ ECHO: You can streamline and Schedule Tasks for automatic execution. Check the following directory before running the task:
6 @ echo.
7 @ Echo 1. svn_bin is the executable program directory for installing the tortoisesvn client.
8 @ Echo 2. svn_work is the directory for updating the project file
9 @ echo.
10 @ echo win7, winvista, or win2008 users can run the command as administrators.
11 @ echo ************************************* ***********************************
12
13. Modify the rem path variable according to the actual conditions. Do not add a slash at the end.
14 @ set svn_bin = D: \ Program Files \ tortoisesvn \ bin
15 @ set svn_work = E: \ SVN
16
17. Rem checks whether the executable files and project file directories are correct
18 @ if not exist "% svn_bin % \ tortoiseproc.exe "(
19 echo.
20 echo error: Are you sure the tortoisesvn client directory is correct?
21 echo currently defines: % svn_bin %
22 echo.
23 pause & Exit 1
24)
25 if not exist "% svn_work % \. SVN "(
26 echo.
27 echo error: Are you sure the svn project file directory is correct?
28 echo currently defines: % svn_bin %
29 echo.
30 pause & Exit 2
31)
32
33. Operation menu displayed on Rem
34: Menu
35 echo.
36 echo ☆☆☆select a number and press ENTER ☆☆☆
37 echo.
38 Echo 1. SVN full directory update
39 echo.
40 Echo 2. Open SVN (dedicated for QA) of a certain project)
41 echo.
42 Echo 3. Open the XX Project Website SVN (dedicated to QA)
43 echo.
44 Echo 4. SVN full-directory logs
45 echo.
46 Echo 0. Exit
47 echo.
48 set choice =
49 set/p choice = select the corresponding number to enter:
50 if not "% choice %" = "" choice = % choice :~ 0, 1%
51 if/I "% choice %" = "1" Goto start1
52 If/I "% choice %" = "2" Goto start2
53 If/I "% choice %" = "3" Goto start3
54 if/I "% choice %" = "4" Goto start4
55 if/I "% choice %" = "0" Goto exit
56 echo selection is invalid. Please enter again...
57 echo.
58 Goto: Menu
59
60: start1
61 CLS
62 echo SVN directory update
63 echo.
64 REM update SNV
65 "% svn_bin %" \ tortoiseproc.exe/command: update/path: "% svn_work %"/notempfile/closeonend: 4
66 echo completed. Return to the main menu
67 Goto: Menu
68
69: start2
70 CLS
71 echo open svn xx project directory
72 echo.
73 REM open a certain project and write it to death
74 Explorer/e, "% svn_work % \ Testing \ videocomm"
75 Goto: Menu
76
77: start3
78 CLS
79 echo open the svn XX Project website directory
80 echo.
81 Explorer/e, "% svn_work % \ Testing \ trunk \"
82 Goto: Menu
83
84: start4
85 CLS
86 echo open SVN full-directory logs
87 echo.
88 "% svn_bin %" \ tortoiseproc.exe/command: log/path: "% svn_work %"/notempfile/closeonend: 0
89 Goto: Menu

There are a few operations in the middle, which can be increased or decreased based on actual needs. The code line should be streamlined. Which of the following can be used to try it if there is nothing left to do?

Command Line instructions for SVN

Command
Description

: About
The dialog box is displayed. If the command is not given, it is displayed.

: Log
Open the log dialog box,/pathSpecify the file or directory for displaying logs. You can set the following options:/startrev:xxx,/endrev:xxxAnd/strict

: Checkout
Open the check-out dialog box,/pathThe target path is specified, while/urlThe detected URL is specified.

: Import
Open the import dialog box,/pathSpecifies the data import path.

: Update
Replace/pathUpdate to head. If a parameter is specified/revA dialog box is displayed asking you which version to update. To prevent specified revision versions/rev:1234Dialog box, required/nonrecursiveAnd/ignoreexternals.

: Commit
Open the submit dialog box,/pathSpecify the target path or list of files to be submitted. You can also use the Parameter/logmsgYou can also use/logmsgfile:path,pathPoint to the file that saves the log information. You can use/bugid:"the bug id here"Complete this task.

: Add
Set/pathAdd the file to version control.

: Revert
Recover local modifications to work copies,/pathIndicates which entries are restored.

: Cleanup
Clear the interrupted and terminated operations, and replace/pathUnlock.

: Resolve
Set/pathThe specified file conflict is identified as a solution./noquestionThe solution does not confirm the operation with the user.

: Repocreate
In/pathCreate a version library.

: Switch
Open the option dialog box./pathSpecify the target directory.

: Export
Set/pathTo another directory, if/pathPoint to another version control directory, the dialog box will ask to export/path.

: Merge
Opens the merge dialog./pathSpecifies 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:xxxAnd/torev:xxx. These pre-fill the relevant fields in the merge dialog.

: Mergeall
Opens the merge all dialog./pathSpecifies the target directory.

: Copy
Brings up the branch/Tag dialog./pathIs the working copy to branch/tag from. And/urlIs the target URL. You can also specify/logmsgSwitch 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:path, WherepathPoints to a file containing the log message.

: Settings
Open the Settings dialog box.

: Remove
Remove from Version Control/path.

: Rename
Rename/pathIn the dialog box, a new file is asked. To prevent similar files from being asked in one step/noquestion.

: Diff
Starts the external diff program specified in the tortoisesvn settings./pathSpecifies the first file. If the option/path2Is set, then the diff program is started with those two files. If/path2Is omitted, then the diff is done between the file in/pathAnd its base. To explicitly set the revision numbers use/startrev:xxxAnd/endrev:xxx. If/blameIs set and/path2Is not set, then the diff is done by first blaming the files with the given revisions.

: Showcompare

Depending on the URLs and revisions to compare, this either shows a uniied diff (if the optionunifiedIs set), a dialog with a list of files that have changed or if the URLs point to files starts the diff viewer for those two files.

The optionsurl1,url2,revision1Andrevision2Must be specified. The optionspegrevision,ignoreancestry,blameAndunifiedAre optional.

: Conflicteditor
Starts the conflict editor specified in the tortoisesvn settings with the correct files for the conflicted file in/path.

: Relocate
Open the relocation dialog box,/pathSpecifies the path of the relocated working copy.

: Help
Open the Help File

: Repostatus
Open the "Modify detection" dialog box,/pathThe working copy directory is specified.

: Repobrowser
Starts the repository browser dialog, pointing to the URL of the working copy given in/pathOr/pathPoints directly to an URL. An additional option/rev:xxxCan be used to specify the revision which the repository browser shocould show. If/rev:xxxIs omitted, It defaults to head. If/pathPoints to an URL,/projectpropertiespath:path/to/wcSpecifies the path from where to read and use the project properties.

: Ignore
Set/pathAdd objects to the ignore list, that is, add these filessvn:ignoreAttribute.

: Blame

Is/pathOption.

If/startrevAnd/endrevOption. The query trace range dialog box is not displayed. Use the version number in these options directly.

If/line:nnnOption, tortoiseblame will display the specified number of rows.

Also supported/ignoreeol,/ignorespacesAnd/ignoreallspaces.

: Cat
Set/pathSave the specified working copy or URL file/savepath:path, The version number is/revision:xxx.

: Createpatch
Create/path.

: Revisiongraph
Display/pathVersion changes under the directory.

: Lock
Locks a file or all files in a directory given in/path. The 'lock' dialog is shown so the user can enter a comment for the lock.

: Unlock
Unlocks a file or all files in a directory given in/path.

: Rebuildiconcache
Rebuilds the Windows Icon cache. only use this in case the Windows icons are already upted. A side effect of this (which can't be avoided) is that the icons on the desktop get rearranged. to suppress the message box, pass/noquestion.

: Properties
Display/pathThe path Properties dialog box is displayed.

In addition:

1. If you want to automatically close the progress dialog box after it is executed without setting permanent parameters, you can pass the/closeonend parameter.
2/closeonend: 0 does not automatically close the dialog box
3/closeonend: 1. automatically close the dialog box if no error occurs.
4/closeonend: 2 automatically closes the dialog box if no errors or conflicts occur.
5/closeonend: 3 will be automatically disabled if there are no errors, conflicts, and mergers
6/closeonend: 4 if there are no errors, conflicts, and mergers, it will be automatically disabled
7. All commands that can be accessed using tortoiseproc.exe are listed below. As described above, the/command: ABCD format must be used. In the list, the/command prefix is omitted because of space saving.

Example:

1 Examples (which should be entered on one line):
2 TortoiseProc.exe /command:commit
3 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
4 /logmsg:"test log message" /closeonend:0
5
6 TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0
7
8 TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
9 /startrev:50 /endrev:60 /closeonend:0

Example of SVN operation Batch Processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.