tests: replace `hg id --debug -i` command substitution with non-debug command
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 02 Oct 2024 11:43:22 -0400
changeset 51944 2eeca9a8f4a7
parent 51943 9b14a8cf4f78
child 51945 4ee2505f9f65
tests: replace `hg id --debug -i` command substitution with non-debug command The censor and convert tests were failing on Windows because the `--debug` flag also prints debug messages, and at least some of these were outputting: skip updating dirstate: identity mismatch ${node} Obviously that causes cascading problems. The other tests were OK, but it's better to use a non debug command for stability.
tests/test-bisect.t
tests/test-censor.t
tests/test-convert-splicemap.t
tests/test-phases.t
--- a/tests/test-bisect.t	Tue Oct 01 21:40:20 2024 -0400
+++ b/tests/test-bisect.t	Wed Oct 02 11:43:22 2024 -0400
@@ -579,7 +579,7 @@
 tip is obsolete
 ---------------------
 
-  $ hg debugobsolete `hg id --debug -i -r tip`
+  $ hg debugobsolete `hg id -T "{node}" -r tip`
   1 new obsolescence markers
   obsoleted 1 changesets
   $ hg bisect --reset
@@ -608,7 +608,7 @@
   reverting a
   $ hg commit -m 'msg 30 -- fixed'
   created new head
-  $ hg debugobsolete `hg id --debug -i -r 30` `hg id --debug -i -r .`
+  $ hg debugobsolete `hg id -T "{node}" -r 30` `hg id -T "{node}" -r .`
   1 new obsolescence markers
   obsoleted 1 changesets
   $ hg bisect
--- a/tests/test-censor.t	Tue Oct 01 21:40:20 2024 -0400
+++ b/tests/test-censor.t	Wed Oct 02 11:43:22 2024 -0400
@@ -35,26 +35,26 @@
   $ echo 'Tainted file' > target
   $ echo 'Passwords: hunter2' >> target
   $ hg ci -m taint target
-  $ C1=`hg id --debug -i`
+  $ C1=`hg id -r . -T "{node}"`
 
   $ echo 'hunter3' >> target
   $ echo 'Normal file v2' > bystander
   $ hg ci -m moretaint target bystander
-  $ C2=`hg id --debug -i`
+  $ C2=`hg id -r . -T "{node}"`
 
 Add a new sanitized versions to correct our mistake. Name the first head H1,
 the second head H2, and so on
 
   $ echo 'Tainted file is now sanitized' > target
   $ hg ci -m sanitized target
-  $ H1=`hg id --debug -i`
+  $ H1=`hg id -r . -T "{node}"`
 
   $ hg update -r $C2
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo 'Tainted file now super sanitized' > target
   $ hg ci -m 'super sanitized' target
   created new head
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
 
 Verify target contents before censorship at each revision
 
@@ -239,7 +239,7 @@
   $ C3=$H1
   $ echo 'advanced head H1' > target
   $ hg ci -m 'advance head H1' target
-  $ H1=`hg id --debug -i`
+  $ H1=`hg id -r . -T "{node}"`
   $ hg --config extensions.censor= censor -r $C3 target
   checking for the censored content in 2 heads
   checking for the censored content in the working directory
@@ -262,7 +262,7 @@
   [255]
   $ echo 'twiddling thumbs' > bystander
   $ hg ci -m 'bystander commit'
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ hg --config extensions.censor= censor -r "$H2^" target
   checking for the censored content in 2 heads
   abort: cannot censor file in heads (efbe78065929)
@@ -273,7 +273,7 @@
 
   $ echo 'seriously no passwords' > target
   $ hg ci -m 'extend second head arbitrarily' target
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ hg update -r "$H2^"
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --config extensions.censor= censor -r . target
@@ -290,7 +290,7 @@
   $ C4=$H2
   $ hg rm target
   $ hg ci -m 'delete target so it may be censored'
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ hg --config extensions.censor= censor -r $C4 target
   checking for the censored content in 2 heads
   checking for the censored content in the working directory
@@ -301,7 +301,7 @@
   $ echo 'fresh start' > target
   $ hg add target
   $ hg ci -m reincarnated target
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ hg cat -r $H2 target | head -n 10
   fresh start
   $ hg cat -r "$H2^" target | head -n 10
