changeset 48464:5e6542143d40

test: use `hg debugrequires` instead of `cat` in some tests This give the "same" result, while taking in account that the requirement file might be in different location, like what `share-safe` is doing. Differential Revision: https://phab.mercurial-scm.org/D11895
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 08 Dec 2021 05:35:32 +0100
parents 880adb2cd147
children 7964a2dbde12
files tests/test-init.t tests/test-lfconvert.t tests/test-lfs-largefiles.t tests/test-narrow-acl.t tests/test-narrow-clone-no-ellipsis.t tests/test-narrow-clone-stream.t tests/test-narrow-clone.t tests/test-narrow-sparse.t tests/test-remotefilelog-clone-tree.t tests/test-remotefilelog-clone.t tests/test-remotefilelog-log.t tests/test-repo-compengines.t tests/test-revlog-v2.t tests/test-share.t tests/test-sparse-requirement.t tests/test-sqlitestore.t tests/test-treemanifest.t tests/test-upgrade-repo.t
diffstat 18 files changed, 38 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-init.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-init.t	Wed Dec 08 05:35:32 2021 +0100
@@ -9,7 +9,7 @@
   >    if [ -f "$name"/.hg/00changelog.i ]; then
   >    echo 00changelog.i created
   >    fi
-  >    cat "$name"/.hg/requires
+  >    hg debugrequires -R "$name"
   > }
 
 creating 'local'
--- a/tests/test-lfconvert.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-lfconvert.t	Wed Dec 08 05:35:32 2021 +0100
@@ -94,7 +94,7 @@
   1276481102f218c981e0324180bafd9f  sub/maybelarge.dat
 
 "lfconvert" adds 'largefiles' to .hg/requires.
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-lfs-largefiles.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-lfs-largefiles.t	Wed Dec 08 05:35:32 2021 +0100
@@ -288,7 +288,7 @@
 
 The requirement is added to the destination repo.
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-narrow-acl.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-narrow-acl.t	Wed Dec 08 05:35:32 2021 +0100
@@ -34,7 +34,7 @@
   f2
 
 Requirements should contain narrowhg
-  $ cat narrowclone1/.hg/requires | grep narrowhg
+  $ hg debugrequires -R narrowclone1 | grep narrowhg
   narrowhg-experimental
 
 NarrowHG should track f1 and f2
--- a/tests/test-narrow-clone-no-ellipsis.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-narrow-clone-no-ellipsis.t	Wed Dec 08 05:35:32 2021 +0100
@@ -22,7 +22,7 @@
   added 40 changesets with 1 changes to 1 files
   new changesets *:* (glob)
   $ cd narrow
-  $ cat .hg/requires | grep -v generaldelta
+  $ hg debugrequires | grep -v generaldelta
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-narrow-clone-stream.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-narrow-clone-stream.t	Wed Dec 08 05:35:32 2021 +0100
@@ -61,7 +61,7 @@
 
 Making sure we have the correct set of requirements
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode (tree !)
   dotencode (flat-fncache !)
   dirstate-v2 (dirstate-v2 !)
--- a/tests/test-narrow-clone.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-narrow-clone.t	Wed Dec 08 05:35:32 2021 +0100
@@ -38,7 +38,7 @@
   added 3 changesets with 1 changes to 1 files
   new changesets *:* (glob)
   $ cd narrow
-  $ cat .hg/requires | grep -v generaldelta
+  $ hg debugrequires | grep -v generaldelta
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-narrow-sparse.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-narrow-sparse.t	Wed Dec 08 05:35:32 2021 +0100
@@ -56,7 +56,7 @@
   $ test -f .hg/sparse
   [1]
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-remotefilelog-clone-tree.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-remotefilelog-clone-tree.t	Wed Dec 08 05:35:32 2021 +0100
@@ -25,7 +25,7 @@
   searching for changes
   no changes found
   $ cd shallow
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
@@ -69,7 +69,7 @@
   searching for changes
   no changes found
   $ cd shallow2
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
@@ -113,7 +113,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ ls shallow3/.hg/store/data
-  $ cat shallow3/.hg/requires
+  $ hg debugrequires -R shallow3/
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
--- a/tests/test-remotefilelog-clone.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-remotefilelog-clone.t	Wed Dec 08 05:35:32 2021 +0100
@@ -22,7 +22,7 @@
   searching for changes
   no changes found
   $ cd shallow
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
@@ -59,7 +59,7 @@
   searching for changes
   no changes found
   $ cd shallow2
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
@@ -111,7 +111,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ ls shallow3/.hg/store/data
-  $ cat shallow3/.hg/requires
+  $ hg debugrequires -R shallow3/
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
--- a/tests/test-remotefilelog-log.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-remotefilelog-log.t	Wed Dec 08 05:35:32 2021 +0100
@@ -25,7 +25,7 @@
   searching for changes
   no changes found
   $ cd shallow
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-remotefilelog-repo-req-1
--- a/tests/test-repo-compengines.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-repo-compengines.t	Wed Dec 08 05:35:32 2021 +0100
@@ -9,7 +9,7 @@
 
   $ hg init default
   $ cd default
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
@@ -59,7 +59,7 @@
   $ touch bar
   $ hg --config format.revlog-compression=none -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
@@ -79,7 +79,7 @@
 
   $ hg --config format.revlog-compression=zstd init zstd
   $ cd zstd
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
@@ -183,7 +183,7 @@
   summary:     some-commit
   
 
-  $ cat none-compression/.hg/requires
+  $ hg debugrequires -R none-compression/
   dotencode
   exp-compression-none
   dirstate-v2 (dirstate-v2 !)
