Browse Source

remote-hg: add support for tag objects

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Felipe Contreras 12 years ago committed by Junio C Hamano
parent
commit
299789c22c
  1. 10
      contrib/remote-helpers/git-remote-hg

10
contrib/remote-helpers/git-remote-hg

@ -722,7 +722,7 @@ def parse_tag(parser): @@ -722,7 +722,7 @@ def parse_tag(parser):
data = parser.get_data()
parser.next()

# nothing to do
parsed_tags[name] = (tagger, data)

def do_export(parser):
global parsed_refs, bmarks, peer
@ -758,9 +758,11 @@ def do_export(parser): @@ -758,9 +758,11 @@ def do_export(parser):
continue
elif ref.startswith('refs/tags/'):
tag = ref[len('refs/tags/'):]
author, msg = parsed_tags.get(tag, (None, None))
if mode == 'git':
msg = 'Added tag %s for changeset %s' % (tag, hghex(node[:6]));
parser.repo.tag([tag], node, msg, False, None, {})
if not msg:
msg = 'Added tag %s for changeset %s' % (tag, hghex(node[:6]));
parser.repo.tag([tag], node, msg, False, author[0], {})
else:
parser.repo.tag([tag], node, None, True, None, {})
print "ok %s" % ref
@ -815,6 +817,7 @@ def main(args): @@ -815,6 +817,7 @@ def main(args):
global marks, blob_marks, parsed_refs
global peer, mode, bad_mail, bad_name
global track_branches, force_push, is_tmp
global parsed_tags

alias = args[1]
url = args[2]
@ -857,6 +860,7 @@ def main(args): @@ -857,6 +860,7 @@ def main(args):
blob_marks = {}
parsed_refs = {}
marks = None
parsed_tags = {}

repo = get_repo(url, alias)
prefix = 'refs/hg/%s' % alias

Loading…
Cancel
Save