10 Commits
test ... v0.3

Author SHA1 Message Date
Felipe Contreras
b6e9475918 readme: mention Mercurial dependency
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 23:37:08 -05:00
Lars Noschinski
517ceb91ac Fix import of broken committers
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:44:49 -05:00
Felipe Contreras
114804f0cb travis: add more Mercurial versions
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:29:50 -05:00
Felipe Contreras
b022367aef test: temporarily disable hg-git tests
They work, but they need too many changes in different packages.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:29:50 -05:00
Felipe Contreras
18626d346f Revert "test: use C.UTF-8 locale in tests"
This reverts commit f53a8653ab.

It turns out Debian and Fedora do provide the C.UTF-8 locale, but other
distributions don't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:29:50 -05:00
Felipe Contreras
b81ec14c2e Improve hg-git compatibility
Recent versions of Mercurial check if a filectx is the same as the
parents, and avoid creating a new filelog. This is what we want, but
hg-git doesn't do that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:29:50 -05:00
Felipe Contreras
1e279075dc Add compatibility for Mercurial v3.2
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 22:29:50 -05:00
Felipe Contreras
02a0a59a4b travis: force version of hg-git
The latest that works.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2016-05-16 17:56:25 -05:00
Felipe Contreras
185852eac4 test: cleanup hg-git test
We don't need hgext.bookmarks since a long long time (ever).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-06-03 06:00:02 -05:00
Felipe Contreras
29a0d8a0e3 test: skip tests with broken hg-git compatibility
https://bitbucket.org/durin42/hg-git/issue/115/

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-06-02 18:42:17 -05:00
6 changed files with 44 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ install:
then pip install -q Mercurial${HG_VERSION+==$HG_VERSION};
else pip install -q http://selenic.com/repo/hg/archive/tip.tar.gz;
fi
- pip install -q dulwich hg-git || true
- pip install -q dulwich hg-git==0.6.1 || true
before_script:
- hg --version || true
@@ -20,6 +20,9 @@ matrix:
- env: HG_VERSION=2.8.2
- env: HG_VERSION=2.7.2
- 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
- python: 2.7
- python: 2.6

View File

@@ -15,6 +15,8 @@ chmod +x ~/bin/git-remote-hg
That's it :)
Obviously you will need Mercurial installed.
== Configuration ==
If you want to see Mercurial revisions as Git commit notes:

View File

@@ -430,7 +430,12 @@ def get_repo(url, alias):
peer = hg.peer(repo.ui, {}, url)
except:
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)
@@ -498,7 +503,7 @@ def export_ref(repo, name, kind, head):
if 'committer' in extra:
try:
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:
cuser = extra['committer']
committer = "%s %d %s" % (fixup_user(cuser), time, gittz(tz))
@@ -803,9 +808,23 @@ def parse_commit(parser):
def getfilectx(repo, memctx, f):
of = files[f]
if 'deleted' in of:
raise IOError
if check_version(3, 2):
return None
else:
raise IOError
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_link = of['mode'] == 'l'
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):
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)
else:
cg = repo.getbundle('push', heads=list(p_revs), common=common)

View File

@@ -1,6 +1,6 @@
RM ?= rm -f
T = $(wildcard *.t)
T = main.t bidi.t
TEST_DIRECTORY := $(CURDIR)
export TEST_DIRECTORY

View File

@@ -34,6 +34,15 @@ else
test_done
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
git_clone_git () {
git clone -q "hg::$1" $2 &&
@@ -106,7 +115,6 @@ setup () {
debugrawcommit = -d "0 0"
tag = -d "0 0"
[extensions]
hgext.bookmarks =
$hggit =
graphlog =
EOF

View File

@@ -470,7 +470,7 @@ rm -rf hgrepo
test_expect_success 'fetch special filenames' '
test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
LC_ALL=C.UTF-8
LC_ALL=en_US.UTF-8
export LC_ALL
(
@@ -503,7 +503,7 @@ test_expect_success 'push special filenames' '
mkdir -p tmp && cd tmp &&
LC_ALL=C.UTF-8
LC_ALL=en_US.UTF-8
export LC_ALL
(