Last active
May 31, 2024 04:39
-
-
Save k-takata/3a152aa2307cc3969cfd to your computer and use it in GitHub Desktop.
Do 'hg pull' and 'hg pull --mq' easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mainbundle=hg_main.bundle | |
mqbundle=hg_mq.bundle | |
rm -f $mainbundle $mqbundle | |
hg --pager=no incoming -v --bundle $mainbundle | |
if [ $? -eq 255 ]; then | |
exit 1 | |
fi | |
hg --pager=no incoming --mq -v --bundle $mqbundle | |
if [ -e $mainbundle ]; then | |
hg pull $mainbundle | |
fi | |
if [ -e $mqbundle ]; then | |
hg pull -R "$(hg root)/.hg/$(hg qqueue --active)" $mqbundle | |
fi | |
LANG=C hg summary | grep ^update | grep '(current)' > /dev/null | |
mainup=$? | |
LANG=C hg summary --mq | grep ^update | grep '(current)' > /dev/null | |
mqup=$? | |
if [ $mainup = 1 -o $mqup = 1 ]; then | |
hg qpop -a && \ | |
if [ $mainup = 1 ]; then hg up; fi && \ | |
if [ $mqup = 1 ]; then hg up --mq -c; fi && \ | |
hg qpush -a | |
fi | |
rm -f $mainbundle $mqbundle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hg pull -u -R "`hg root`/.hg/`hg qqueue --active`" バンドルファイル
でも良さそう。