author | Mikael Berthe <mikael@lilotux.net> |
Sun, 15 Jul 2012 01:58:11 +0200 | |
changeset 10 | ed98b8ea395d |
parent 9 | d7843f267d79 |
child 25 | 709f9a3b120e |
permissions | -rw-r--r-- |
4 | 1 |
|
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
2 |
# Use the same arguments as hg pull |
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
3 |
# e.g. "hg_pull_and_see -u" |
4 | 4 |
function hg_pull_and_see() { |
5 |
if ! $HG_ROOT_CMD > /dev/null; then |
|
6 |
print "Not a Mercurial repository!" |
|
7 |
return -1 |
|
8 |
fi |
|
9 |
||
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
10 |
local i=$(hg id -r tip --num) |
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
11 |
local i_h=$(hg id -r tip --id) |
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
12 |
hg pull $@ |
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
13 |
local j=$(hg id -r tip --num) |
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
14 |
local j_h=$(hg id -r tip --id) |
4 | 15 |
|
9 | 16 |
if (( $i != $j ));then |
17 |
hg log --quiet --style=changelog -r "not ancestors($i)" |
|
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
18 |
print "\nPulled from ${i_h} to ${j_h}." |
4 | 19 |
fi |
20 |
} |