author | Mikael Berthe <mikael@lilotux.net> |
Sat, 27 Apr 2019 22:54:09 +0200 | |
changeset 42 | 2431e6a9344a |
parent 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 |
||
42 | 10 |
integer i j |
11 |
i=$(hg id -r tip --num) |
|
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
12 |
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
|
13 |
hg pull $@ |
42 | 14 |
j=$(hg id -r tip --num) |
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
15 |
local j_h=$(hg id -r tip --id) |
4 | 16 |
|
9 | 17 |
if (( $i != $j ));then |
25 | 18 |
hg log --quiet --style=changelog -r "$i:$j and not $i" |
10
ed98b8ea395d
Improve hg_pull_and_see (accept hg pull argument)
Mikael Berthe <mikael@lilotux.net>
parents:
9
diff
changeset
|
19 |
print "\nPulled from ${i_h} to ${j_h}." |
4 | 20 |
fi |
21 |
} |