diff tests/test-check-commit.t @ 6919:6859ed744625 mercurial-5.1

test-compat: merge mercurial-5.2 into mercurial-5.1
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 17:55:54 +0400
parents cdf929e69cde 03fe10eb9f2d
children
line wrap: on
line diff
--- a/tests/test-check-commit.t	Thu Jun 27 01:07:01 2024 +0400
+++ b/tests/test-check-commit.t	Fri Oct 25 17:55:54 2024 +0400
@@ -5,25 +5,33 @@
 
   $ exit 80
 
+  $ . "$RUNTESTDIR/helpers-testrepo.sh"
+
 Enable obsolescence to avoid the warning issue when obsmarkers are found
 
   $ cat << EOF >> $HGRCPATH
   > [experimental]
   > evolution = all
-  > [diff]
-  > git = yes
   > EOF
 
 Go back in the hg repo
 
   $ cd $TESTDIR/..
 
-  $ for node in `hg log --rev 'not public() and ::. and not desc("# no-check-commit")' --template '{node|short}\n'`; do
-  >    hg export $node | ${RUNTESTDIR}/../contrib/check-commit > ${TESTTMP}/check-commit.out
-  >    if [ $? -ne 0 ]; then
-  >        echo "Revision $node does not comply with rules"
-  >        echo '------------------------------------------------------'
-  >        cat ${TESTTMP}/check-commit.out
-  >        echo
-  >   fi
-  > done
+  $ REVSET='not public() and ::. and not desc("# no-check-commit")'
+
+  $ mkdir "$TESTTMP/p"
+  $ REVS=`testrepohg log -r "$REVSET" -T.`
+  $ if [ -n "$REVS" ] ; then
+  >   testrepohg export --git -o "$TESTTMP/p/%n-%h" -r "$REVSET"
+  >   for f in `ls "$TESTTMP/p"`; do
+  >      "$RUNTESTDIR/../contrib/check-commit" < "$TESTTMP/p/$f" > "$TESTTMP/check-commit.out"
+  >      if [ $? -ne 0 ]; then
+  >          node="${f##*-}"
+  >          echo "Revision $node does not comply with rules"
+  >          echo '------------------------------------------------------'
+  >          cat ${TESTTMP}/check-commit.out
+  >          echo
+  >     fi
+  >   done
+  > fi