Rev 3110: Fix ImmortalLimbo errors when transform rolls back (Aaron Bentley) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Dec 14 07:50:43 GMT 2007


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

------------------------------------------------------------
revno: 3110
revision-id:pqm at pqm.ubuntu.com-20071214075036-o6tv5n85w95m57uq
parent: pqm at pqm.ubuntu.com-20071214054408-5xnavnb30uddiqxh
parent: abentley at panoramicfeedback.com-20071214065543-l97o7c7vyt22u3iq
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-12-14 07:50:36 +0000
message:
  Fix ImmortalLimbo errors when transform rolls back (Aaron Bentley)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
    ------------------------------------------------------------
    revno: 3100.1.2
    revision-id:abentley at panoramicfeedback.com-20071214065543-l97o7c7vyt22u3iq
    parent: abentley at panoramicfeedback.com-20071211192127-62sxsmsl11tj33h1
    parent: pqm at pqm.ubuntu.com-20071214054408-5xnavnb30uddiqxh
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: transform-recovery
    timestamp: Fri 2007-12-14 01:55:43 -0500
    message:
      Merge bzr.dev
    added:
      doc/en/user-guide/adv_merging.txt adv_merging.txt-20071213070245-d7u7150lb2hhnvby-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/branch.py               branch.py-20050309040759-e4baf4e0d046576e
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/merge_directive.py      merge_directive.py-20070228184838-ja62280spt1g7f4x-1
      bzrlib/tests/blackbox/test_bound_branches.py test_bound_branches.py-20051109215527-2373188ad566c205
      bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
      bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
      bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
      bzrlib/tests/test_http_response.py test_http_response.py-20060628233143-950b2a482a32505d
      bzrlib/tests/test_merge_directive.py test_merge_directive-20070228184838-ja62280spt1g7f4x-2
      bzrlib/transport/http/__init__.py http_transport.py-20050711212304-506c5fd1059ace96
      bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
      doc/en/user-guide/authentication_conf.txt authentication_conf.-20071104135035-glfv0ri355tyg1nf-1
      doc/en/user-guide/configuration.txt configuration.txt-20060314161707-868350809502af01
      doc/en/user-guide/core_concepts.txt core_concepts.txt-20071114035000-q36a9h57ps06uvnl-2
      doc/en/user-guide/http_smart_server.txt fastcgi.txt-20061005091552-rz8pva0olkxv0sd8-3
      doc/en/user-guide/index.txt    index.txt-20060622101119-tgwtdci8z769bjb9-2
      doc/en/user-guide/installing_bazaar.txt installing_bazaar.tx-20071114035000-q36a9h57ps06uvnl-4
      doc/en/user-guide/plugins.txt  plugins.txt-20060314145616-525099a747f3ffdd
      doc/en/user-guide/publishing_a_branch.txt publishing_a_branch.-20071123055134-k5x4ekduci2lbn36-2
      doc/en/user-guide/reusing_a_checkout.txt reusing_a_checkout.t-20071123055134-k5x4ekduci2lbn36-3
      doc/en/user-guide/server.txt   server.txt-20060913044801-h939fvbwzz39gf7g-1
      doc/en/user-guide/setting_up_email.txt setting_up_email.txt-20060314161707-fd242c8944346173
      doc/en/user-guide/specifying_revisions.txt specifying_revisions.txt-20060314161707-19deb139101bea33
      doc/en/user-guide/version_info.txt version_info.txt-20060921215543-gju6o5xdic8w25np-1
    ------------------------------------------------------------
    revno: 3100.1.1
    revision-id:abentley at panoramicfeedback.com-20071211192127-62sxsmsl11tj33h1
    parent: pqm at pqm.ubuntu.com-20071210201101-pwhyse7wzn7pvyzx
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: transform-recovery
    timestamp: Tue 2007-12-11 14:21:27 -0500
    message:
      Fix ImmortalLimbo errors when transforms fail
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
=== modified file 'NEWS'
--- a/NEWS	2007-12-14 05:44:08 +0000
+++ b/NEWS	2007-12-14 06:55:43 +0000
@@ -21,6 +21,9 @@
 
    * Fix Makefile rules for doc generation. (Ian Clatworthy, #175207)
 
+   * Transform failures no longer cause ImmortalLimbo errors (Aaron Bentley,
+     #137681)
+
    * ``uncommit`` works even when the commit messages of revisions to be
      removed use characters not supported in the terminal encoding.
      (Aaron Bentley)

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2007-12-02 02:29:02 +0000
+++ b/bzrlib/tests/test_transform.py	2007-12-11 19:21:27 +0000
@@ -1124,6 +1124,24 @@
         self.assertContainsRe(str(err),
             "^File exists: .+/foo")
 
+    def test_two_directories_clash_finalize(self):
+        def tt_helper():
+            wt = self.make_branch_and_tree('.')
+            tt = TreeTransform(wt)  # TreeTransform obtains write lock
+            try:
+                foo_1 = tt.new_directory('foo', tt.root)
+                tt.new_directory('bar', foo_1)
+                foo_2 = tt.new_directory('foo', tt.root)
+                tt.new_directory('baz', foo_2)
+                # Lie to tt that we've already resolved all conflicts.
+                tt.apply(no_conflicts=True)
+            except:
+                tt.finalize()
+                raise
+        err = self.assertRaises(errors.FileExists, tt_helper)
+        self.assertContainsRe(str(err),
+            "^File exists: .+/foo")
+
 
 class TransformGroup(object):
 

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2007-12-02 02:29:02 +0000
+++ b/bzrlib/transform.py	2007-12-11 19:21:27 +0000
@@ -997,6 +997,7 @@
         new_paths = self.new_paths()
         modified_paths = []
         child_pb = bzrlib.ui.ui_factory.nested_progress_bar()
+        completed_new = []
         try:
             for num, (path, trans_id) in enumerate(new_paths):
                 new_entry = None
@@ -1019,7 +1020,7 @@
                             self.rename_count += 1
                     if trans_id in self._new_contents:
                         modified_paths.append(full_path)
-                        del self._new_contents[trans_id]
+                        completed_new.append(trans_id)
 
                 if trans_id in self._new_id:
                     if kind is None:
@@ -1064,6 +1065,8 @@
                                             new_entry))
         finally:
             child_pb.finished()
+        for trans_id in completed_new:
+            del self._new_contents[trans_id]
         return modified_paths
 
     def _set_executability(self, path, entry, trans_id):




More information about the bazaar-commits mailing list