remote-hg: write tags in the appropriate branch

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Apr 22, 2013 at 16:55 UTC e1760f8c2c355dffeade3c271c4ae875e2659dae
1 file changed +4 -2
contrib/remote-helpers/git-remote-hg
+4 -2
@@ -725,7 +725,9 @@ def parse_tag(parser):
725 parsed_tags[name] = (tagger, data)
726
727 def write_tag(repo, tag, node, msg, author):
728 - tip = repo['tip']
728 + branch = repo[node].branch()
729 + tip = branch_tip(repo, branch)
730 + tip = repo[tip]
731
732 def getfilectx(repo, memctx, f):
733 try:
@@ -744,7 +746,7 @@ def write_tag(repo, tag, node, msg, author):
746
747 ctx = context.memctx(repo, (p1, p2), msg,
748 ['.hgtags'], getfilectx,
747 - user, (date, tz), {})
749 + user, (date, tz), {'branch' : branch})
750
751 tmp = encoding.encoding
752 encoding.encoding = 'utf-8'