Rev 1598: Use enumerate. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk
Jelmer Vernooij
jelmer at samba.org
Fri Aug 22 16:09:17 BST 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/trunk
------------------------------------------------------------
revno: 1598
revision-id: jelmer at samba.org-20080822150915-1dd2ufo5tu11j55m
parent: jelmer at samba.org-20080822145628-4dyocravk7nih4fu
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Fri 2008-08-22 17:09:15 +0200
message:
Use enumerate.
modified:
convert.py svn2bzr.py-20051018015439-cb4563bff29e632d
=== modified file 'convert.py'
--- a/convert.py 2008-07-01 16:43:44 +0000
+++ b/convert.py 2008-08-22 15:09:15 +0000
@@ -148,8 +148,7 @@
source_graph = source_repos.get_graph()
pb = ui.ui_factory.nested_progress_bar()
try:
- i = 0
- for source_branch in existing_branches:
+ for i, source_branch in enumerate(existing_branches):
pb.update("%s:%d" % (source_branch.get_branch_path(), source_branch.get_revnum()), i, len(existing_branches))
target_dir = get_dir(source_branch.get_branch_path())
if not create_shared_repo:
@@ -174,7 +173,6 @@
target_branch.pull(source_branch)
if working_trees and not target_dir.has_workingtree():
target_dir.create_workingtree()
- i += 1
finally:
pb.finished()
finally:
More information about the bazaar-commits
mailing list