Browse Source

remote-bzr: avoid bad refs

Versions of fast-export before v1.8.2 throws a bad 'reset' commands
because of a behavior in transport-helper that is not even needed.
We should ignore them, otherwise we will treat them as branches and
fail.

This was fixed in v1.8.2, but some people use this script in older
versions of git.

Also, check if the ref was a tag, and skip it for now.

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
4c00819910
  1. 8
      contrib/remote-helpers/git-remote-bzr

8
contrib/remote-helpers/git-remote-bzr

@ -682,6 +682,7 @@ def do_export(parser):
die('unhandled export command: %s' % line) die('unhandled export command: %s' % line)


for ref, revid in parsed_refs.iteritems(): for ref, revid in parsed_refs.iteritems():
if ref.startswith('refs/heads/'):
name = ref[len('refs/heads/'):] name = ref[len('refs/heads/'):]
branch = bzrlib.branch.Branch.open(branches[name]) branch = bzrlib.branch.Branch.open(branches[name])
branch.generate_revision_history(revid, marks.get_tip(name)) branch.generate_revision_history(revid, marks.get_tip(name))
@ -699,6 +700,13 @@ def do_export(parser):
wt.update() wt.update()
except bzrlib.errors.NoWorkingTree: except bzrlib.errors.NoWorkingTree:
pass pass
elif ref.startswith('refs/tags/'):
# TODO: implement tag push
print "error %s pushing tags not supported" % ref
continue
else:
# transport-helper/fast-export bugs
continue


print "ok %s" % ref print "ok %s" % ref



Loading…
Cancel
Save