diff hgsubversion/stupid.py @ 648:8fb38602e3ed

stupid: always fetch the entire first revision
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 20 Jul 2010 11:55:07 +0200
parents a3d20d6e96b0
children 1add57910c82
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -583,12 +583,17 @@ def convert_rev(ui, meta, svn, r, tbdelt
                 deleted_branches[b] = parentctx.node()
             continue
 
-        try:
-            files_touched, filectxfn2 = diff_branchrev(
-                ui, svn, meta, b, branches[b], r, parentctx)
-        except BadPatchApply, e:
-            # Either this revision or the previous one does not exist.
-            ui.note("Fetching entire revision: %s.\n" % e.args[0])
+        incremental = (meta.revmap.oldest > 0)
+
+        if incremental:
+            try:
+                files_touched, filectxfn2 = diff_branchrev(
+                    ui, svn, meta, b, branches[b], r, parentctx)
+            except BadPatchApply, e:
+                # Either this revision or the previous one does not exist.
+                ui.note("Fetching entire revision: %s.\n" % e.args[0])
+                incremental = False
+        if not incremental:
             files_touched, filectxfn2 = fetch_branchrev(
                 svn, meta, b, branches[b], r, parentctx)