Rev 347: Show progress bar when finding branches. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Mon Jan 1 05:44:20 GMT 2007


------------------------------------------------------------
revno: 347
revision-id: jelmer at samba.org-20070101054344-0crkmk42n3k2u9fp
parent: jelmer at samba.org-20070101025448-xsv2sdp4yzw12s01
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Mon 2007-01-01 06:43:44 +0100
message:
  Show progress bar when finding branches.
modified:
  TODO                           todo-20060729211917-2kpobww0zyvvo0j2-1
  convert.py                     svn2bzr.py-20051018015439-cb4563bff29e632d
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
=== modified file 'TODO'
--- a/TODO	2006-12-28 03:41:06 +0000
+++ b/TODO	2007-01-01 05:43:44 +0000
@@ -1,2 +1,6 @@
+- don't generate revision history in branch until really necessary
+- custom implementation of last_revision() so that revision history doesn't
+  have to be generated?
+- avoid extra connect in logwalker?
 - get rid of use of `svn ls' in logwalker
 - more efficient implementation for applying txdeltas to weaves. perhaps convert svn deltas to bzr deltas?

=== modified file 'convert.py'
--- a/convert.py	2007-01-01 02:54:48 +0000
+++ b/convert.py	2007-01-01 05:43:44 +0000
@@ -83,10 +83,14 @@
             if all:
                 source_repos.copy_content_into(target_repos)
 
-        branches = list(source_repos.find_branches())
-        mutter('branches: %r' % list(branches))
-        existing_branches = filter(lambda (bp, revnum, exists): exists, 
+        pb = ui_factory.nested_progress_bar()
+        try:
+            branches = source_repos.find_branches(pb=pb)
+            existing_branches = filter(lambda (bp, revnum, exists): exists, 
                                    branches)
+        finally:
+            pb.finished()
+
         pb = ui_factory.nested_progress_bar()
                        
         try:

=== modified file 'repository.py'
--- a/repository.py	2007-01-01 02:42:56 +0000
+++ b/repository.py	2007-01-01 05:43:44 +0000
@@ -28,6 +28,7 @@
 from bzrlib.revision import Revision, NULL_REVISION
 from bzrlib.transport import Transport
 from bzrlib.trace import mutter
+from bzrlib.ui import ui_factory
 
 from svn.core import SubversionException, Pool
 import svn.core
@@ -582,7 +583,7 @@
 
         return self._ancestry
 
-    def find_branches(self, revnum=None):
+    def find_branches(self, revnum=None, pb=None):
         """Find all branches that were changed in the specified revision number.
 
         :param revnum: Revision to search for branches.
@@ -593,6 +594,8 @@
         created_branches = {}
 
         for i in range(revnum+1):
+            if pb is not None:
+                pb.update("finding branches", i, revnum+1)
             paths = self._log.get_revision_paths(i)
             for p in paths:
                 if self.scheme.is_branch(p):




More information about the bazaar-commits mailing list