summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Rahmatullin <wrar@wrar.name>2012-06-18 14:52:21 +0600
committerAndrey Rahmatullin <wrar@wrar.name>2012-06-18 14:52:21 +0600
commit89398712f159c1c01fda7116782b98b58a217095 (patch)
treea1d8e9c709cf04283377f762b731b0881747a52f
parent8ae8ab2a527e46b62ea1656ddeb504eae84e2ed1 (diff)
downloadhg-fast-export-89398712f159c1c01fda7116782b98b58a217095.tar.gz
Update git-hg from https://github.com/cosmin/git-hg/tree/96cb6a7b
-rw-r--r--[-rwxr-xr-x]debian/git-hg31
1 files changed, 23 insertions, 8 deletions
diff --git a/debian/git-hg b/debian/git-hg
index c69f690..509d8c0 100755..100644
--- a/debian/git-hg
+++ b/debian/git-hg
@@ -114,7 +114,20 @@ function git-hg-fetch {
}
function git-hg-pull {
- git-hg-fetch
+ while [ $# -gt 0 ]; do
+ case "$1" in
+ --rebase)
+ REBASE="--rebase"
+ shift
+ ;;
+ --force)
+ FORCE="--force"
+ shift
+ ;;
+ esac
+ done
+
+ git-hg-fetch $FORCE
local current_branch=$(git-current-branch)
local remote_branch
@@ -140,7 +153,7 @@ function git-hg-pull {
fi
fi
- if [ "--rebase" = "$1" ]; then
+ if [ "--rebase" = "$REBASE" ]; then
git rebase hg/$remote_branch
else
git merge hg/$remote_branch
@@ -166,13 +179,15 @@ function usage {
echo "To clone a mercurial repo run:"
echo " clone <path/to/mercurial/repo> [local_checkout_path]"
echo ""
- echo " if that fails (due to unnamed heads) try git-hg clone --force <path/to/mercurial/repo> [local_checkout_path]"
+ echo " if that fails (due to unnamed heads) try:"
+ echo " git-hg clone --force <path/to/mercurial/repo> [local_checkout_path]"
echo ""
echo "To work with a cloned mercurial repo use: "
- echo " fetch fetch latest branches from mercurial"
- echo " pull [ --rebase ] fetch and merge (or rebase) into the current branch"
- echo " push [destination] push latest changes to mercurial"
- echo " checkout branch_name checkout a mercurial branch"
+ echo " fetch [ --force ] fetch latest branches from mercurial"
+ echo " pull [ --force ] [ --rebase ] fetch and merge (or rebase) into the"
+ echo " current branch"
+ echo " push [destination] push latest changes to mercurial"
+ echo " checkout [ --force ] branch_name checkout a mercurial branch"
}
case "$1" in
@@ -183,7 +198,7 @@ case "$1" in
git-hg-fetch $2
;;
pull)
- git-hg-pull $2
+ git-hg-pull $2 $3
;;
checkout)
git-hg-checkout $2 $3