Rev 2458: Don't set the bugs property unless bugs are actually set in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 26 06:06:32 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2458
revision-id: pqm at pqm.ubuntu.com-20070426050629-c5i80a0iav553pix
parent: pqm at pqm.ubuntu.com-20070426021942-eutaiob3qgh6kln8
parent: mbp at sourcefrog.net-20070425055110-i0fmvoc3t4jejlbd
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-04-26 06:06:29 +0100
message:
  Don't set the bugs property unless bugs are actually set
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
    ------------------------------------------------------------
    revno: 2453.2.1
    merged: mbp at sourcefrog.net-20070425055110-i0fmvoc3t4jejlbd
    parent: pqm at pqm.ubuntu.com-20070425025045-rs79ekrx5xtf9eq9
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: bugfix-property
    timestamp: Wed 2007-04-25 15:51:10 +1000
    message:
      Don't set the bugs property unless bugs are actually set
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-04-25 06:50:22 +0000
+++ b/bzrlib/builtins.py	2007-04-26 05:06:29 +0000
@@ -2172,7 +2172,9 @@
             # selected-file merge commit is not done yet
             selected_list = []
 
-        properties['bugs'] = self._get_bug_fix_properties(fixes, tree.branch)
+        bug_property = self._get_bug_fix_properties(fixes, tree.branch)
+        if bug_property:
+            properties['bugs'] = bug_property
 
         if local and not tree.branch.get_bound_location():
             raise errors.LocalRequiresBoundBranch()

=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py	2007-04-17 07:59:42 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py	2007-04-25 05:51:10 +0000
@@ -369,6 +369,22 @@
         self.assertEqual('', output)
         self.assertEqual('added hello.txt\nCommitted revision 1.\n', err)
 
+    def test_no_bugs_no_properties(self):
+        """If no bugs are fixed, the bugs property is not set.
+
+        see https://beta.launchpad.net/bzr/+bug/109613
+        """
+        tree = self.make_branch_and_tree('tree')
+        self.build_tree(['tree/hello.txt'])
+        tree.add('hello.txt')
+        self.run_bzr( 'commit', '-m', 'hello', 'tree/hello.txt')
+        # Get the revision properties, ignoring the branch-nick property, which
+        # we don't care about for this test.
+        last_rev = tree.branch.repository.get_revision(tree.last_revision())
+        properties = dict(last_rev.properties)
+        del properties['branch-nick']
+        self.assertFalse('bugs' in properties)
+
     def test_fixes_bug_sets_property(self):
         """commit --fixes=lp:234 sets the lp:234 revprop to 'fixed'."""
         tree = self.make_branch_and_tree('tree')




More information about the bazaar-commits mailing list