]>
gitweb.pimeys.fr Git - config-20-100.git/blob - .zsh/rc/extra/02_mercurial
3 # mercurial related stuff {{{
4 if check_com
-c hg
; then
5 # gnu like diff for mercurial
6 # http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks
7 #f5# GNU like diff for mercurial
10 for i
in $
(hg status
-marn "$@") ; diff -ubwd <(hg
cat "$i") "$i"
13 # build debian package
14 #a2# Alias for \kbd{hg-buildpackage}
15 alias hbp
='hg-buildpackage'
17 # execute commands on the versioned patch-queue from the current repos
18 alias mq
='hg -R $(readlink -f $(hg root)/.hg/patches)'
20 # diffstat for specific version of a mercurial repository
21 # hgstat => display diffstat between last revision and tip
22 # hgstat 1234 => display diffstat between revision 1234 and tip
23 #f5# Diffstat for specific version of a mercurial repos
26 [[ -n "$1" ]] && hg
diff -r $1 -r tip | diffstat || hg
export tip | diffstat
29 #f5# Get current mercurial tip via hg itself
33 if [[ -f mercurial-tree
/.hg
]] ; then
35 echo "Running hg pull for retreiving latest version..."
37 echo "Finished update. Building mercurial"
39 echo "Setting \$PATH to $PWD:\$PATH..."
40 export PATH
="$PWD:$PATH"
42 echo "Downloading mercurial via hg"
43 hg clone http
://selenic.com
/repo
/hg mercurial-tree
45 echo "Building mercurial"
47 echo "Setting \$PATH to $PWD:\$PATH..."
48 export PATH
="$PWD:$PATH"
49 echo "make sure you set it permanent via ~/.zshrc if you plan to use it permanently."
50 # echo "Setting \$PYTHONPATH to PYTHONPATH=\${HOME}/lib/python,"
51 # export PYTHONPATH=${HOME}/lib/python
55 fi # end of check whether we have the 'hg'-executable
57 # get current mercurial snapshot
58 #f5# Get current mercurial snapshot
62 if [[ -f mercurial-snapshot.
tar.gz
]] ; then
63 echo "mercurial-snapshot.tar.gz exists already, skipping download."
65 echo "Downloading mercurial snapshot"
66 wget http
://www.selenic.com
/mercurial
/mercurial-snapshot.
tar.gz
68 echo "Unpacking mercurial-snapshot.tar.gz"
69 tar zxf mercurial-snapshot.
tar.gz
70 cd mercurial-snapshot
/
71 echo "Installing required build-dependencies"
73 $SUDO apt-get
install python2.4
-dev
74 echo "Building mercurial"
76 echo "Setting \$PATH to $PWD:\$PATH..."
77 export PATH
="$PWD:$PATH"
78 echo "make sure you set it permanent via ~/.zshrc if you plan to use it permanently."