Permalink
Browse files

Add --force option to pull and checkout commands.

  • Loading branch information...
1 parent 581e9e6 commit 9c91b8129b1d070ad69e61cda4219700ad4577dd @barrywardell barrywardell committed Dec 6, 2011
Showing with 14 additions and 6 deletions.
  1. +14 −6 bin/git-hg
View
@@ -76,21 +76,29 @@ function git-hg-clone {
function git-hg-fetch {
check-hg-fast-export
+ if [[ $1 == "--force" ]]; then
+ FORCE="--force"
+ shift
+ fi
hg -R .git/hgcheckout pull
(
cd .git/hgremote
- $HG_FAST_EXPORT
+ $HG_FAST_EXPORT $FORCE
)
git fetch hg
}
function git-hg-pull {
- git-hg-fetch
+ git-hg-fetch $1
git merge hg/$(git-current-branch)
}
function git-hg-checkout {
- git-hg-fetch
+ if [[ $1 == "--force" ]]; then
+ FORCE="--force"
+ shift
+ fi
+ git-hg-fetch $FORCE
git checkout hg/$1 -b $1
}
@@ -118,13 +126,13 @@ case "$1" in
git-hg-clone $2 $3 $4
;;
fetch)
- git-hg-fetch
+ git-hg-fetch $2
;;
pull)
- git-hg-pull
+ git-hg-pull $2
;;
checkout)
- git-hg-checkout $2
+ git-hg-checkout $2 $3
;;
push)
git-hg-push $2

0 comments on commit 9c91b81

Please sign in to comment.