3 # Copyright (c) 2007 Rocco Rutte <pdmef@gmx.net>
4 # License: MIT <http://www.opensource.org/licenses/mit-license.php>
14 USAGE
="[-r <repo>] -R <rev>"
15 LONG_USAGE
="Print SHA1s of latest changes per branch up to <rev> useful
16 to reset import and restart at <rev>.
17 If <repo> is omitted, use last hg repository as obtained from state file,
18 GIT_DIR/$PFX-$SFX_STATE by default.
21 -R Hg revision to reset to
22 -r Mercurial repository to use
28 while case "$#" in 0) break ;; esac
31 -r|
--r|
--re|
--rep|
--repo)
36 # pass any other options down to hg2git.py
46 # for convenience: get default repo from state file
47 if [ x
"$REPO" = x
-a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then
48 REPO
="`egrep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`"
49 echo "Using last hg repository \"$REPO\""
52 # make sure we have a marks cache
53 if [ ! -f "$GIT_DIR/$PFX-$SFX_MARKS" ] ; then
54 touch "$GIT_DIR/$PFX-$SFX_MARKS"
57 GIT_DIR
="$GIT_DIR" python
"$ROOT/hg-reset.py" \
59 --marks "$GIT_DIR/$PFX-$SFX_MARKS" \
60 --heads "$GIT_DIR/$PFX-$SFX_HEADS" \
61 --status "$GIT_DIR/$PFX-$SFX_STATE" \