[MERGE] revert deletes files when it is safe

John Arbash Meinel john at arbash-meinel.com
Wed Sep 27 20:38:10 BST 2006

Aaron Bentley wrote:
> Aaron Bentley wrote:
>>> This patch fixes file deletion and revert.  Right now it is keeping the
>>> contents of files not present in the target tree.
> Let's try again with a better bundle...
> Aaron

How do you encounter this situation? Where you have a file which needs
to be removed, but has not changed? By supplying a --revision that comes
before the file was added?

Anyway, the test would be a little bit clearer if you added some
whitespace and comments.

v- And you should use:
self.build_tree_contents([('merge_target/new_file', new_contents')]))

instead of the try/finally stuff. (As pointed out to me by Robert)

+        new_file = open('merge_target/new_file', 'wb')
+        try:
+            new_file.write('new_contents')
+        finally:
+            new_file.close()
+        self.failUnlessExists('merge_target/new_file')
+        merge_target.revert([])
+        self.failUnlessExists('merge_target/new_file')

Otherwise the test seems complete enough, +1 from me.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060927/c9a0735d/attachment.pgp 

More information about the bazaar mailing list