From 6255b11e747886a9b079e7307d59ff52f8399db5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 11 Nov 2014 22:33:31 -0500 Subject: [PATCH] More fast-export repair, annd a tighter regression test. --- TODO | 2 +- src | 3 ++- srctest | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index f62e367..e442035 100644 --- a/TODO +++ b/TODO @@ -8,7 +8,7 @@ * get rid of add -* Should branch_delete really obsolese branched or just mark them dead? +* Should branch_delete really obsolesce branched or just mark them dead? BUGS diff --git a/src b/src index 257f9e1..831abab 100755 --- a/src +++ b/src @@ -853,7 +853,8 @@ def fast_export_method(*args): # FIXME: Sanitize branch names. # FIXME: Make this canonical even with tags branch = arg + "master" - for item in metadata: + for i in range(ctx.start, ctx.end+1): + item = metadata.by_revno(i) scratchfile = "/tmp/src%dtmp" % os.getpid() backend.cat(arg, item.revision, scratchfile) size = os.path.getsize(scratchfile) diff --git a/srctest b/srctest index 9c127f1..e0e943e 100755 --- a/srctest +++ b/srctest @@ -168,7 +168,7 @@ diff testfile12 testfile13 check "tag list check after deletion" # Alas, we have to do this or the fast-export regression will fail. -# We don't know how to be perfectly canonical about tags let. +# We don't know how to be perfectly canonical about tags yet. src $TESTOPTS tag delete basetag check "tag deletion: basetag" @@ -180,6 +180,12 @@ diff -u testfile14 testfile15 check "fast-export" rm -fr $SANDBOX/foo +# There was a point at which fast-export was broken, +# but the test was passing because an empty file +# produced a repo that git dumped as an emoty file! +grep jrh testfile15 >/dev/null +check "fast-export content check" + src $TESTOPTS rename testfile1 newname1 check "move command" if [ -e newname1 -a -e $SANDBOX/newname1,v ] -- 2.43.0