-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtsvn.bat
91 lines (73 loc) · 2.41 KB
/
tsvn.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@rem TortoiseSVN command line client wrapper
@rem
@rem This is a wrapper around the 'tortoiseproc' executable. The invocation is
@rem compatible to the 'svn' command line client.
@echo off
setlocal
rem No arguments given on command line -> print usage and quit
if "%1" == "" (
echo usage: %0 ^<command^> [PATH...]
echo TortoiseSVN command-line client wrapper.
echo.
echo Available subcommands:
echo blame (praise, annotate, ann^)
echo commit (ci^)
echo diff (di^)
echo help (h^)
echo list (ls^)
echo log
echo proplist (plist, pl^)
echo status (stat, st^)
echo update (up^)
exit /B 0
)
rem command mapping for tortoiseproc
set TORTOISECMD=
if "%1" == "blame" set TORTOISECMD=blame
if "%1" == "praise" set TORTOISECMD=blame
if "%1" == "annotate" set TORTOISECMD=blame
if "%1" == "ann" set TORTOISECMD=blame
if "%1" == "commit" set TORTOISECMD=commit
if "%1" == "ci" set TORTOISECMD=commit
if "%1" == "diff" set TORTOISECMD=diff
if "%1" == "di" set TORTOISECMD=diff
if "%1" == "help" set TORTOISECMD=help
if "%1" == "h" set TORTOISECMD=help
if "%1" == "list" set TORTOISECMD=repobrowser
if "%1" == "ls" set TORTOISECMD=repobrowser
if "%1" == "log" set TORTOISECMD=log
if "%1" == "proplist" set TORTOISECMD=properties
if "%1" == "plist" set TORTOISECMD=properties
if "%1" == "pl" set TORTOISECMD=properties
if "%1" == "status" set TORTOISECMD=repostatus
if "%1" == "stat" set TORTOISECMD=repostatus
if "%1" == "st" set TORTOISECMD=repostatus
if "%1" == "update" set TORTOISECMD=update
if "%1" == "up" set TORTOISECMD=update
rem Unknown subcommand -> abort
if "%TORTOISECMD%" == "" (
echo Unknown subcommand: '%1'
echo Type '%0' for usage.
exit /B 1
)
rem Shift away %1 (tsvn.bat subcommand) for parameter parsing
shift
rem Parse parameters
set TORTOISEPATH=
:parse
if "%1" == "" goto endparse
rem Concatenate path names using the asterisk character '*' as path separator
set TORTOISEPATH=%TORTOISEPATH%%1*
shift
goto parse
:endparse
rem Adapt path parameter for tortoiseproc
if "%TORTOISEPATH%" == "" (
rem No path parameter given on command line -> use the current directory '.' as default
set TORTOISEPATH=.
) else (
rem Remove trailing asterisk
set TORTOISEPATH=%TORTOISEPATH:~0,-1%
)
echo on
start tortoiseproc /command:%TORTOISECMD% /path:"%TORTOISEPATH%"