mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-30 16:15:48 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6e9475918 | ||
|
|
517ceb91ac | ||
|
|
114804f0cb | ||
|
|
b022367aef | ||
|
|
18626d346f | ||
|
|
b81ec14c2e | ||
|
|
1e279075dc | ||
|
|
02a0a59a4b | ||
|
|
185852eac4 | ||
|
|
29a0d8a0e3 |
@@ -5,7 +5,7 @@ install:
|
|||||||
then pip install -q Mercurial${HG_VERSION+==$HG_VERSION};
|
then pip install -q Mercurial${HG_VERSION+==$HG_VERSION};
|
||||||
else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz;
|
else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz;
|
||||||
fi
|
fi
|
||||||
- pip install -q dulwich hg-git || true
|
- pip install -q dulwich hg-git==0.6.1 || true
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- hg --version || true
|
- hg --version || true
|
||||||
@@ -20,6 +20,9 @@ matrix:
|
|||||||
- env: HG_VERSION=2.8.2
|
- env: HG_VERSION=2.8.2
|
||||||
- env: HG_VERSION=2.7.2
|
- env: HG_VERSION=2.7.2
|
||||||
- env: HG_VERSION=3.0
|
- env: HG_VERSION=3.0
|
||||||
|
- env: HG_VERSION=3.5.2
|
||||||
|
- env: HG_VERSION=3.6.3
|
||||||
|
- env: HG_VERSION=3.7
|
||||||
- env: HG_VERSION=dev
|
- env: HG_VERSION=dev
|
||||||
- python: 2.7
|
- python: 2.7
|
||||||
- python: 2.6
|
- python: 2.6
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ chmod +x ~/bin/git-remote-hg
|
|||||||
|
|
||||||
That's it :)
|
That's it :)
|
||||||
|
|
||||||
|
Obviously you will need Mercurial installed.
|
||||||
|
|
||||||
== Configuration ==
|
== Configuration ==
|
||||||
|
|
||||||
If you want to see Mercurial revisions as Git commit notes:
|
If you want to see Mercurial revisions as Git commit notes:
|
||||||
|
|||||||
@@ -430,7 +430,12 @@ def get_repo(url, alias):
|
|||||||
peer = hg.peer(repo.ui, {}, url)
|
peer = hg.peer(repo.ui, {}, url)
|
||||||
except:
|
except:
|
||||||
die('Repository error')
|
die('Repository error')
|
||||||
repo.pull(peer, heads=None, force=True)
|
|
||||||
|
if check_version(3, 0):
|
||||||
|
from mercurial import exchange
|
||||||
|
exchange.pull(repo, peer, heads=None, force=True)
|
||||||
|
else:
|
||||||
|
repo.pull(peer, heads=None, force=True)
|
||||||
|
|
||||||
updatebookmarks(repo, peer)
|
updatebookmarks(repo, peer)
|
||||||
|
|
||||||
@@ -498,7 +503,7 @@ def export_ref(repo, name, kind, head):
|
|||||||
if 'committer' in extra:
|
if 'committer' in extra:
|
||||||
try:
|
try:
|
||||||
cuser, ctime, ctz = extra['committer'].rsplit(' ', 2)
|
cuser, ctime, ctz = extra['committer'].rsplit(' ', 2)
|
||||||
committer = "%s %s %s" % (cuser, ctime, gittz(int(ctz)))
|
committer = "%s %s %s" % (fixup_user(cuser), ctime, gittz(int(ctz)))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
cuser = extra['committer']
|
cuser = extra['committer']
|
||||||
committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz))
|
committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz))
|
||||||
@@ -803,9 +808,23 @@ def parse_commit(parser):
|
|||||||
def getfilectx(repo, memctx, f):
|
def getfilectx(repo, memctx, f):
|
||||||
of = files[f]
|
of = files[f]
|
||||||
if 'deleted' in of:
|
if 'deleted' in of:
|
||||||
raise IOError
|
if check_version(3, 2):
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
raise IOError
|
||||||
if 'ctx' in of:
|
if 'ctx' in of:
|
||||||
return of['ctx']
|
if mode == 'hg':
|
||||||
|
ctx = of['ctx']
|
||||||
|
is_exec = ctx.isexec()
|
||||||
|
is_link = ctx.islink()
|
||||||
|
if check_version(3, 1):
|
||||||
|
return context.memfilectx(repo, f, ctx.data(),
|
||||||
|
is_link, is_exec)
|
||||||
|
else:
|
||||||
|
return context.memfilectx(f, ctx.data(),
|
||||||
|
is_link, is_exec)
|
||||||
|
else:
|
||||||
|
return of['ctx']
|
||||||
is_exec = of['mode'] == 'x'
|
is_exec = of['mode'] == 'x'
|
||||||
is_link = of['mode'] == 'l'
|
is_link = of['mode'] == 'l'
|
||||||
rename = of.get('rename', None)
|
rename = of.get('rename', None)
|
||||||
@@ -1036,7 +1055,9 @@ def push_unsafe(repo, remote, parsed_refs, p_revs):
|
|||||||
if not checkheads(repo, remote, p_revs):
|
if not checkheads(repo, remote, p_revs):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if check_version(3, 0):
|
if check_version(3, 2):
|
||||||
|
cg = changegroup.getchangegroup(repo, 'push', heads=list(p_revs), common=common)
|
||||||
|
elif check_version(3, 0):
|
||||||
cg = changegroup.getbundle(repo, 'push', heads=list(p_revs), common=common)
|
cg = changegroup.getbundle(repo, 'push', heads=list(p_revs), common=common)
|
||||||
else:
|
else:
|
||||||
cg = repo.getbundle('push', heads=list(p_revs), common=common)
|
cg = repo.getbundle('push', heads=list(p_revs), common=common)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
RM ?= rm -f
|
RM ?= rm -f
|
||||||
|
|
||||||
T = $(wildcard *.t)
|
T = main.t bidi.t
|
||||||
TEST_DIRECTORY := $(CURDIR)
|
TEST_DIRECTORY := $(CURDIR)
|
||||||
|
|
||||||
export TEST_DIRECTORY
|
export TEST_DIRECTORY
|
||||||
|
|||||||
@@ -34,6 +34,15 @@ else
|
|||||||
test_done
|
test_done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hg_version=$(python2 -c 'from mercurial import util; print util.version()')
|
||||||
|
|
||||||
|
case $hg_version in
|
||||||
|
3.0*+*)
|
||||||
|
skip_all='skipping remote-hg tests; unsuported version of hg by hg-git'
|
||||||
|
test_done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# clone to a git repo with git
|
# clone to a git repo with git
|
||||||
git_clone_git () {
|
git_clone_git () {
|
||||||
git clone -q "hg::$1" $2 &&
|
git clone -q "hg::$1" $2 &&
|
||||||
@@ -106,7 +115,6 @@ setup () {
|
|||||||
debugrawcommit = -d "0 0"
|
debugrawcommit = -d "0 0"
|
||||||
tag = -d "0 0"
|
tag = -d "0 0"
|
||||||
[extensions]
|
[extensions]
|
||||||
hgext.bookmarks =
|
|
||||||
$hggit =
|
$hggit =
|
||||||
graphlog =
|
graphlog =
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ rm -rf hgrepo
|
|||||||
test_expect_success 'fetch special filenames' '
|
test_expect_success 'fetch special filenames' '
|
||||||
test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
|
test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
|
||||||
|
|
||||||
LC_ALL=C.UTF-8
|
LC_ALL=en_US.UTF-8
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -503,7 +503,7 @@ test_expect_success 'push special filenames' '
|
|||||||
|
|
||||||
mkdir -p tmp && cd tmp &&
|
mkdir -p tmp && cd tmp &&
|
||||||
|
|
||||||
LC_ALL=C.UTF-8
|
LC_ALL=en_US.UTF-8
|
||||||
export LC_ALL
|
export LC_ALL
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user