--- a/tests/test-revlog-v2.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-revlog-v2.t	Wed Dec 08 05:35:32 2021 +0100
@@ -20,7 +20,7 @@
 
   $ hg init new-repo
   $ cd new-repo
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-revlogv2.2
--- a/tests/test-share.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-share.t	Wed Dec 08 05:35:32 2021 +0100
@@ -161,7 +161,7 @@
 
   $ cd ..
   $ hg clone -q --stream ssh://user@dummy/`pwd`/repo2 cloned-via-bundle2
-  $ cat ./cloned-via-bundle2/.hg/requires | grep "shared"
+  $ hg -R cloned-via-bundle2 debugrequires | grep "shared"
   [1]
   $ hg id --cwd cloned-via-bundle2 -r tip
   c2e0ac586386 tip
--- a/tests/test-sparse-requirement.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-sparse-requirement.t	Wed Dec 08 05:35:32 2021 +0100
@@ -16,7 +16,7 @@
 
 Enable sparse profile
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
@@ -36,7 +36,7 @@
 
 Requirement for sparse added when sparse is enabled
 
-  $ cat .hg/requires
+  $ hg debugrequires --config extensions.sparse=
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-sparse
@@ -59,7 +59,7 @@
 
   $ hg debugsparse --reset --config extensions.sparse=
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
--- a/tests/test-sqlitestore.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-sqlitestore.t	Wed Dec 08 05:35:32 2021 +0100
@@ -13,7 +13,7 @@
 New repo should not use SQLite by default
 
   $ hg init empty-no-sqlite
-  $ cat empty-no-sqlite/.hg/requires
+  $ hg debugrequires -R empty-no-sqlite
   dotencode
   dirstate-v2 (dirstate-v2 !)
   fncache
@@ -27,7 +27,7 @@
 storage.new-repo-backend=sqlite is recognized
 
   $ hg --config storage.new-repo-backend=sqlite init empty-sqlite
-  $ cat empty-sqlite/.hg/requires
+  $ hg debugrequires -R empty-sqlite
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-sqlite-001
@@ -49,7 +49,7 @@
 Can force compression to zlib
 
   $ hg --config storage.sqlite.compression=zlib init empty-zlib
-  $ cat empty-zlib/.hg/requires
+  $ hg debugrequires -R empty-zlib
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-sqlite-001
@@ -65,7 +65,7 @@
 Can force compression to none
 
   $ hg --config storage.sqlite.compression=none init empty-none
-  $ cat empty-none/.hg/requires
+  $ hg debugrequires -R empty-none
   dotencode
   dirstate-v2 (dirstate-v2 !)
   exp-sqlite-001
--- a/tests/test-treemanifest.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-treemanifest.t	Wed Dec 08 05:35:32 2021 +0100
@@ -5,7 +5,7 @@
 
 Requirements get set on init
 
-  $ grep treemanifest .hg/requires
+  $ hg debugrequires | grep treemanifest
   treemanifest
 
 Without directories, looks like any other repo
@@ -229,7 +229,7 @@
   $ cd repo-mixed
   $ test -d .hg/store/meta
   [1]
-  $ grep treemanifest .hg/requires
+  $ hg debugrequires | grep treemanifest
   treemanifest
 
 Should be possible to push updates from flat to tree manifest repo
@@ -373,7 +373,7 @@
   > [experimental]
   > changegroup3=yes
   > EOF
-  $ grep treemanifest empty-repo/.hg/requires
+  $ hg debugrequires -R empty-repo | grep treemanifest
   [1]
   $ hg push -R repo -r 0 empty-repo
   pushing to empty-repo
@@ -382,13 +382,13 @@
   adding manifests
   adding file changes
   added 1 changesets with 2 changes to 2 files
-  $ grep treemanifest empty-repo/.hg/requires
+  $ hg debugrequires -R empty-repo | grep treemanifest
   treemanifest
 
 Pushing to an empty repo works
 
   $ hg --config experimental.treemanifest=1 init clone
-  $ grep treemanifest clone/.hg/requires
+  $ hg debugrequires -R clone | grep treemanifest
   treemanifest
   $ hg push -R repo clone
   pushing to clone
@@ -397,7 +397,7 @@
   adding manifests
   adding file changes
   added 11 changesets with 15 changes to 10 files (+3 heads)
-  $ grep treemanifest clone/.hg/requires
+  $ hg debugrequires -R clone | grep treemanifest
   treemanifest
   $ hg -R clone verify
   checking changesets
@@ -682,7 +682,7 @@
 No server errors.
   $ cat deeprepo/errors.log
 requires got updated to include treemanifest
-  $ cat deepclone/.hg/requires | grep treemanifest
+  $ hg debugrequires -R deepclone | grep treemanifest
   treemanifest
 Tree manifest revlogs exist.
   $ find deepclone/.hg/store/meta | sort
@@ -730,7 +730,7 @@
   updating to branch default
   8 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd deeprepo-basicstore
-  $ grep store .hg/requires
+  $ hg debugrequires | grep store
   [1]
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
   $ cat hg.pid >> $DAEMON_PIDS
@@ -747,7 +747,7 @@
   updating to branch default
   8 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd deeprepo-encodedstore
-  $ grep fncache .hg/requires
+  $ hg debugrequires | grep fncache
   [1]
   $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
   $ cat hg.pid >> $DAEMON_PIDS
--- a/tests/test-upgrade-repo.t	Wed Dec 08 05:42:01 2021 +0100
+++ b/tests/test-upgrade-repo.t	Wed Dec 08 05:35:32 2021 +0100
@@ -624,7 +624,7 @@
 
 generaldelta added to original requirements files
 
-  $ cat .hg/requires
+  $ hg debugrequires
   dotencode
   fncache
   generaldelta