diff hgsubversion/stupid.py @ 1046:36fe4b316a6b

stupid: fix --startrev we didn't test for this, so it was broken...
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 07 Aug 2013 22:42:11 +0200
parents 67e11b650e94
children b746d455f0e1
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -606,12 +606,18 @@ def checkbranch(meta, r, branch):
             return None
     return branchtip
 
-def branches_in_paths(meta, tbdelta, paths, revnum, checkpath, listdir):
+def branches_in_paths(meta, tbdelta, paths, revnum, checkpath, listdir,
+                      firstrun):
     '''Given a list of paths, return mapping of all branches touched
     to their branch path.
     '''
     branches = {}
-    paths_need_discovery = []
+    if firstrun:
+        paths_need_discovery = [p for (p, t) in listdir('', revnum)
+                                if t == 'f']
+    else:
+        paths_need_discovery = []
+
     for p in paths:
         relpath, branch, branchpath = meta.split_branch_path(p)
         if relpath is not None:
@@ -671,7 +677,7 @@ def convert_rev(ui, meta, svn, r, tbdelt
         raise hgutil.Abort('filemaps currently unsupported with stupid replay.')
 
     branches = branches_in_paths(meta, tbdelta, r.paths, r.revnum,
-                                 svn.checkpath, svn.list_files)
+                                 svn.checkpath, svn.list_files, firstrun)
     brpaths = branches.values()
     bad_branch_paths = {}
     for br, bp in branches.iteritems():
@@ -735,7 +741,8 @@ def convert_rev(ui, meta, svn, r, tbdelt
         # it, or we can force the existing fetch_branchrev() path. Do
         # the latter for now.
         incremental = (meta.revmap.oldest > 0 and
-                       parentctx.rev() != node.nullrev)
+                       parentctx.rev() != node.nullrev and
+                       not firstrun)
 
         if incremental:
             try: