Rev 4718: PreviewTree.get_file_mtime works with unmodified files. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Sep 29 07:08:09 BST 2009


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

------------------------------------------------------------
revno: 4718 [merge]
revision-id: pqm at pqm.ubuntu.com-20090929060808-n4ruep2nifvkqfci
parent: pqm at pqm.ubuntu.com-20090928042152-wt2kv0l6almf1f0f
parent: aaron at aaronbentley.com-20090929045158-tw1r17dn1a081o33
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-09-29 07:08:08 +0100
message:
  PreviewTree.get_file_mtime works with unmodified files.
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	2009-09-28 04:21:52 +0000
+++ b/NEWS	2009-09-29 04:51:58 +0000
@@ -96,6 +96,9 @@
   chk_bytes root records.
   (Andrew Bennetts, #423506)
 
+* PreviewTree behaves correctly when get_file_mtime is invoked on an unmodified
+  file. (Aaron Bentley, #251532)
+
 * Registry objects should not use iteritems() when asked to use items().
   (Vincent Ladeuil, #430510)
 

=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py	2009-09-02 09:07:24 +0000
+++ b/bzrlib/tests/test_transform.py	2009-09-29 04:40:55 +0000
@@ -2277,6 +2277,18 @@
         self.assertEqual(os.stat(limbo_path).st_mtime,
                          preview_tree.get_file_mtime('file-id'))
 
+    def test_get_file_mtime_renamed(self):
+        work_tree = self.make_branch_and_tree('tree')
+        self.build_tree(['tree/file'])
+        work_tree.add('file', 'file-id')
+        preview = TransformPreview(work_tree)
+        self.addCleanup(preview.finalize)
+        file_trans_id = preview.trans_id_tree_file_id('file-id')
+        preview.adjust_path('renamed', preview.root, file_trans_id)
+        preview_tree = preview.get_preview_tree()
+        preview_mtime = preview_tree.get_file_mtime('file-id', 'renamed')
+        work_mtime = work_tree.get_file_mtime('file-id', 'file')
+
     def test_get_file(self):
         preview = self.get_empty_preview()
         preview.new_file('file', preview.root, 'contents', 'file-id')

=== modified file 'bzrlib/transform.py'
--- a/bzrlib/transform.py	2009-08-28 05:00:33 +0000
+++ b/bzrlib/transform.py	2009-09-29 04:40:55 +0000
@@ -1884,7 +1884,7 @@
     def get_file_mtime(self, file_id, path=None):
         """See Tree.get_file_mtime"""
         if not self._content_change(file_id):
-            return self._transform._tree.get_file_mtime(file_id, path)
+            return self._transform._tree.get_file_mtime(file_id)
         return self._stat_limbo_file(file_id).st_mtime
 
     def _file_size(self, entry, stat_value):




More information about the bazaar-commits mailing list