From 591acda6f9853e4190fc9b28273e689394a28d29 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 30 May 2013 14:06:32 -0400 Subject: [PATCH] reproduce.tt: Save the revCount when reproducing more than once Signed-off-by: Shea Levy --- src/root/reproduce.tt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/root/reproduce.tt b/src/root/reproduce.tt index 60fb3094..bb7fb1ae 100644 --- a/src/root/reproduce.tt +++ b/src/root/reproduce.tt @@ -97,6 +97,9 @@ if ! [ -d "$inputDir" ]; then revCount="$(cd "$inputDirTmp" && (git rev-list '[% input.revision %]' | wc -l))" rm -rf "$inputDirTmp/.git" mv "$inputDirTmp" "$inputDir" + echo -n $revCount > "$tmpDir/[% input.name %]/revCount" +else + revCount="$(cat "$tmpDir/[% input.name %]/revCount")" fi args+=(--arg '[% input.name %]' "{ outPath = $inputDir; rev = \"[% input.revision %]\"; shortRev = \"[% input.revision.substr(0, 7) %]\"; revCount = \"$revCount\"; }") @@ -116,6 +119,9 @@ if ! [ -d "$inputDir" ]; then revCount="$(cd "$inputDirTmp" && (hg log -r '[% input.revision %]' --template "{rev}"))" rm -rf "$inputDirTmp/.hg" mv "$inputDirTmp" "$inputDir" + echo -n $revCount > "$tmpDir/[% input.name %]/revCount" +else + revCount="$(cat "$tmpDir/[% input.name %]/revCount")" fi args+=(--arg '[% input.name %]' "{ outPath = $inputDir; rev = \"[% input.revision %]\"; revCount = \"$revCount\"; }")