[PATCH] blackbox test for revert in subdir

John Arbash Meinel john at arbash-meinel.com
Tue Jan 24 14:54:52 GMT 2006


Aaron Bentley wrote:
> John Arbash Meinel wrote:
> 
>>>It seems to me that the fix should be in builtins.internal_tree_files.
>>>Since that code may be called from other commands.
> 
> 
> There's nothing wrong with internal_tree_files, AFAIK.  The problem was
> that both tree_files and Merger._set_interesting_files converted their
> input from absolute/cwd-relative to tree-relative.  This
> double-conversion went unnoticed when cwd==tree root, but in other
> directories, this was problematic.
> 
> The alternative fix is to remove path conversion from _set_interesting
> files.  I've attached a patch.
> 

+1 from me, does this mean we have +2? I'll merge into jam-integration
if we do.

> 
>>>It seems that it should look at WorkingTree.open_containing, and fix
>>>relpath appropriately.
> 
> 
> I don't know what you mean.
> 
> Aaron

I was thinking about (psuedocode):

tree, relpath = WorkingTree.open_containing(list[0])
for fname in list:
  fullpath = relpath + fname
  do stuff here

But since WorkingTree.relpath() calls osutils.relpath() which uses
abspath() on the filename we should be okay. I'm a little concerned that
relpath uses abspath() since we might change directories from the time
'bzr foo' is called, to the time WorkingTree.relpath() is evaluated. We
don't yet, it just seems like we might.

But for now, I won't worry about it. We don't use 'os.chdir' very often
inside the code, and we shouldn't anyway.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060124/81b01567/attachment.pgp 


More information about the bazaar mailing list