[PATCH] blackbox test for revert in subdir
Aaron Bentley
aaron.bentley at utoronto.ca
Tue Jan 24 15:25:39 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> +1 from me, does this mean we have +2? I'll merge into jam-integration
> if we do.
Go ahead and merge that bad boy.
>>>>It seems that it should look at WorkingTree.open_containing, and fix
>>>>relpath appropriately.
>>
>>
>>I don't know what you mean.
> I was thinking about (psuedocode):
>
> tree, relpath = WorkingTree.open_containing(list[0])
> for fname in list:
> fullpath = relpath + fname
> do stuff here
What you've entered there is broken. Say you do 'bzr revert foo' in
your project root. "foo" will be the result of
WorkingTree.open_containing(list[0])[1].
So fullpath will be "foofoo".
Or are you saying that we should change open_containing to return the
absolute path of the working tree root?
I believe the way it is currently handled internal_tree_files is
correct, because we reevaluate each argument using tree.relpath. Note
that cwd-relative paths are completely acceptable input to tree.relpath,
despite the documentation.
> 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.
Yes, it would probably be best to accept a cwd argument in
WorkingTree.relpath, but tree_files is meant to be called very early,
before any cwd fun takes place.
> 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.
Indeed.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFD1kbz0F+nu1YWqI0RAo+2AJ44WiHcpwldKur1/WwN9zNXsDJkFQCePiI7
IdS7yIbSfmfVTeEmAq5Akts=
=xV5M
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list