You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tobias Bading <tb...@web.de> on 2013/06/06 13:32:23 UTC
Subversion 1.8 appreciation thread
Hi *,
I'm currently checking out (no pun intended) Subversion 1.8 RC2 and
thought a "Subversion 1.8 goodies" thread might be fun. Here we go...
Goodie #1:
Are you multitasking all day long?
Are you tired of remembering all those fancy changelist names you came
up with to keep the chaos in check?
Well, fret no more. Let your tab key do the thinking!
Simply create a shell script called svn-changelists with this content:
#!/bin/bash
dir=$PWD
while [[ ${#dir} != 0 ]]; do
if [[ -r $dir/.svn/wc.db ]]; then
sqlite3 $dir/.svn/wc.db 'select distinct(changelist) from actual_node;'
break;
fi
dir=${dir%/*}
done
Now use it in your favority shell's completion feature. I'm using
good-ol' tcsh, so that's
complete svn 'n@--changelist@`svn-changelists`@' [...]
Conclusion:
SQLite rulz! ;-)
Re: Subversion 1.8 appreciation thread
Posted by Tobias Bading <tb...@web.de>.
Goody #2: (People probably came up with something like this for
Subversion 1.7 already... anyway...)
Our company currently uses Subversion 1.6 and at first I thought
'duel-Subversioning' 1.6 and 1.8 would lead nowhere except headaches. As
it turns out, the fact that a Subversion 1.8 client cannot directly work
with a Subversion 1.6 working copy is no problem at all, at least not on
GNU/Linux in a shell or GNU Emacs.
First, make sure you have both Subversion versions installed and that
you have links on your $PATH named svn-1.6 and svn-1.8 that link to the
respective binaries. Then create a shell script called svn with this
content: (work in progress)
--- snip ---
#!/bin/bash
# check whether the command uses Subversion 1.8 features:
usesNewFeature=0
for arg in "$@"; do
if [[ "$arg" = "--search" || "$arg" = "--diff" || "$arg" = "--new" ||
"$arg" = "--old" ]]; then
usesNewFeature=1;
break;
fi
done
if [[ "$1" = "upgrade" || ( "$1" = "help" && "$2" = "upgrade" ) ]]; then
usesNewFeature=1;
fi
# decide which Subversion version to use:
if [[ $usesNewFeature = 0 && -f .svn/entries && "`head -1 .svn/entries`"
!= "12" ]]; then
cmd=svn-1.6
else
cmd=svn-1.8
fi
# debug logging:
# echo `date` "[PWD=$PWD]" -- $cmd "$@" >>~/.svn.log
exec $cmd "$@"
--- snip ---
There you go. A svn command that is able to deal with 1.6 and 1.8
working copies.
Those are the two goodies I came up with so far. Who's next?
Kind regards,
Tobias