[PATCH] blackbox test for revert in subdir

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jan 24 16:07:04 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> Do you have it as a branch, or just the patch?

I haven't committed it, because work on making merge internals private
was still pending.  Just apply the patch.

>>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".
> 
> 
> Well, that's why I said "pseudocode". We would have to handle when it is
> a directory (so we want the full path), versus when it is a file (when
> we need to take the dirname()). And besides, we would always use
> pathjoin() anyway,.

But what I mean is, the output of open_containing[1] is the
tree-relative path of the input.  It is exactly what you would get if
you did WorkingTree.relpath(list[0]).

There is nothing special about relpath(list[0]) that would make it
sensible to combine it with list[0], list[1], etc.
pathjoin(wt.relpath(list[0]). wt.relpath(list[0])) just doesn't make
sense, even in combination with dirname.

>>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.

> Yes, tree_files is. But is WorkingTree.relpath()? Right now it *has* to
> be called early. Unless you supply an absolute path. But that is a
> dangerous distinction in my mind.
> I would rather have 'relpath' always take absolute paths, and we just
> make all callers ensure that they have an absolute path ahead of time.

Since I don't see a use case for changing the cwd, I'd consider
forbidding* that, instead.  Less hassle in the general case.

I considered absolutizing the user input automatically, but it can be
useful to have the exact text the user entered.

Aaron
* of course, if someone must change cwd, they must do it carefully.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD1lCo0F+nu1YWqI0RAq92AJ9lf64y1pPs7cjH7knYzLJH745hMQCfcchE
gGoCHHC4wnnSxWZ6qLzf6NQ=
=uDRP
-----END PGP SIGNATURE-----




More information about the bazaar mailing list