Rev 5536: (spiv) Merge lp:bzr/2.2, including fix towards #603395. (Andrew Bennetts) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Nov 10 02:40:49 GMT 2010


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

------------------------------------------------------------
revno: 5536 [merge]
revision-id: pqm at pqm.ubuntu.com-20101110024048-b19eazmjae5jtgk0
parent: pqm at pqm.ubuntu.com-20101109181947-h26505clmkdhh2uz
parent: andrew.bennetts at canonical.com-20101110020133-n6ym1tbhmozyshl5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2010-11-10 02:40:48 +0000
message:
  (spiv) Merge lp:bzr/2.2, including fix towards #603395. (Andrew Bennetts)
modified:
  bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
  bzrlib/tests/blackbox/test_tags.py test_tags.py-20070116132048-5h4qak2cm22jlb9e-1
  doc/en/release-notes/bzr-2.2.txt bzr2.2.txt-20101008081016-21wd86gpfhllpue3-39
=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2010-10-15 16:43:03 +0000
+++ b/bzrlib/commit.py	2010-11-10 02:01:33 +0000
@@ -380,7 +380,9 @@
         self.pb_stage_count = 0
         self.pb_stage_total = 5
         if self.bound_branch:
-            self.pb_stage_total += 1
+            # 2 extra stages: "Uploading data to master branch" and "Merging
+            # tags to master branch"
+            self.pb_stage_total += 2
         self.pb.show_pct = False
         self.pb.show_spinner = False
         self.pb.show_eta = False
@@ -450,6 +452,15 @@
         # and now do the commit locally.
         self.branch.set_last_revision_info(new_revno, self.rev_id)
 
+        # Merge local tags to remote
+        if self.bound_branch:
+            self._set_progress_stage("Merging tags to master branch")
+            tag_conflicts = self.branch.tags.merge_to(self.master_branch.tags)
+            if tag_conflicts:
+                warning_lines = ['    ' + name for name, _, _ in tag_conflicts]
+                note("Conflicting tags in bound branch:\n" +
+                    "\n".join(warning_lines))
+
         # Make the working tree be up to date with the branch. This
         # includes automatic changes scheduled to be made to the tree, such
         # as updating its basis and unversioning paths that were missing.

=== modified file 'bzrlib/tests/blackbox/test_tags.py'
--- a/bzrlib/tests/blackbox/test_tags.py	2010-10-11 15:18:38 +0000
+++ b/bzrlib/tests/blackbox/test_tags.py	2010-11-10 02:01:33 +0000
@@ -17,6 +17,7 @@
 """Tests for commands related to tags"""
 
 from bzrlib import (
+    branchbuilder,
     bzrdir,
     tag,
     )
@@ -24,7 +25,10 @@
     Branch,
     )
 from bzrlib.bzrdir import BzrDir
-from bzrlib.tests import TestCaseWithTransport
+from bzrlib.tests import (
+    script,
+    TestCaseWithTransport,
+    )
 from bzrlib.repository import (
     Repository,
     )
@@ -33,14 +37,6 @@
 
 class TestTagging(TestCaseWithTransport):
 
-    # as of 0.14, the default format doesn't do tags so we need to use a
-    # specific format
-
-    def make_branch_and_tree(self, relpath):
-        format = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
-        return TestCaseWithTransport.make_branch_and_tree(self, relpath,
-            format=format)
-
     def test_tag_command_help(self):
         out, err = self.run_bzr('help tag')
         self.assertContainsRe(out, 'Create, remove or modify a tag')
@@ -123,6 +119,57 @@
         b3 = Branch.open('branch3')
         self.assertEquals(b3.tags.lookup_tag('tag1'), 'first-revid')
 
