summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Rahmatullin <wrar@wrar.name>2014-02-06 00:51:05 +0600
committerAndrey Rahmatullin <wrar@wrar.name>2014-02-06 23:13:37 +0600
commita821c4490ecaca7d8c9e35a2d84272caf086c4ce (patch)
tree66350cef49515764424b7fb9fab784b1a7ca6d45
parent128af026880272ec34212b717cfadd4ee79a1804 (diff)
downloadhg-fast-export-a821c4490ecaca7d8c9e35a2d84272caf086c4ce.tar.gz
Update git-hg and its README from https://github.com/cosmin/git-hg/tree/e273969150ba9d909a92f20928afb2139c7093b4
-rw-r--r--debian/README.git-hg5
-rwxr-xr-xdebian/git-hg12
2 files changed, 10 insertions, 7 deletions
diff --git a/debian/README.git-hg b/debian/README.git-hg
index d402f9b..77d98da 100644
--- a/debian/README.git-hg
+++ b/debian/README.git-hg
@@ -11,6 +11,8 @@ from git. Push supported added as well although it is still experimental.
Mercurial (`hg`) and python must be installed and in your `$PATH`.
+On Windows, you will also need a copy of Mercurial for Python, available at [the Mercurial downloads page](http://mercurial.selenic.com/downloads/)
+
If this is a fresh checkout run
$ git submodule update --init
@@ -30,7 +32,8 @@ Alternatively you can execute
$ sudo make install
to install the script and all required fast-export files in `/usr/local` (you
-can change the destination by passing eg `PREFIX=/usr` to make install)
+can change the destination by passing eg `PREFIX=/usr` to *both* `make'
+invocations)
## Usage ##
diff --git a/debian/git-hg b/debian/git-hg
index 5cbef34..212c7b7 100755
--- a/debian/git-hg
+++ b/debian/git-hg
@@ -25,7 +25,7 @@ function canonicalize {
path=$(ls -l "$path" | sed -e 's/.* -> //')
cd "$dir"
done
-
+
dir=$(dirname "$path")
file=$(basename "$path")
if [[ ! -d "$dir" ]]; then
@@ -69,7 +69,7 @@ function check-hg-fast-export {
function git-hg-clone {
check-hg-fast-export
-
+
if [[ $1 == "--force" ]]; then
FORCE="--force"
shift
@@ -81,7 +81,7 @@ function git-hg-clone {
else
CHECKOUT=$2
fi
- if [[ -a $CHECKOUT ]]; then
+ if [[ -e $CHECKOUT && "$(ls -A $f)" ]]; then
echo "error: $CHECKOUT exists"
exit 1
fi
@@ -93,7 +93,7 @@ function git-hg-clone {
git init --bare ${GITDIR}/hgremote
(
cd ${GITDIR}/hgremote
- "$HG_FAST_EXPORT" -r ../hgcheckout $FORCE
+ $HG_FAST_EXPORT -r ../hgcheckout --quiet $FORCE
)
git remote add hg ${GITDIR}/hgremote
git fetch hg
@@ -117,7 +117,7 @@ function git-hg-fetch {
hg -R ${GITDIR}/hgcheckout pull
(
cd ${GITDIR}/hgremote
- "$HG_FAST_EXPORT" $FORCE
+ "$HG_FAST_EXPORT" -r ../hgcheckout $FORCE
)
git fetch hg
}
@@ -146,7 +146,7 @@ function git-hg-pull {
if [[ $current_branch == "master" ]]; then
remote_branch=$(git config hg.tracking.master || true)
-
+
if [[ -z $remote_branch ]]; then
if git rev-parse --verify -q remotes/hg/master > /dev/null; then
remote_branch="master"