Rev 2975: Re-enable the fast path for the no-parent commit case. in http://bzr.arbash-meinel.com/branches/bzr/0.93-dev/fast_diff_versus_empty

John Arbash Meinel john at arbash-meinel.com
Tue Nov 6 22:33:24 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.93-dev/fast_diff_versus_empty

------------------------------------------------------------
revno: 2975
revision-id:john at arbash-meinel.com-20071106223311-3c3qj42y02pm9cs5
parent: pqm at pqm.ubuntu.com-20071106124804-ehlreba0lfp3kab9
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: fast_diff_versus_empty
timestamp: Tue 2007-11-06 16:33:11 -0600
message:
  Re-enable the fast path for the no-parent commit case.
modified:
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
-------------- next part --------------
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-11-05 19:40:28 +0000
+++ b/bzrlib/workingtree_4.py	2007-11-06 22:33:11 +0000
@@ -1719,10 +1719,7 @@
         # NB: show_status depends on being able to pass in non-versioned files
         # and report them as unknown
         # TODO: handle extra trees in the dirstate.
-        # TODO: handle comparisons as an empty tree as a different special
-        # case? mbp 20070226
-        if (extra_trees or (self.source._revision_id == NULL_REVISION)
-            or specific_files == []):
+        if (extra_trees or specific_files == []):
             # we can't fast-path these cases (yet)
             for f in super(InterDirStateTree, self)._iter_changes(
                 include_unchanged, specific_files, pb, extra_trees,
@@ -1730,7 +1727,8 @@
                 yield f
             return
         parent_ids = self.target.get_parent_ids()
-        assert (self.source._revision_id in parent_ids), \
+        assert (self.source._revision_id in parent_ids
+                or self.source._revision_id == NULL_REVISION), \
                 "revision {%s} is not stored in {%s}, but %s " \
                 "can only be used for trees stored in the dirstate" \
                 % (self.source._revision_id, self.target, self._iter_changes)
@@ -1743,7 +1741,7 @@
                 "Failure: source._revision_id: %s not in target.parent_ids(%s)" % (
                 self.source._revision_id, parent_ids)
             source_index = 1 + parent_ids.index(self.source._revision_id)
-            indices = (source_index,target_index)
+            indices = (source_index, target_index)
         # -- make all specific_files utf8 --
         if specific_files:
             specific_files_utf8 = set()



More information about the bazaar-commits mailing list