+    def make_master_and_checkout(self):
+        builder = self.make_branch_builder('master')
+        builder.build_commit(message='Initial commit.', rev_id='rev-1')
+        master = builder.get_branch()
+        child = master.create_checkout(self.get_url('child'))
+        return master, child
+
+    def make_fork(self, branch):
+        fork = branch.create_clone_on_transport(self.get_transport('fork'))
+        builder = branchbuilder.BranchBuilder(branch=fork)
+        builder.build_commit(message='Commit in fork.', rev_id='fork-1')
+        return fork
+
+    def test_commit_in_heavyweight_checkout_copies_tags_to_master(self):
+        master, child = self.make_master_and_checkout()
+        fork = self.make_fork(master)
+        fork.tags.set_tag('new-tag', fork.last_revision())
+        script.run_script(self, """
+            $ cd child
+            $ bzr merge ../fork
+            $ bzr commit -m "Merge fork."
+            2>Committing to: .../master/
+            2>Committed revision 2.
+            """, null_output_matches_anything=True)
+        # Merge copied the tag to child and commit propagated it to master
+        self.assertEqual(
+            {'new-tag': fork.last_revision()}, child.branch.tags.get_tag_dict())
+        self.assertEqual(
+            {'new-tag': fork.last_revision()}, master.tags.get_tag_dict())
+
+    def test_commit_in_heavyweight_checkout_reports_tag_conflict(self):
+        master, child = self.make_master_and_checkout()
+        fork = self.make_fork(master)
+        fork.tags.set_tag('new-tag', fork.last_revision())
+        master_r1 = master.last_revision()
+        master.tags.set_tag('new-tag', master_r1)
+        script.run_script(self, """
+            $ cd child
+            $ bzr merge ../fork
+            $ bzr commit -m "Merge fork."
+            2>Committing to: .../master/
+            2>Conflicting tags in bound branch:
+            2>    new-tag
+            2>Committed revision 2.
+            """, null_output_matches_anything=True)
+        # Merge copied the tag to child.  master's conflicting tag is unchanged.
+        self.assertEqual(
+            {'new-tag': fork.last_revision()}, child.branch.tags.get_tag_dict())
+        self.assertEqual(
+            {'new-tag': master_r1}, master.tags.get_tag_dict())
+
     def test_list_tags(self):
         tree1 = self.make_branch_and_tree('branch1')
         tree1.commit(allow_pointless=True, message='revision 1',

=== modified file 'doc/en/release-notes/bzr-2.2.txt'
--- a/doc/en/release-notes/bzr-2.2.txt	2010-10-22 02:45:15 +0000
+++ b/doc/en/release-notes/bzr-2.2.txt	2010-11-10 02:01:33 +0000
@@ -19,9 +19,36 @@
 Bug Fixes
 *********
 
+* ``bzr resolve --take-other <file>`` will not crash anymore if ``<file>``
+  is involved in a text conflict (but the conflict is still not
+  resolved). (Vincent Ladeuil, #646961)
+
+* Commit in a bound branch or heavyweight checkout now propagates tags
+  (e.g. from a merge) to the master branch (and informs the user if there
+  is a conflict).  (Andrew Bennetts, #603395)
+  
+* Correctly set the Content-Type header when http POSTing to comply
+  with stricter web frameworks. (Vincent Ladeuil, #655100)
+
+* ``NotBranchError`` no longer allows errors from calling
+  ``bzrdir.open_repository()`` to propagate.  This is unhelpful at best,
+  and at worst can trigger infinite loops in callers.  (Andrew Bennetts)
+  
+* Skip tests that needs a bzr source tree when there isn't one. This is
+  needed to succesfully run the test suite for installed versions.
+  (Vincent Ladeuil, #644855).
+
+* Skip the tests that requires respecting the chmod bits when running as
+  root. Including the one that wasn't present in 2.1.
+  (Vincent Ladeuil, #646133)
+
 * Using bzr with `lp:` urls behind an http proxy should work.
   (Robert Collins, #558343)
 
+* Windows installers no longer requires the Microsoft vcredist to be
+  installed.
+  (Martin [gz], Gary van der Merwe, #632465)
+
 Improvements
 ************
 
@@ -44,14 +71,6 @@
 * Fix tests that failed when run under ``LANG=C``.
   (Andrew Bennetts, #632387)
 
-* Skip tests that needs a bzr source tree when there isn't one. This is
-  needed to succesfully run the test suite for installed versions.
-  (Vincent Ladeuil, #644855).
-
-* Skip the tests that requires respecting the chmod bits when running as
-  root. Including the one that wasn't present in 2.1.
-  (Vincent Ladeuil, #646133)
-
 
 bzr 2.2.1
 #########




More information about the bazaar-commits mailing list