remote-hg: push to the appropriate branch

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

Dusty Phillips committed Apr 11, 2013 at 07:23 UTC 11dc88f49c1dc177132fb724d46c80ae8e6a2e99
1 file changed +4
contrib/remote-helpers/git-remote-hg
+4
@@ -625,6 +625,10 @@ def parse_commit(parser):
625 if merge_mark:
626 get_merge_files(repo, p1, p2, files)
627
628 + # Check if the ref is supposed to be a named branch
629 + if ref.startswith('refs/heads/branches/'):
630 + extra['branch'] = ref[len('refs/heads/branches/'):]
631 +
632 if mode == 'hg':
633 i = data.find('\n--HG--\n')
634 if i >= 0: