bzr crashed when attempting to merge a Bazaar merge directive format 2 without target_branch

Bug #673344 reported by David Coles
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned
bzr (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: bzr

When attempting to merge a merge-directive, Bazaar crashes with "TypeError: __init__() takes at least 6 non-keyword arguments (5 given)". This appears to be caused by the merge directive missing a target_branch which is expected by the MergeDirective2 class.

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: <email address hidden>
# testament_sha1: f6ec130f0a3b31bcb1368160afb40632cf953863
# timestamp: 2010-11-10 12:35:36 +1100
# base_revision_id: <email address hidden>-\
# mf2vov0kvwdrf5n5
#
# Begin patch

I'm unsure if this is a bug in my version of Bazaar (for crashing when not explicitly given a target_branch) or the other user's version of Bazaar (for not adding a target_branch to the merge request).

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: bzr 2.2.1-0ubuntu1
ProcCmdline: /usr/bin/python /usr/bin/bzr merge /tmp/highlight-20.patch

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3831, in run
    possible_transports=possible_transports)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bundle/__init__.py", line 52, in read_mergeable_from_url
    _do_directive)
  File "/usr/lib/python2.6/dist-packages/bzrlib/bundle/__init__.py", line 89, in read_mergeable_from_transport
    return MergeDirective.from_lines(bytef), transport
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge_directive.py", line 416, in from_lines
    line_iter)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge_directive.py", line 540, in _from_lines
    **kwargs)
TypeError: __init__() takes at least 6 non-keyword arguments (5 given)

Revision history for this message
David Coles (dcoles) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Andrew Bennetts (spiv) wrote :

Giving a traceback is certainly a bug. I'm not sure off the top of my head if no target_branch makes the merge directive invalid or not.

description: updated
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
David Coles (dcoles)
visibility: private → public
Revision history for this message
David Coles (dcoles) wrote :

The closest thing I can find is http://doc.bazaar.canonical.com/bzr.2.0rc2-html/developers/bundles.html which defers to Format 1 merge directives for explaining target_branch. From looking at the merge directives I've encountered it doesn't appear to be all that important - Bazaar will happily chug along with any old path, even if it's non-existent (so long as something is set).

Revision history for this message
Matt Giuca (mgiuca) wrote :

Note: The merge directive without the target_branch was not generated by Bzr ... it's my merge directive.

I noticed that the target_branch was a relative path to a directory on my machine which would make no sense to you. Since Bzr obviously ignores it anyway (because it just applies it to the current branch), I thought it would be safe to delete it, so I manually deleted that line before sending it to David. Turns out I was wrong.

I don't see how Bzr can make use of the target_branch (at least in this case), since the target branch was a local path on my machine. Since it clearly works without any sensible target_branch (since David was later able to apply the patch with the target_branch intact, even though that path did not exist on his machine), then I don't see why it is illegal to have a merge directive without a target branch.

Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → Fix Released
Changed in bzr (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.