-
Notifications
You must be signed in to change notification settings - Fork 0
/
.overloadrc
103 lines (92 loc) · 1.69 KB
/
.overloadrc
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
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
## Just some colors for convienence.
Gr="\033[32;1m"
B="\033[4m"
R="\033[0m"
overload_echo() {
echo 0=$0 1=$1 2=$2 3=$3
}
svn_add() {
if [ -z "$1" ]; then
ARGS=$(svn st | awk '/^\?/{print $2}' | xargs)
if [ -n "$ARGS" ]; then
$original_command add $ARGS
fi
else
$original_command add "$@"
fi
}
svn_revert() {
if [ -z "$1" ]; then
ARGS=$(svn st | awk '/^M/{print $2}' | xargs)
if [ -n "$ARGS" ]; then
$original_command revert $ARGS
fi
else
$original_command revert "$@"
fi
}
svn_push() {
for f in $(svn st | awk '/^[AM]/{print $2}'); do
upload $f
done
}
svn_del() {
if [ -z "$1" ]; then
ARGS=$(svn st | awk '/^\!/{print $2}' | xargs)
if [ -n "$ARGS" ]; then
$original_command del $ARGS
fi
else
$original_command del "$@"
fi
}
svn_us() {
svn_upstatus "$@"
}
svn_upstatus() {
$original_command up "$@"
$original_command st "$@"
}
svn_ci() {
svn_commit "$@"
}
svn_commit() {
$original_command up
$original_command ci "$@"
}
svn_ct() {
svn_commit-ticket "$@"
}
svn_commit-ticket() {
ticket_number="$1"
shift
$original_command up
$original_command ci -m "Completed Ticket #$ticket_number" "$@"
}
svn_help() {
echo "Called svn help: 1=$1 2=$2 3=$3"
if [ -z "$1" ]; then
$original_command help
echo -ne $Gr
echo "The following commands have been overloaded:"
echo " * svn add"
echo " * svn del"
echo " * svn revert"
echo " * svn us (update then status)"
echo -ne $R
else
$original_command help "$@"
fi
}
hg_rm() {
if [ -z "$1" ]; then
ARGS=$(hg st $(hg root) | awk '/^\!/{print $2}' | xargs)
if [ -n "$ARGS" ]; then
echo $original_command rm $ARGS
$original_command rm $ARGS
fi
else
$original_command rm "$@"
fi
}