bzr resolve --take-other gives Invalid entry name

Bug #715058 reported by Martin von Gagern
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Vincent Ladeuil

Bug Description

$ bzr init --quiet foo
$ mkdir foo/a
$ mkdir foo/a/b
$ echo foo > foo/a/b/c
$ bzr add -q foo/a
$ bzr ci -q -m one foo
$ bzr clone -q foo bar
$ echo bar > bar/a/b/c
$ bzr ci -q -m two bar
$ echo baz > foo/a/b/c
$ bzr ci -q -m three foo
$ bzr merge -d foo bar
2> M a/b/c
2>Text conflict in a/b/c
2>1 conflicts encountered.
$ bzr resolve --take-other foo/a/b/c

  File "bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "bzrlib/conflicts.py", line 162, in run
    before, after = resolve(tree, file_list, action=action)
  File "bzrlib/conflicts.py", line 195, in resolve
    conflict._do(action, tree)
  File "bzrlib/conflicts.py", line 425, in _do
    meth(tree)
  File "bzrlib/conflicts.py", line 658, in action_take_other
    self._resolve_with_cleanups(tree, 'OTHER')
  File "bzrlib/conflicts.py", line 454, in _resolve_with_cleanups
    op.run_simple(tt, *args, **kwargs)
  File "bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "bzrlib/conflicts.py", line 652, in _resolve
    tt.apply()
  File "bzrlib/transform.py", line 1683, in apply
    inventory_delta = self._generate_inventory_delta()
  File "bzrlib/transform.py", line 1758, in _generate_inventory_delta
    parent_file_id, file_id)
  File "bzrlib/inventory.py", line 2210, in make_entry
    return factory(file_id, name, parent_id)
  File "bzrlib/inventory.py", line 418, in __init__
    super(InventoryFile, self).__init__(file_id, name, parent_id)
  File "bzrlib/inventory.py", line 219, in __init__
    raise errors.InvalidEntryName(name=name)
InvalidEntryName: Invalid entry name: a/b/c

It seems there should be no slashes there.

Related branches

Revision history for this message
Martin von Gagern (gagern) wrote :

Seems this exact issue was introduced in bzr.dev commit 5558, related to bug #638451. Before that, there was no backtrace, but the resolution wouldn't work either.

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

Not introduced but probably uncovered by the fix for bug #638451.
Anyway, the fix is the same (below if you're blocked), I'll target 2.3 with tests.

=== modified file 'bzrlib/conflicts.py'
--- bzrlib/conflicts.py 2011-01-16 01:12:01 +0000
+++ bzrlib/conflicts.py 2011-02-08 09:45:35 +0000
@@ -644,8 +644,9 @@
         winner_tid = tt.trans_id_tree_path(winner_path)
         winner_parent_tid = tt.get_tree_parent(winner_tid)
         # Switch the paths to preserve the content
- tt.adjust_path(self.path, winner_parent_tid, winner_tid)
- tt.adjust_path(winner_path, item_parent_tid, item_tid)
+ tt.adjust_path(osutils.basename(self.path),
+ winner_parent_tid, winner_tid)
+ tt.adjust_path(osutils.basename(winner_path), item_parent_tid, item_tid)

There is another similar latent bug with ParentLoop, I'll fix it as well.

Thanks to your test this was a breathe to debug and fix... invaluable...

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote :

Ok, I was wrong about ParentLoop but the fix is valid for TextConflict anyway. Branch with tests pushed, will submit for review.

Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.3.1
status: In Progress → 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.