Reverting the tree after a merge and remerging causes a backtrace

Bug #348474 reported by Ted Gould
2
Affects Status Importance Assigned to Milestone
bazaar (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: bazaar

I merged in a directory, reverted it (I messed it up), then remerged it. This causes a backtrace. This particular instance was a jaunty packaging branch, but this has happened to me several times before.

Merging from remembered parent location http://package-import.ubuntu.com/p/pidgin/jaunty/
bzr: ERROR: exceptions.AssertionError: Unknown kind 'absent'

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 716, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 911, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 547, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3443, in run
    verified)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3461, in _do_merge
    conflict_count = merger.do_merge()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 493, in do_merge
    self._do_merge_to(merge)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 465, in _do_merge_to
    merge.do_merge()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 604, in do_merge
    self._compute_transform()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 647, in _compute_transform
    file_status = self.merge_contents(file_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 1149, in merge_contents
    self.other_tree, file_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 2291, in create_from_tree
    raise AssertionError('Unknown kind %r' % kind)
AssertionError: Unknown kind 'absent'

bzr 1.13 on python 2.6.1 (linux2)
arguments: ['/usr/bin/bzr', 'merge']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  builddeb /usr/lib/python2.6/dist-packages/bzrlib/plugins/builddeb [unknown]
  bzr_notification /home/ted/.bazaar/plugins/bzr_notification [unknown]
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.13]
  gtk /usr/lib/python2.6/dist-packages/bzrlib/plugins/gtk [0.96.0.dev.1]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [unknown]
  power_management /home/ted/.bazaar/plugins/power_management [unknown]
  pqm /usr/lib/python2.6/dist-packages/bzrlib/plugins/pqm [1.3]
  rebase /usr/lib/python2.6/dist-packages/bzrlib/plugins/rebase [0.4.4]
  svn /usr/lib/python2.6/dist-packages/bzrlib/plugins/svn [0.5.3]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: bzr 1.13-2~bazaar1~jaunty1
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: bzr
Uname: Linux 2.6.28-11-generic i686
UnreportableReason: This is not a genuine Ubuntu package

Revision history for this message
Ted Gould (ted) wrote :
Revision history for this message
Ted Gould (ted) wrote :
Revision history for this message
James Westby (james-w) wrote :

bzr arguments: [u'revert', u'.']

This happens because there are still pending merges in the tree when you merge
again, and that leads to this confusion.

If you use plain "bzr revert" without the "." this won't happen.

There are a couple of things going on here:

  * merge checks if there are uncommitted changes in the working tree. Should
     this be extended to check for pending merges?

  * The error probably shouldn't happen, or at least be more clear about what is
     wrong.

Thanks,

James

Changed in bazaar (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
summary: - Reverting a merge and remerging casuse backtrace
+ Reverting the tree after a merge and remerging casuse backtrace
summary: - Reverting the tree after a merge and remerging casuse backtrace
+ Reverting the tree after a merge and remerging causes a backtrace
Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 348474] Re: Reverting a merge and remerging casuse backtrace

On Wed, 2009-03-25 at 15:12 +0000, James Westby wrote:
> If you use plain "bzr revert" without the "." this won't happen.

Wow, thanks for the tip!

I think that first there shouldn't be a stack trace, that's always bad
usability. But two "revert ." should give a message about keeping the
merge record. I didn't realize that there was a difference between the
two types of merge, but now that I know it's a useful distinction.
There should be a way to discover it.

Revision history for this message
James Westby (james-w) wrote :

On Wed, 2009-03-25 at 15:30 +0000, Ted Gould wrote:
> On Wed, 2009-03-25 at 15:12 +0000, James Westby wrote:
> > If you use plain "bzr revert" without the "." this won't happen.
>
> Wow, thanks for the tip!
>
> I think that first there shouldn't be a stack trace, that's always bad
> usability. But two "revert ." should give a message about keeping the
> merge record. I didn't realize that there was a difference between the
> two types of merge, but now that I know it's a useful distinction.
> There should be a way to discover it.

Yeah, it's actually a useful facility. If you then commit it records
the merge, but with no changes, so that next time you merge you just
merge the new things in the other branch.

I think that while messages for normal behaviour aren't always a good
thing it may be worth adding in this case. For one thing it may make
this functionality slightly more discoverable.

Thanks,

James

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.