mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-11-11 21:55:40 +01:00
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>
This commit is contained in:
@@ -722,7 +722,7 @@ def parse_tag(parser):
|
|||||||
data = parser.get_data()
|
data = parser.get_data()
|
||||||
parser.next()
|
parser.next()
|
||||||
|
|
||||||
# nothing to do
|
parsed_tags[name] = (tagger, data)
|
||||||
|
|
||||||
def do_export(parser):
|
def do_export(parser):
|
||||||
global parsed_refs, bmarks, peer
|
global parsed_refs, bmarks, peer
|
||||||
@@ -758,9 +758,11 @@ def do_export(parser):
|
|||||||
continue
|
continue
|
||||||
elif ref.startswith('refs/tags/'):
|
elif ref.startswith('refs/tags/'):
|
||||||
tag = ref[len('refs/tags/'):]
|
tag = ref[len('refs/tags/'):]
|
||||||
|
author, msg = parsed_tags.get(tag, (None, None))
|
||||||
if mode == 'git':
|
if mode == 'git':
|
||||||
msg = 'Added tag %s for changeset %s' % (tag, hghex(node[:6]));
|
if not msg:
|
||||||
parser.repo.tag([tag], node, msg, False, None, {})
|
msg = 'Added tag %s for changeset %s' % (tag, hghex(node[:6]));
|
||||||
|
parser.repo.tag([tag], node, msg, False, author[0], {})
|
||||||
else:
|
else:
|
||||||
parser.repo.tag([tag], node, None, True, None, {})
|
parser.repo.tag([tag], node, None, True, None, {})
|
||||||
print "ok %s" % ref
|
print "ok %s" % ref
|
||||||
@@ -815,6 +817,7 @@ def main(args):
|
|||||||
global marks, blob_marks, parsed_refs
|
global marks, blob_marks, parsed_refs
|
||||||
global peer, mode, bad_mail, bad_name
|
global peer, mode, bad_mail, bad_name
|
||||||
global track_branches, force_push, is_tmp
|
global track_branches, force_push, is_tmp
|
||||||
|
global parsed_tags
|
||||||
|
|
||||||
alias = args[1]
|
alias = args[1]
|
||||||
url = args[2]
|
url = args[2]
|
||||||
@@ -857,6 +860,7 @@ def main(args):
|
|||||||
blob_marks = {}
|
blob_marks = {}
|
||||||
parsed_refs = {}
|
parsed_refs = {}
|
||||||
marks = None
|
marks = None
|
||||||
|
parsed_tags = {}
|
||||||
|
|
||||||
repo = get_repo(url, alias)
|
repo = get_repo(url, alias)
|
||||||
prefix = 'refs/hg/%s' % alias
|
prefix = 'refs/hg/%s' % alias
|
||||||
|
|||||||
Reference in New Issue
Block a user