changeset 650:685f91015ed6

replay: always fetch the entire first revision The entire revision is fetched using the just-added get_revision() wrapper. Essentially, this allows us to begin a conversion with a non-zero start revision. As an extra safety feature, this mode is *always* used for the very first revision, even if no start revision is specified. For most repositories, this shouldn't matter; the entire revision will be fetched regardless. However, there are repositories that currently `confuse' us, such as bzr-svn conversions, and where this is an improvement.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 20 Jul 2010 11:55:07 +0200 (2010-07-20)
parents 2060e0ca8dd5
children 827547493112
files hgsubversion/replay.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/replay.py
+++ b/hgsubversion/replay.py
@@ -25,7 +25,13 @@ def convert_rev(ui, meta, svn, r, tbdelt
     editor = meta.editor
     editor.current.clear()
     editor.current.rev = r
-    svn.get_replay(r.revnum, editor)
+
+    if meta.revmap.oldest <= 0:
+        # no prior revisions are known, so fetch the entire revision contents
+        svn.get_revision(r.revnum, editor)
+    else:
+        svn.get_replay(r.revnum, editor, meta.revmap.oldest)
+
     current = editor.current
     current.findmissing(svn)