changeset 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 3ff8666b1479
children 2060e0ca8dd5
files hgsubversion/stupid.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
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)