From: Felipe Contreras Date: Sun, 04 May 2014 02:16:54 GMT Subject: [PATCH 4/4] remote-hg: add support for hg v3.0 Message-ID: <1399169814-20201-5-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1399169814-20201-1-git-send-email-felipe.contreras@gmail.com> Signed-off-by: Felipe Contreras --- contrib/remote-helpers/git-remote-hg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index 34cda02..8b02803 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -13,6 +13,7 @@ # "$GIT_DIR/hg/origin/clone/.hg/". from mercurial import hg, ui, bookmarks, context, encoding, node, error, extensions, discovery, util +from mercurial import changegroup import re import sys @@ -985,7 +986,10 @@ def push_unsafe(repo, remote, parsed_refs, p_revs): if not checkheads(repo, remote, p_revs): return None - cg = repo.getbundle('push', heads=list(p_revs), common=common) + if 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) unbundle = remote.capable('unbundle') if unbundle: -- 1.9.2+fc1.20.g204a630