Rev 2006: When creating new repository, avoid checking whether revision ids are already present. in file:///data/jelmer/bzr-svn/0.5/

Jelmer Vernooij jelmer at samba.org
Mon Nov 17 17:58:56 GMT 2008


At file:///data/jelmer/bzr-svn/0.5/

------------------------------------------------------------
revno: 2006
revision-id: jelmer at samba.org-20081117175853-g88b5y8bfp000x8z
parent: jelmer at samba.org-20081117165841-v1aydefy0gtuccf6
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Mon 2008-11-17 18:58:53 +0100
message:
  When creating new repository, avoid checking whether revision ids are already present.
modified:
  convert.py                     svn2bzr.py-20051018015439-cb4563bff29e632d
=== modified file 'convert.py'
--- a/convert.py	2008-11-12 18:09:07 +0000
+++ b/convert.py	2008-11-17 17:58:53 +0000
@@ -171,14 +171,17 @@
     if create_shared_repo:
         try:
             target_repos = get_dir("").open_repository()
+            target_repos_is_empty = False # FIXME: Call Repository.is_empty() ?
             assert (layout.is_branch("") or 
                     layout.is_tag("") or 
                     target_repos.is_shared())
         except NoRepositoryPresent:
             target_repos = get_dir("").create_repository(shared=True)
+            target_repos_is_empty = True
         target_repos.set_make_working_trees(working_trees)
     else:
         target_repos = None
+        target_repos_is_empty = False
 
     source_repos.lock_read()
     try:
@@ -211,13 +214,12 @@
                 try:
                     if revmeta.is_hidden(mapping):
                         continue
-                    revid = revmeta.get_revision_id(mapping)
+                    if target_repos is not None and (target_repos_is_empty or not target_repos.has_revision(revmeta.get_revision_id(mapping))):
+                        revmetas.append(revmeta)
+                    if not revmeta.branch_path in existing_branches:
+                        existing_branches[revmeta.branch_path] = SvnBranch(source_repos, revmeta.branch_path, revnum=revmeta.revnum, _skip_check=True)
                 except SubversionException, (_, ERR_FS_NOT_DIRECTORY):
                     continue
-                if target_repos is not None and not target_repos.has_revision(revid):
-                    revmetas.append(revmeta)
-                if not revmeta.branch_path in existing_branches:
-                    existing_branches[revmeta.branch_path] = SvnBranch(source_repos, revmeta.branch_path, revnum=revmeta.revnum, _skip_check=True)
         finally:
             pb.finished()
         existing_branches = existing_branches.values()




More information about the bazaar-commits mailing list