KeyError: 'new-2' from resolve --take-other

Bug #788000 reported by Martin von Gagern
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Vincent Ladeuil

Bug Description

bzr init-repo r
cd r
bzr init a
mkdir a/dir
echo foo > a/dir/file
bzr add a/dir
bzr commit -m one a
bzr clone a b
echo bar > b/dir/file
rm -r a/dir
bzr commit -m two a
bzr pull -d b
cd b
bzr resolve --take-other

deleted dir/file.THIS
deleted dir
bzr: ERROR: exceptions.KeyError: 'new-2'

Traceback (most recent call last):
  File "bzr.dev/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "bzr.dev/bzrlib/commands.py", line 1130, in run_bzr
    ret = run(*run_argv)
  File "bzr.dev/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "bzr.dev/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "bzr.dev/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "bzr.dev/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "bzr.dev/bzrlib/conflicts.py", line 162, in run
    before, after = resolve(tree, file_list, action=action)
  File "bzr.dev/bzrlib/conflicts.py", line 195, in resolve
    conflict._do(action, tree)
  File "bzr.dev/bzrlib/conflicts.py", line 425, in _do
    meth(tree)
  File "bzr.dev/bzrlib/conflicts.py", line 610, in action_take_other
    self._resolve_with_cleanups(tree, 'THIS')
  File "bzr.dev/bzrlib/conflicts.py", line 454, in _resolve_with_cleanups
    op.run_simple(tt, *args, **kwargs)
  File "bzr.dev/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "bzr.dev/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "bzr.dev/bzrlib/conflicts.py", line 602, in _resolve
    parent_tid = tt.get_tree_parent(this_tid)
  File "bzr.dev/bzrlib/transform.py", line 315, in get_tree_parent
    path = self._tree_id_paths[trans_id]
KeyError: 'new-2'

bzr 2.4.0dev3 on python 2.7.1 (Linux-2.6.38-gentoo-r5-x86_64-AMD_Phenom-tm-_II_X4_945_Processor-with-gentoo-2.0.2)
arguments: ['bzr.dev/bzr', '--no-plugins', 'resolve', '--take-other']
plugins:
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'de_DE.utf8'

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

Sorry for the delay and so many thanks for the reproducing recipe !

I'll look into it asap.

'bzr resolve --take-other' with no files specified is obviously badly supported. I wonder if we should just ban it until the multiple conflicts involving one file tricky cases are all properly handled...

In this particular case, doing:

  bzr resolve dir/file --take-other
  bzr resolve dir --take-other

works.

I realize you isolated the recipe from a more complex case where this workaround won't help though.

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
importance: Undecided → High
status: New → Confirmed
Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b4
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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