@@ -318,11 +318,11 @@
           8         ??? yes file      target (glob) (revlogv1 !)
   $ $TESTDIR/seq.py 4000 | $TESTDIR/sha256line.py > target
   $ hg ci -m 'add 100k passwords'
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ C5=$H2
   $ hg revert -r "$H2^" target
   $ hg ci -m 'cleaned 100k passwords'
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ hg debugrevlogstats | grep target
   rev-count   data-size inl type      target 
          10      ?????? no  file      target (glob)
@@ -399,11 +399,11 @@
   $ echo 'Passwords: hunter2hunter2' > target
   $ hg ci -m 're-add password from clone' target
   created new head
-  $ H3=`hg id --debug -i`
+  $ H3=`hg id -r . -T "{node}"`
   $ REV=$H3
   $ echo 'Re-sanitized; nothing to see here' > target
   $ hg ci -m 're-sanitized' target
-  $ H2=`hg id --debug -i`
+  $ H2=`hg id -r . -T "{node}"`
   $ CLEANREV=$H2
   $ hg cat -r $REV target | head -n 10
   Passwords: hunter2hunter2
@@ -556,17 +556,17 @@
   $ echo root > target
   $ hg add target
   $ hg commit -m root
-  $ B0=`hg id --debug -i`
+  $ B0=`hg id -r . -T "{node}"`
   $ for x in `"$PYTHON" $TESTDIR/seq.py 0 50000`
   > do
   >   echo "Password: hunter$x" >> target
   > done
   $ hg ci -m 'write a long file'
-  $ B1=`hg id --debug -i`
+  $ B1=`hg id -r . -T "{node}"`
   $ echo 'small change (should create a delta)' >> target
   $ hg ci -m 'create a delta over the password'
 (should show that the last revision is a delta, not a snapshot)
-  $ B2=`hg id --debug -i`
+  $ B2=`hg id -r . -T "{node}"`
 
 Make sure the last revision is a delta against the revision we will censor
 
--- a/tests/test-convert-splicemap.t	Tue Oct 01 21:40:20 2024 -0400
+++ b/tests/test-convert-splicemap.t	Wed Oct 02 11:43:22 2024 -0400
@@ -15,11 +15,11 @@
   $ echo a >> a
   $ hg ci -Am addb
   adding b
-  $ PARENTID1=`hg id --debug -i`
+  $ PARENTID1=`hg id -r . -T "{node}"`
   $ echo c > c
   $ hg ci -Am addc
   adding c
-  $ PARENTID2=`hg id --debug -i`
+  $ PARENTID2=`hg id -r . -T "{node}"`
   $ cd ..
   $ glog -R repo1
   @  2:e55c719b85b6 "addc" files: c
@@ -38,10 +38,10 @@
   adding d
   $ INVALIDID1=afd12345af
   $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86
-  $ CHILDID1=`hg id --debug -i`
+  $ CHILDID1=`hg id -r . -T "{node}"`
   $ echo d >> d
   $ hg ci -Am changed
-  $ CHILDID2=`hg id --debug -i`
+  $ CHILDID2=`hg id -r . -T "{node}"`
   $ echo e > e
   $ hg ci -Am adde
   adding e
--- a/tests/test-phases.t	Tue Oct 01 21:40:20 2024 -0400
+++ b/tests/test-phases.t	Wed Oct 02 11:43:22 2024 -0400
@@ -766,7 +766,7 @@
   > EOF
 
 (making a changeset hidden; H in that case)
-  $ hg debugobsolete `hg id --debug -r 5`
+  $ hg debugobsolete `hg id -T "{node}" -r 5`
   1 new obsolescence markers
   obsoleted 1 changesets
 
@@ -1018,7 +1018,7 @@
 The hidden commit is an orphan but doesn't show up without --hidden
 And internal changesets are not considered for unstability.
 
-  $ hg debugobsolete `hg id --debug -ir 0`
+  $ hg debugobsolete `hg id -T "{node}" -r 0`
   1 new obsolescence markers
   obsoleted 1 changesets
   $ hg --hidden log -G -r '(0::) - 0'