# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1740524403 18000
#      Tue Feb 25 18:00:03 2025 -0500
# Node ID 0493e0ae70e6180ad30af93e4c8013d8f7063fa4
# Parent  dd36ccc521992511dcdc3292fc2a74ac60bc96c9
# EXP-Topic commit-bench
benchmark: add a variant where a new file is added

This will exercise the fncache update.

diff --git a/suites/hg/benchmarks/commit.pbd b/suites/hg/benchmarks/commit.pbd
--- a/suites/hg/benchmarks/commit.pbd
+++ b/suites/hg/benchmarks/commit.pbd
@@ -10,11 +10,17 @@
 MAIN_REPO = "DATA-VARS:mercurial.main-repo-path"
 
 [simple-command]
-command = "hg commit -m 'poulpebenchmarkrun' -R ../poulpe-temp-source"
+command = "hg commit -m 'poulpebenchmarkrun' -R poulpe-temp-source"
 prepare-run = """
-cd \"$POULPE_DATA_ENV_ROOT\";
 rm -rf poulpe-temp-source;
-cp --archive --recursive --reflink=auto \"$POULPE_CWD\" poulpe-temp-source;"""
+cp --archive --recursive --reflink=auto \"$MAIN_REPO\" poulpe-temp-source;
+
+if [ -n \"$NEW_FILE\" ]; then
+    echo \"BABAR IS GREATEST\" > poulpe-temp-source/TEMPORARY_POULPE_BENCHMARK_FILE_FOO;
+    hg --cwd poulpe-temp-source add TEMPORARY_POULPE_BENCHMARK_FILE_FOO;
+fi
+sleep 1;
+hg --cwd poulpe-temp-source status;"""
 
 [simple-command.variants.dimensions.repo-state.modified]
 default = true
@@ -47,3 +53,6 @@
 
 [simple-command.variants.dimensions.repo-state.modified-and-copied]
 cwd = "DATA-VARS:mercurial.working-copy.modified-and-copied"
+
+[simple-command.variants.dimensions.repo-state.add-1-new.environment]
+NEW_FILE = "1"
diff --git a/suites/hg/benchmarks/commit.pkl b/suites/hg/benchmarks/commit.pkl
--- a/suites/hg/benchmarks/commit.pkl
+++ b/suites/hg/benchmarks/commit.pkl
@@ -8,11 +8,17 @@
     ["MAIN_REPO"] = "DATA-VARS:mercurial.main-repo-path"
 }
 
-command = "hg commit -m 'poulpebenchmarkrun' -R ../poulpe-temp-source"
+command = "hg commit -m 'poulpebenchmarkrun' -R poulpe-temp-source"
 prepare_run = """
-cd "$POULPE_DATA_ENV_ROOT";
 rm -rf poulpe-temp-source;
-cp --archive --recursive --reflink=auto "$POULPE_CWD" poulpe-temp-source;
+cp --archive --recursive --reflink=auto "$MAIN_REPO" poulpe-temp-source;
+
+if [ -n "$NEW_FILE" ]; then
+    echo "BABAR IS GREATEST" > poulpe-temp-source/TEMPORARY_POULPE_BENCHMARK_FILE_FOO;
+    hg --cwd poulpe-temp-source add TEMPORARY_POULPE_BENCHMARK_FILE_FOO;
+fi
+sleep 1;
+hg --cwd poulpe-temp-source status;
 """
 variants {
     ["repo-state"] = (v.simple_command["repo-state"]) {
@@ -22,6 +28,11 @@
             ["clean"] {
                 acceptable_return_codes = new {1}
             }
+            ["add-1-new"] {
+                environment {
+                    ["NEW_FILE"] = "1"
+                }
+            }
         }
     }
 }