plugin crashes bzr: "ValueError: too many values to unpack"

Bug #781838 reported by Glenn Morris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Andrew Bennetts
bzr-changelog-merge
Fix Released
High
Andrew Bennetts

Bug Description

Hi,

I'm using the version of the plugin from http://bazaar.launchpad.net/~spiv/bzr-changelog-merge/trunk/
together with bzr 2.3.1. On two different systems, attempting to merge from Emacs's emacs-23 branch to
the trunk crashes bzr if I have this plugin installed. If I remove the plugin, there is no crash.

The crash ought to be reproducible using:

bzr branch bzr://bzr.savannah.gnu.org/emacs/trunk
bzr branch bzr://bzr.savannah.gnu.org/emacs/emacs-23

(these are fairly large branches)

cd trunk, and revert it to rev 104200. (I'm not entirely sure how I'm supposed to do that, but
it seemed to somehow work with uncommit). In other words, simulate having a copy of the trunk exactly
as it was in rev 104200. Activate the plugin by adding "changelog_merge_files = ChangeLog"
to .bzr/branch/branch.conf. Then do `bzr merge ../emacs-23'.

I get the following crash:

bzr: ERROR: exceptions.ValueError: too many values to unpack

Traceback (most recent call last):
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/commands.py", line 926, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/commands.py", line 1126, in run_bzr
    ret = run(*run_argv)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/builtins.py", line 3969, in run
    verified)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/builtins.py", line 3988, in _do_merge
    conflict_count = merger.do_merge()
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 713, in do_merge
    merge = operation.run_simple()
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 684, in _do_merge_to
    merge.do_merge()
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 823, in do_merge
    operation.run()
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 828, in _do_merge
    self._compute_transform()
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 866, in _compute_transform
    file_status = self._do_merge_contents(file_id)
  File "/scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/merge.py", line 1370, in _do_merge_contents
    hook_status, lines = hook.merge_contents(params)
ValueError: too many values to unpack

bzr 2.3.1 on python 2.6.5 (Linux-2.6.32-71.29.1.el6.x86_64-x86_64-with-redhat-6.0-Carbon)
arguments: ['/scratch/gmorris/software64/bin/bzr.ORIG', 'merge', '../emacs23-merge']
encoding: 'ISO-8859-1', fsenc: 'ISO-8859-1', lang: 'en_US'
plugins:
  bash_completion /scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/plugins/bash_completion [2.3.1]
  bzrtools /home/gmorris/.bazaar/plugins/bzrtools [2.1.0]
  changelog_merge /home/gmorris/.bazaar/plugins/changelog_merge [0.2b1]
  launchpad /scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/plugins/launchpad [2.3.1]
  netrc_credential_store /scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.3.1]
  news_merge /scratch/gmorris/software64/lib/python2.6/site-packages/bzrlib/plugins/news_merge [2.3.1]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Related branches

Revision history for this message
Andrew Bennetts (spiv) wrote :

Ah, this appears to be a fairly trivial bug in the “oops this conflict is too hard, I give up” case. i.e. the plugin is trying to defer to bzr's default merge logic.

The fix is pretty easy. I'll try to extend the test coverage to cover this case while I'm here.

So for this crash disabling the plugin will give the same results as the fixed plugin, so temporarily disabling the plugin is a good workaround.

Changed in bzr-changelog-merge:
assignee: nobody → Andrew Bennetts (spiv)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Andrew Bennetts (spiv) wrote :

This should be fixed on trunk as of revision 7. I've also got a branch for the corresponding fix for the copy in bzr.

(I don't plan to maintain both the standalone plugin *and* the bzr version indefinitely, but I will at least until bzr 2.4 is released.)

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
importance: Undecided → High
status: New → Confirmed
Changed in bzr-changelog-merge:
status: Confirmed → Fix Released
Andrew Bennetts (spiv)
Changed in bzr:
status: Confirmed → 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.