Bug while moving directories

Gustavo Niemeyer gustavo at niemeyer.net
Mon Aug 15 20:40:57 BST 2005


Hi again,

I was just doing some tests regarding two different branches
for the same tree and moving directories around, and I belive there's
a small bug in the code handling that.

More specifically, in ChangesetEntry.get_new_path(), one can
find the following lines:

   if from_dir == to_dir:
       dir = os.path.dirname(id_map[self.id])
   else:
       mutter("path, new_path: %r %r" % (self.path, self.new_path))
       parent_entry = changeset.entries[parent]
       dir = parent_entry.get_new_path(id_map, changeset, reverse)

In the case I'm following, the parent directory has changed, but
from_dir and to_dir are both '.', so the move doesn't happen, and
the rename ends up moving the entry back to its original place.

Disabling the first part of the if makes the merge work as expected.

Is that the right thing to do (I'm still finding my way
through the code)?

-- 
Gustavo Niemeyer
http://niemeyer.net




More information about the bazaar mailing list