]>
Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/svn-wrapper
2 # Wrapper script around SVN to support using $PAGER and other handy tools.
9 black
='\e[0;30m'; lblack
='\e[1;30m'
10 red
='\e[0;31m'; lred
='\e[1;31m'
11 green
='\e[0;32m'; lgreen
='\e[1;32m'
12 yellow
='\e[0;33m'; lyellow
='\e[1;33m'
13 blue
='\e[0;34m'; lblue
='\e[1;34m'
14 purple
='\e[0;35m'; lpurple
='\e[1;35m'
15 cyan
='\e[0;36m'; lcyan
='\e[1;36m'
16 grey
='\e[0;37m'; lgrey
='\e[1;37m'
17 white
='\e[0;38m'; lwhite
='\e[1;38m'
35 # ------------------- #
36 # `main' starts here. #
37 # ------------------- #
40 # Define colors if stdout is a tty.
42 test "x${PAGER}" = "xmissing" && PAGER
=cat
51 s@^?\\(......\\)+@+\\1+@
52 s@^?\\(......\\)\\(.*/\\)+@+\\1\\2+@
53 s@^?\\(......\\),@,\\1,@
54 s@^?\\(......\\)\\(.*/\\),@,\\1\\2,@
55 s/^\\(.\\)C/\\1${lred}C${std}/
58 s/^?/${lblue}?${std}/; t
59 s/^M/${lgreen}M${std}/; t
60 s/^A/${lyellow}A${std}/; t
61 s/^X/${lblue}X${std}/; t
62 s/^+/${lyellow}+${std}/; t
63 s/^D/${lyellow}D${std}/; t
64 s/^,/${lred},${std}/; t
65 s/^C/${lred}C${std}/; t
66 s/^I/${purple}I${std}/; t
67 s/^R/${lyellow}R${std}/; t
68 s/^!/${lred}!${std}/; t
69 s/^~/${lwhite}~${std}/; t"
71 svn_log_delim
="------------------------------------------------------------------------"
74 sub(/^[ \t]+/, "", str);
75 sub(/[ \t]+$/, "", str);
78 /^r[0-9]+ \| [A-Za-z]+/ {
80 revnum=strip($1); author=strip($2); date=substr(strip($3), 0, 26);
82 if ($0 == "Changed paths:") {
91 while ($0 != "'${svn_log_delim}'") {
94 if (msg == "'${svn_log_delim}'") {
97 printf("'${yellow}'%s'${std}' %s '${lblack}'(by %s, %s)'${std}'\n", revnum, msg, author, date);
103 exec svn
"$@" | $PAGER
106 exec svn
"$@" | $PAGER
109 exec svn
"$@" | $PAGER
112 exec svn
"$@" | $PAGER
116 exec svn log
--stop-on-copy "$@" | awk -F"|" "${awk_svn_log_ll}" | $PAGER
119 exec svn
"$@" | $PAGER
122 exec svn
"$@" | sed "$sed_svn_st_color" | $PAGER
129 # vim: ts=2 sts=2 shiftwidth=2 expandtab