Rev 5962: Tweak comment in Merge3Merger._merge_names and the corresponding test. in file:///home/vila/src/bzr/reviews/merge-into-empty/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Jun 10 08:58:30 UTC 2011


At file:///home/vila/src/bzr/reviews/merge-into-empty/

------------------------------------------------------------
revno: 5962
revision-id: v.ladeuil+lp at free.fr-20110610085830-7hkx6gx220tsvfpq
parent: aaron at aaronbentley.com-20110609192553-ma09c3n72px6jh90
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: merge-into-empty
timestamp: Fri 2011-06-10 10:58:30 +0200
message:
  Tweak comment in Merge3Merger._merge_names and the corresponding test.
-------------- next part --------------
=== modified file 'bzrlib/merge.py'
--- a/bzrlib/merge.py	2011-06-09 19:25:53 +0000
+++ b/bzrlib/merge.py	2011-06-10 08:58:30 +0000
@@ -1318,9 +1318,9 @@
                                         this_parent, this_name,
                                         other_parent, other_name))
         if not self.other_tree.has_id(file_id):
-            # it doesn't matter whether the result was 'other' or
-            # 'conflict'-- if there's no 'other', or it's not versioned, we
-            # leave it alone.
+            # it doesn't matter whether the result was 'other' or 'conflict'--
+            # if there's no 'other', or it's not versioned (unversioned being
+            # one such case), we leave it alone.
             return
         parent_id = parents[self.winner_idx[parent_id_winner]]
         name = names[self.winner_idx[name_winner]]

=== modified file 'bzrlib/tests/test_shelf.py'
--- a/bzrlib/tests/test_shelf.py	2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/test_shelf.py	2011-06-10 08:58:30 +0000
@@ -568,19 +568,18 @@
         list(creator.iter_shelvable())
         creator.shelve_deletion('foo-id')
         creator.shelve_deletion('bar-id')
-        shelf_file = open('shelf', 'w+b')
-        self.addCleanup(shelf_file.close)
-        creator.write_shelf(shelf_file)
-        creator.transform()
-        creator.finalize()
+        with open('shelf', 'w+b') as shelf_file:
+            creator.write_shelf(shelf_file)
+            creator.transform()
+            creator.finalize()
         # validate the test setup
         self.assertTrue('foo-id' in tree)
         self.assertTrue('bar-id' in tree)
         self.assertFileEqual('baz', 'tree/foo/bar')
-        shelf_file.seek(0)
-        unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
-        self.addCleanup(unshelver.finalize)
-        unshelver.make_merger().do_merge()
+        with open('shelf', 'r+b') as shelf_file:
+            unshelver = shelf.Unshelver.from_tree_and_shelf(tree, shelf_file)
+            self.addCleanup(unshelver.finalize)
+            unshelver.make_merger().do_merge()
         self.assertFalse('foo-id' in tree)
         self.assertFalse('bar-id' in tree)
 



More information about the bazaar-commits mailing list