Rev 2790: Remove another stat by using path_content_summary to avoid a has_filename call. in http://people.ubuntu.com/~robertc/baz2.0/commit

Robert Collins robertc at robertcollins.net
Wed Sep 12 06:06:46 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/commit

------------------------------------------------------------
revno: 2790
revision-id: robertc at robertcollins.net-20070912050636-c6fu3lybn1tbftk5
parent: robertc at robertcollins.net-20070911090940-2lbw0h6ev8z2zp6w
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit
timestamp: Wed 2007-09-12 15:06:36 +1000
message:
  Remove another stat by using path_content_summary to avoid a has_filename call.
modified:
  bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2007-09-11 09:09:40 +0000
+++ b/bzrlib/commit.py	2007-09-12 05:06:36 +0000
@@ -708,16 +708,15 @@
             # deleted files matching that filter.
             if is_inside_any(deleted_paths, path):
                 continue
+            content_summary = self.work_tree.path_content_summary(path)
             if not specific_files or is_inside_any(specific_files, path):
-                # TODO: fix double-stat here.
-                if not self.work_tree.has_filename(path):
+                if content_summary[0] == 'missing':
                     deleted_paths.add(path)
                     self.reporter.missing(path)
                     deleted_ids.append(file_id)
                     continue
             # TODO: have the builder do the nested commit just-in-time IF and
             # only if needed.
-            content_summary = self.work_tree.path_content_summary(path)
             if content_summary[0] == 'tree-reference':
                 # enforce repository nested tree policy.
                 if (not self.work_tree.supports_tree_reference() or



More information about the bazaar-commits mailing list