[MERGE] Nested Trees: revert

Aaron Bentley aaron at aaronbentley.com
Tue Apr 28 19:12:35 BST 2009


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

Ian Clatworthy wrote:
> Ian Clatworthy has voted resubmit.
> Status is now: Resubmit
> Comment:
> At first glance, this doesn't look right to me. If foo is a subtree,
> what happens when "bzr revert foo/bzr.py" is run.

An exception is raised because the containing tree doesn't have a
file-id for foo/bzr.py.

> If I'm reading the
> change made to workingtree.py correctly, it looks like it rolls back all
> changes to all subtrees instead of just the one on foo?

No, but that would happen if a path in the containing tree was specified.

> At a minimum, I
> think we need a test added for the "explicitly revert a file in a
> subtree leaves other subtrees as they were".

Done.

I've revised revert so that
1. specifying a path within a subtree doesn't cause a PathNotChild error
2. when paths are specified, only those paths within each subtree are
reverted.

In the process, I've changed WorkingTree.revert([]),  so that it  is a
no-op.  The previous behaviour of reverting the entire tree has been
deprecated since bzr 0.92.  This behaviour is consistent with other uses
of lists, and avoids having to special case sub_filenames == [].

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkn3RxMACgkQ0F+nu1YWqI0+5wCcDkP2uuyNZmttebD6OKSsi6Me
yJgAoIXORMfD4CxeaaOi4w7HhZ2rQQ94
=iwyn
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nested-revert.patch
Type: text/x-patch
Size: 165581 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090428/86a6556a/attachment-0001.bin 


More information about the bazaar mailing list