summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wragg <david@rabbitmq.com>2010-11-17 00:32:12 +0000
committerDavid Wragg <david@rabbitmq.com>2011-06-13 12:34:13 +0100
commitb51166f006dbc5fd8e6d08de09507307e8bbee13 (patch)
tree91195eb6cb9563d3136fc8e2bfaefee97ca6a240
parent486690e1764f63448f261c7bd95e8b2f1e28773b (diff)
downloadhg-fast-export-b51166f006dbc5fd8e6d08de09507307e8bbee13.tar.gz
Support passing --force to git-fast-import
-rwxr-xr-xhg-fast-export.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/hg-fast-export.sh b/hg-fast-export.sh
index a2ef9ea..718eb18 100755
--- a/hg-fast-export.sh
+++ b/hg-fast-export.sh
@@ -10,10 +10,10 @@ SFX_MAPPING="mapping"
SFX_MARKS="marks"
SFX_HEADS="heads"
SFX_STATE="state"
-QUIET=""
+GFI_OPTS=""
PYTHON=${PYTHON:-python}
-USAGE="[--quiet] [-r <repo>] [-m <max>] [-s] [-A <file>] [-M <name>] [-o <name>]"
+USAGE="[--quiet] [-r <repo>] [--force] [-m <max>] [-s] [-A <file>] [-M <name>] [-o <name>]"
LONG_USAGE="Import hg repository <repo> up to either tip or <max>
If <repo> is omitted, use last hg repository as obtained from state file,
GIT_DIR/$PFX-$SFX_STATE by default.
@@ -42,7 +42,12 @@ do
REPO="$1"
;;
--q|--qu|--qui|--quie|--quiet)
- QUIET="--quiet"
+ GFI_OPTS="$GFI_OPTS --quiet"
+ ;;
+ --force)
+ # pass --force to git-fast-import and hg-fast-export.py
+ GFI_OPTS="$GFI_OPTS --force"
+ break
;;
-*)
# pass any other options down to hg2git.py
@@ -73,7 +78,7 @@ GIT_DIR="$GIT_DIR" $PYTHON "$ROOT/hg-fast-export.py" \
--heads "$GIT_DIR/$PFX-$SFX_HEADS" \
--status "$GIT_DIR/$PFX-$SFX_STATE" \
"$@" \
-| git fast-import $QUIET --export-marks="$GIT_DIR/$PFX-$SFX_MARKS.tmp"
+| git fast-import $GFI_OPTS --export-marks="$GIT_DIR/$PFX-$SFX_MARKS.tmp"
# move recent marks cache out of the way...
if [ -f "$GIT_DIR/$PFX-$SFX_MARKS" ] ; then