author | Mikael Berthe <mikael@lilotux.net> |
Wed, 03 Oct 2018 22:57:00 +0200 | |
changeset 38 | 54b86a545f6c |
parent 25 | 709f9a3b120e |
child 42 | 2431e6a9344a |
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 |
25 | 17 |
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
|
18 |
print "\nPulled from ${i_h} to ${j_h}." |
4 | 19 |
fi |
20 |
} |