-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsvn.sh
79 lines (72 loc) · 1.74 KB
/
tsvn.sh
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
#!/bin/sh
# TortoiseSVN command line client wrapper
#
# This is a wrapper around the 'tortoiseproc' executable. The invocation is
# compatible to the 'svn' command line client.
# No arguments given on command line -> print usage and quit
if test "$#" -eq 0
then
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 0
fi
# command mapping for tortoiseproc
case "$1" in
blame|praise|annotate|ann)
TORTOISECMD=blame;;
commit|ci)
TORTOISECMD=commit;;
diff|di)
TORTOISECMD=diff;;
help|h)
TORTOISECMD=help;;
list|ls)
TORTOISECMD=repobrowser;;
log)
TORTOISECMD=log;;
proplist|plist|pl)
TORTOISECMD=properties;;
status|stat|st)
TORTOISECMD=repostatus;;
update|up)
TORTOISECMD=update;;
*)
# Unknown subcommand -> abort
echo "Unknown subcommand: '$1'"
echo "Type '$0' for usage."
exit 1
;;
esac
# Shift away $1 (tsvn.sh subcommand) for parameter parsing
shift
# Parse parameters
TORTOISEPATH=
for path in "$@";
do
# Concatenate path names using the asterisk character '*' as path separator
TORTOISEPATH="$TORTOISEPATH$path*"
done
# Adapt path parameter for tortoiseproc
if test -z "$TORTOISEPATH"
then
# No path parameter given on command line -> use the current directory '.' as default
#TORTOISEPATH=.
# "." does not work with Unix paths, use absolute path and convert "/c/..." to "C:/..."
TORTOISEPATH="C:${PWD##/c}"
else
# Remove trailing asterisk
TORTOISEPATH="${TORTOISEPATH%%\*}"
fi
set -x
start tortoiseproc /command:$TORTOISECMD /path:"$TORTOISEPATH"