Rev 14: More speed optimizations, deal with already created revisions. in file:///data/jelmer/bzr-rebase/trunk/

Jelmer Vernooij jelmer at samba.org
Thu Jul 12 09:22:40 BST 2007


At file:///data/jelmer/bzr-rebase/trunk/

------------------------------------------------------------
revno: 14
revision-id: jelmer at samba.org-20070705102932-mhots77le9td8jtw
parent: jelmer at samba.org-20070705100556-yrerx4w8gbsqtp93
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-rebase
timestamp: Thu 2007-07-05 12:29:32 +0200
message:
  More speed optimizations, deal with already created revisions.
modified:
  rebase.py                      rebase.py-20070626221123-ellanmf93nw8z9r1-1
=== modified file 'rebase.py'
--- a/rebase.py	2007-07-05 10:05:56 +0000
+++ b/rebase.py	2007-07-05 10:29:32 +0000
@@ -224,11 +224,9 @@
 
     # Figure out the dependencies
     for revid in todo:
-        possible = True
         for p in replace_map[revid][1]:
             if repository.has_revision(p):
                 continue
-            possible = False
             if not dependencies.has_key(p):
                 dependencies[p] = []
             dependencies[p].append(revid)
@@ -326,17 +324,23 @@
     pb = ui.ui_factory.nested_progress_bar()
     i = 0
     try:
+        parent_invs = map(repository.get_revision_inventory, new_parents)
         transact = repository.get_transaction()
         for path, ie in oldinv.iter_entries():
             pb.update('upgrading file', i, total)
             i += 1
             new_ie = ie.copy()
-            if new_ie.revision == oldrevid:
-                new_ie.revision = None
             new_ie.file_id = oldtree.new_id(new_ie.file_id)
             new_ie.parent_id = oldtree.new_id(new_ie.parent_id)
+            if new_ie.revision == oldrevid:
+                if repository.weave_store.get_weave_or_empty(new_ie.file_id, 
+                        transact).has_version(newrevid):
+                    new_ie.revision = newrevid
+                else:
+                    new_ie.revision = None
+
             builder.record_entry_contents(new_ie, 
-                   map(repository.get_revision_inventory, new_parents), 
+                    parent_invs,
                    path, oldtree)
     finally:
         pb.finished()




More information about the bazaar-commits mailing list