Rev 3299: Only show pending merges when not given a list of specific files. in http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/status_specific_files

John Arbash Meinel john at arbash-meinel.com
Thu Mar 20 17:16:25 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/status_specific_files

------------------------------------------------------------
revno: 3299
revision-id: john at arbash-meinel.com-20080320171401-uwkidro3gqqvy7ek
parent: pqm at pqm.ubuntu.com-20080320074642-46bf1vcpyubnaptz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: status_specific_files
timestamp: Thu 2008-03-20 12:14:01 -0500
message:
  Only show pending merges when not given a list of specific files.
modified:
  bzrlib/status.py               status.py-20050505062338-431bfa63ec9b19e6
  bzrlib/tests/test_status.py    test_status.py-20060516190614-fbf6432e4a6e8aa5
-------------- next part --------------
=== modified file 'bzrlib/status.py'
--- a/bzrlib/status.py	2008-03-07 14:15:10 +0000
+++ b/bzrlib/status.py	2008-03-20 17:14:01 +0000
@@ -134,7 +134,8 @@
                 else:
                     prefix = ' '
                 to_file.write("%s %s\n" % (prefix, conflict))
-            if new_is_working_tree and show_pending:
+            if (new_is_working_tree and show_pending
+                and specific_files is None):
                 show_pending_merges(new, to_file, short)
         finally:
             old.unlock()

=== modified file 'bzrlib/tests/test_status.py'
--- a/bzrlib/tests/test_status.py	2006-10-05 05:37:25 +0000
+++ b/bzrlib/tests/test_status.py	2008-03-20 17:14:01 +0000
@@ -48,3 +48,20 @@
                      revision=[RevisionSpec.from_string("revid:%s" % r1_id),
                                RevisionSpec.from_string("revid:%s" % r2_id)])
         # return does not matter as long as it did not raise.
+
+    def test_pending_specific_files(self):
+        """With a specific file list, pending merges are not shown."""
+        tree = self.make_branch_and_tree('tree')
+        self.build_tree_contents([('tree/a', 'content of a\n')])
+        tree.add('a')
+        r1_id = tree.commit('one')
+        alt = tree.bzrdir.sprout('alt').open_workingtree()
+        self.build_tree_contents([('alt/a', 'content of a\nfrom alt\n')])
+        alt_id = alt.commit('alt')
+        tree.merge_from_branch(alt.branch)
+        output = StringIO()
+        show_tree_status(tree, to_file=output)
+        self.assertContainsRe(output.getvalue(), 'pending merges:')
+        output = StringIO()
+        show_tree_status(tree, to_file=output, specific_files=['a'])
+        self.assertNotContainsRe(output.getvalue(), 'pending merges:')



More information about the bazaar-commits mailing list