Rev 3139: Fix build_tree acceleration when file is moved in accelerator_tree in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Dec 21 14:55:08 GMT 2007


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

------------------------------------------------------------
revno: 3139
revision-id:pqm at pqm.ubuntu.com-20071221145325-erktp9le86ik56j1
parent: pqm at pqm.ubuntu.com-20071221064933-tsmn13951il1c01q
parent: aaron.bentley at utoronto.ca-20071221041231-q2l480o2twqvayj5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-12-21 14:53:25 +0000
message:
  Fix build_tree acceleration when file is moved in accelerator_tree
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
  bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
    ------------------------------------------------------------
    revno: 3137.1.1
    revision-id:aaron.bentley at utoronto.ca-20071221041231-q2l480o2twqvayj5
    parent: pqm at pqm.ubuntu.com-20071220203346-toifx0pb5987jcqo
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: hardlinks3
    timestamp: Thu 2007-12-20 23:12:31 -0500
    message:
      Fix build_tree acceleration when file is moved in accelerator_tree
    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-21 05:52:38 +0000
+++ b/NEWS	2007-12-21 14:53:25 +0000
@@ -55,6 +55,9 @@
 
   BUGFIXES:
 
+   * build_tree acceleration uses the correct path when a file has been moved.
+     (Aaron Bentley)
+
    * Fixed Unicode encoding error in ``ignored`` when the output is
      redirected to a pipe. (Lukáš Lalinský)
 

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2007-12-20 16:38:52 +0000
+++ b/bzrlib/tests/test_transform.py	2007-12-21 04:12:31 +0000
@@ -1569,6 +1569,23 @@
         self.addCleanup(target.unlock)
         self.assertEqual([], list(target._iter_changes(revision_tree)))
 
+    def test_build_tree_accelerator_tree_moved(self):
+        source = self.make_branch_and_tree('source')
+        self.build_tree_contents([('source/file1', 'A')])
+        source.add(['file1'], ['file1-id'])
+        source.commit('commit files')
+        source.rename_one('file1', 'file2')
+        source.lock_read()
+        self.addCleanup(source.unlock)
+        target = self.make_branch_and_tree('target')
+        revision_tree = source.basis_tree()
+        revision_tree.lock_read()
+        self.addCleanup(revision_tree.unlock)
+        build_tree(revision_tree, target, source)
+        target.lock_read()
+        self.addCleanup(target.unlock)
+        self.assertEqual([], list(target._iter_changes(revision_tree)))
+
 
 class MockTransform(object):
 

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2007-12-20 14:28:59 +0000
+++ b/bzrlib/transform.py	2007-12-21 04:12:31 +0000
@@ -1467,7 +1467,7 @@
         new_desired_files = desired_files
     else:
         iter = accelerator_tree._iter_changes(tree, include_unchanged=True)
-        unchanged = dict((f, p[0]) for (f, p, c, v, d, n, k, e)
+        unchanged = dict((f, p[1]) for (f, p, c, v, d, n, k, e)
                          in iter if not c)
         new_desired_files = []
         for file_id, identifier in desired_files:




More information about the bazaar-commits mailing list