mirror of
https://github.com/frej/fast-export.git
synced 2026-05-07 06:36:29 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7aa82e8234 | ||
|
|
02bb982dd9 | ||
|
|
c252e6748e | ||
|
|
ac887f310f | ||
|
|
4bb50bb3fb | ||
|
|
fb05ce5b7b | ||
|
|
01d71a2d3f | ||
|
|
1d0f6cb7ca |
12
README.md
12
README.md
@@ -12,6 +12,18 @@ copies some code from the mercurial sources.
|
|||||||
|
|
||||||
The current maintainer is Frej Drejhammar <frej.drejhammar@gmail.com>.
|
The current maintainer is Frej Drejhammar <frej.drejhammar@gmail.com>.
|
||||||
|
|
||||||
|
Support
|
||||||
|
-------
|
||||||
|
|
||||||
|
If you have problems with hg-fast-export or have found a bug, please
|
||||||
|
create an issue at the [github issue tracker]
|
||||||
|
(https://github.com/frej/fast-export/issues). Before creating a new
|
||||||
|
issue, check that your problem has not already been addressed in an
|
||||||
|
already closed issue. Do not contact the maintainer directly unless
|
||||||
|
you want to report a security bug. That way the next person having the
|
||||||
|
same problem can benefit from the time spent solving the problem the
|
||||||
|
first time.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ def sanitize_name(name,what="branch", mapping={}):
|
|||||||
# work to do manually, write a tool that does it for you.
|
# work to do manually, write a tool that does it for you.
|
||||||
|
|
||||||
def dot(name):
|
def dot(name):
|
||||||
|
if not name: return name
|
||||||
if name[0] == '.': return '_'+name[1:]
|
if name[0] == '.': return '_'+name[1:]
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,22 @@
|
|||||||
# Copyright (c) 2007, 2008 Rocco Rutte <pdmef@gmx.net> and others.
|
# Copyright (c) 2007, 2008 Rocco Rutte <pdmef@gmx.net> and others.
|
||||||
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
|
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
|
||||||
|
|
||||||
ROOT="$(dirname "$(which "$0")")"
|
READLINK="readlink"
|
||||||
|
if command -v greadlink > /dev/null; then
|
||||||
|
READLINK="greadlink" # Prefer greadlink over readlink
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! $READLINK -f "$(which "$0")" 2>&1 > /dev/null; then
|
||||||
|
ROOT="$(dirname "$(which "$0")")"
|
||||||
|
if [ ! -f "$ROOT/hg-fast-export.py" ] ; then
|
||||||
|
echo "hg-fast-exports requires a readlink implementation which knows" \
|
||||||
|
" how to canonicalize paths in order to be called via a symlink."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ROOT="$(dirname "$($READLINK -f "$(which "$0")")")"
|
||||||
|
fi
|
||||||
|
|
||||||
REPO=""
|
REPO=""
|
||||||
PFX="hg2git"
|
PFX="hg2git"
|
||||||
SFX_MAPPING="mapping"
|
SFX_MAPPING="mapping"
|
||||||
@@ -49,9 +64,23 @@ case "$1" in
|
|||||||
exit 0
|
exit 0
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cd $(git rev-parse --show-toplevel) \
|
IS_BARE=$(git rev-parse --is-bare-repository) \
|
||||||
|| (echo "Could not find git repo" ; exit 1)
|
|| (echo "Could not find git repo" ; exit 1)
|
||||||
GIT_DIR=$(git rev-parse --git-dir) || exit 1
|
if test "z$IS_BARE" != ztrue; then
|
||||||
|
# This is not a bare repo, cd to the toplevel
|
||||||
|
TOPLEVEL=$(git rev-parse --show-toplevel) \
|
||||||
|
|| (echo "Could not find git repo toplevel" ; exit 1)
|
||||||
|
cd $TOPLEVEL || exit 1
|
||||||
|
fi
|
||||||
|
GIT_DIR=$(git rev-parse --git-dir) || (echo "Could not find git repo" ; exit 1)
|
||||||
|
|
||||||
|
|
||||||
|
IGNORECASEWARN=""
|
||||||
|
IGNORECASE=`git config core.ignoreCase`
|
||||||
|
if [ "true" = "$IGNORECASE" ]; then
|
||||||
|
IGNORECASEWARN="true"
|
||||||
|
fi;
|
||||||
|
|
||||||
|
|
||||||
while case "$#" in 0) break ;; esac
|
while case "$#" in 0) break ;; esac
|
||||||
do
|
do
|
||||||
@@ -66,6 +95,7 @@ do
|
|||||||
--force)
|
--force)
|
||||||
# pass --force to git-fast-import and hg-fast-export.py
|
# pass --force to git-fast-import and hg-fast-export.py
|
||||||
GFI_OPTS="$GFI_OPTS --force"
|
GFI_OPTS="$GFI_OPTS --force"
|
||||||
|
IGNORECASEWARN="";
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
@@ -79,6 +109,22 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ ! -z "$IGNORECASEWARN" ]; then
|
||||||
|
echo "Error: The option core.ignoreCase is set to true in the git"
|
||||||
|
echo "repository. This will produce empty changesets for renames that just"
|
||||||
|
echo "change the case of the file name."
|
||||||
|
echo "Use --force to skip this check or change the option with"
|
||||||
|
echo "git config core.ignoreCase false"
|
||||||
|
exit 1
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Make a backup copy of each state file
|
||||||
|
for i in $SFX_STATE $SFX_MARKS $SFX_MAPPING $SFX_HEADS ; do
|
||||||
|
if [ -f "$GIT_DIR/$PFX-$i" ] ; then
|
||||||
|
cp "$GIT_DIR/$PFX-$i" "$GIT_DIR/$PFX-$i~"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# for convenience: get default repo from state file
|
# for convenience: get default repo from state file
|
||||||
if [ x"$REPO" = x -a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then
|
if [ x"$REPO" = x -a -f "$GIT_DIR/$PFX-$SFX_STATE" ] ; then
|
||||||
REPO="`grep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`"
|
REPO="`grep '^:repo ' "$GIT_DIR/$PFX-$SFX_STATE" | cut -d ' ' -f 2`"
|
||||||
|
|||||||
10
hg-reset.sh
10
hg-reset.sh
@@ -24,9 +24,15 @@ Options:
|
|||||||
-r Mercurial repository to use
|
-r Mercurial repository to use
|
||||||
"
|
"
|
||||||
|
|
||||||
cd $(git rev-parse --show-toplevel) \
|
IS_BARE=$(git rev-parse --is-bare-repository) \
|
||||||
|| (echo "Could not find git repo" ; exit 1)
|
|| (echo "Could not find git repo" ; exit 1)
|
||||||
GIT_DIR=$(git rev-parse --git-dir) || exit 1
|
if test "z$IS_BARE" != ztrue; then
|
||||||
|
# This is not a bare repo, cd to the toplevel
|
||||||
|
TOPLEVEL=$(git rev-parse --show-toplevel) \
|
||||||
|
|| (echo "Could not find git repo toplevel" ; exit 1)
|
||||||
|
cd $TOPLEVEL || exit 1
|
||||||
|
fi
|
||||||
|
GIT_DIR=$(git rev-parse --git-dir) || (echo "Could not find git repo" ; exit 1)
|
||||||
|
|
||||||
while case "$#" in 0) break ;; esac
|
while case "$#" in 0) break ;; esac
|
||||||
do
|
do
|
||||||
|
|||||||
Reference in New Issue
Block a user