From 89398712f159c1c01fda7116782b98b58a217095 Mon Sep 17 00:00:00 2001 From: Andrey Rahmatullin Date: Mon, 18 Jun 2012 14:52:21 +0600 Subject: Update git-hg from https://github.com/cosmin/git-hg/tree/96cb6a7b --- debian/git-hg | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) mode change 100755 => 100644 debian/git-hg diff --git a/debian/git-hg b/debian/git-hg old mode 100755 new mode 100644 index c69f690..509d8c0 --- 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 [local_checkout_path]" echo "" - echo " if that fails (due to unnamed heads) try git-hg clone --force [local_checkout_path]" + echo " if that fails (due to unnamed heads) try:" + echo " git-hg clone --force [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 -- cgit v1.2.1