tests: fold narrow treemanifest tests into main test file using testcases
These tests predate the testcases functionality in run-tests.py, so it
was never done in narrowhg.
Differential Revision: https://phab.mercurial-scm.org/D1979
--- a/tests/test-narrow-commit-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-narrow-commit.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
-
- --- */tests/test-narrow-commit.t (glob)
- +++ */tests/test-narrow-commit.t.err (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- created new head
- $ hg files -r .
- inside/f1
- - outside/f1
- + outside/
- Some filesystems (notably FAT/exFAT only store timestamps with 2
- seconds of precision, so by sleeping for 3 seconds, we can ensure that
- the timestamps of files stored by dirstate will appear older than the
-
- ERROR: test-narrow-commit.t output changed
- !
- Failed test-narrow-commit.t: output changed
- # Ran 1 tests, 0 skipped, 1 failed.
- python hash seed: * (glob)
--- a/tests/test-narrow-commit.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow-commit.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,5 +1,14 @@
+#testcases flat tree
+
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
create full repo
$ hg init master
@@ -67,7 +76,8 @@
created new head
$ hg files -r .
inside/f1
- outside/f1
+ outside/f1 (flat !)
+ outside/ (tree !)
Some filesystems (notably FAT/exFAT only store timestamps with 2
seconds of precision, so by sleeping for 3 seconds, we can ensure that
the timestamps of files stored by dirstate will appear older than the
--- a/tests/test-narrow-merge-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-narrow-merge.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
-
- --- */tests/test-narrow-merge.t (glob)
- +++ */tests/test-narrow-merge.t.err (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
-
- $ hg update -q 'desc("modify inside/f1")'
- $ hg merge 'desc("modify outside/f1")'
- - abort: merge affects file 'outside/f1' outside narrow, which is not yet supported
- + abort: merge affects file 'outside/' outside narrow, which is not yet supported
- (merging in the other direction may work)
- [255]
-
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
-
- $ hg update -q 'desc("modify outside/f1")'
- $ hg merge 'desc("conflicting outside/f1")'
- - abort: conflict in file 'outside/f1' is outside narrow clone
- + abort: conflict in file 'outside/' is outside narrow clone
- [255]
-
- ERROR: test-narrow-merge.t output changed
- !
- Failed test-narrow-merge.t: output changed
- # Ran 1 tests, 0 skipped, 1 failed.
- python hash seed: * (glob)
--- a/tests/test-narrow-merge.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow-merge.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,6 +1,14 @@
+#testcases flat tree
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
create full repo
$ hg init master
@@ -76,7 +84,8 @@
$ hg update -q 'desc("modify inside/f1")'
$ hg merge 'desc("modify outside/f1")'
- abort: merge affects file 'outside/f1' outside narrow, which is not yet supported
+ abort: merge affects file 'outside/f1' outside narrow, which is not yet supported (flat !)
+ abort: merge affects file 'outside/' outside narrow, which is not yet supported (tree !)
(merging in the other direction may work)
[255]
@@ -90,5 +99,6 @@
$ hg update -q 'desc("modify outside/f1")'
$ hg merge 'desc("conflicting outside/f1")'
- abort: conflict in file 'outside/f1' is outside narrow clone
+ abort: conflict in file 'outside/f1' is outside narrow clone (flat !)
+ abort: conflict in file 'outside/' is outside narrow clone (tree !)
[255]
--- a/tests/test-narrow-patch-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-patch.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
- .
- # Ran 1 tests, 0 skipped, 0 failed.
--- a/tests/test-narrow-patch.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow-patch.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,6 +1,14 @@
+#testcases flat tree
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
create full repo
$ hg init master
--- a/tests/test-narrow-strip-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-narrow-strip.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
-
- --- */test-narrow-strip.t (glob)
- +++ */test-narrow-strip.t.err (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- o 0 initial
-
- $ hg debugdata -m 1
- - inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc)
- - outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc)
- + inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc)
- + outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc)
-
- $ rm -f $TESTTMP/narrow/.hg/strip-backup/*-backup.hg
- $ hg strip .
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
-
- Check that hash of file outside narrow spec got restored
- $ hg debugdata -m 2
- - inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc)
- - outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc)
- + inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc)
- + outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc)
-
- Also verify we can apply the bundle with 'hg pull':
- $ hg co -r 'desc("modify inside")'
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: initial
-
- - changeset: 1:9e48d953700d
- + changeset: 1:3888164bccf0
- user: test
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: modify outside again
-
- - changeset: 2:f505d5e96aa8
- + changeset: 2:40b66f95a209
- tag: tip
- - parent: 0:a99f4d53924d
- + parent: 0:c2a5fabcca3c
- user: test
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: modify inside
-
- ERROR: test-narrow-strip.t output changed
- !
- Failed test-narrow-strip.t: output changed
- # Ran 1 tests, 0 skipped, 1 failed.
- python hash seed: * (glob)
--- a/tests/test-narrow-strip.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow-strip.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,6 +1,14 @@
+#testcases flat tree
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
create full repo
$ hg init master
@@ -71,8 +79,10 @@
o 0 initial
$ hg debugdata -m 1
- inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc)
- outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc)
+ inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !)
+ outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !)
+ inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !)
+ outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !)
$ rm -f $TESTTMP/narrow/.hg/strip-backup/*-backup.hg
$ hg strip .
@@ -94,8 +104,10 @@
Check that hash of file outside narrow spec got restored
$ hg debugdata -m 2
- inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc)
- outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc)
+ inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !)
+ outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !)
+ inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !)
+ outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !)
Also verify we can apply the bundle with 'hg pull':
$ hg co -r 'desc("modify inside")'
@@ -125,14 +137,17 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: initial
- changeset: 1:9e48d953700d
+ changeset: 1:9e48d953700d (flat !)
+ changeset: 1:3888164bccf0 (tree !)
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: modify outside again
- changeset: 2:f505d5e96aa8
+ changeset: 2:f505d5e96aa8 (flat !)
+ changeset: 2:40b66f95a209 (tree !)
tag: tip
- parent: 0:a99f4d53924d
+ parent: 0:a99f4d53924d (flat !)
+ parent: 0:c2a5fabcca3c (tree !)
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: modify inside
--- a/tests/test-narrow-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-narrow-narrow.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
-
- --- /*/tests/test-narrow-narrow.t (glob)
- +++ /*/tests/test-narrow-narrow.t.err (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- * (glob)
- * (glob)
- deleting data/d0/f.i
- + deleting meta/d0/00manifest.i
- $ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
- *: local change to d3 (glob)
- *: add d10/f outsidenarrow (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- looking for local changes to affected paths
- saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
- deleting data/d0/f.i
- + deleting meta/d0/00manifest.i
- Updates off of stripped commit if necessary
- $ hg co -r 'desc("local change to d3")' -q
- $ echo local change >> d6/f
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
- saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
- deleting data/d3/f.i
- + deleting meta/d3/00manifest.i
- $ hg log -T '{desc}\n' -r .
- add d10/f
- Updates to nullid if necessary
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
- saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
- deleting data/d3/f.i
- + deleting meta/d3/00manifest.i
- $ hg id
- 000000000000
- $ cd ..
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- searching for changes
- looking for local changes to affected paths
- deleting data/d0/f.i
- + deleting meta/d0/00manifest.i
- $ hg tracked
- $ hg files
- [1]
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- searching for changes
- looking for local changes to affected paths
- deleting data/d6/f.i
- + deleting meta/d6/00manifest.i
- $ hg tracked
- I path:d0
- I path:d3
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- searching for changes
- looking for local changes to affected paths
- deleting data/d0/f.i
- + deleting meta/d0/00manifest.i
- $ hg tracked
- I path:d3
- I path:d9
-
- ERROR: test-narrow-narrow.t output changed
- !
- Failed test-narrow-narrow.t: output changed
- # Ran 1 tests, 0 skipped, 1 failed.
- python hash seed: * (glob)
--- a/tests/test-narrow-widen-tree.t Mon Jan 29 18:16:23 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
- $ cd $TESTDIR && python $RUNTESTDIR/run-tests.py \
- > --extra-config-opt experimental.treemanifest=1 test-narrow-widen.t 2>&1 | \
- > grep -v 'unexpected mercurial lib' | egrep -v '\(expected'
-
- --- */test-narrow-widen.t (glob)
- +++ */test-narrow-widen.t.err (glob)
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- $ hg verify
- checking changesets
- checking manifests
- + checking directory manifests
- crosschecking files in changesets and manifests
- checking files
- 4 files, 8 changesets, 4 total revisions
- @@ -\d+,\d+ \+\d+,\d+ @@ (re)
- $ hg verify
- checking changesets
- checking manifests
- + checking directory manifests
- crosschecking files in changesets and manifests
- checking files
- 5 files, 9 changesets, 5 total revisions
-
- ERROR: test-narrow-widen.t output changed
- !
- Failed test-narrow-widen.t: output changed
- # Ran 1 tests, 0 skipped, 1 failed.
- python hash seed: * (glob)
--- a/tests/test-narrow-widen.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow-widen.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,5 +1,13 @@
+#testcases flat tree
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
$ hg init master
$ cd master
$ cat >> .hg/hgrc <<EOF
@@ -232,6 +240,7 @@
$ hg verify
checking changesets
checking manifests
+ checking directory manifests (tree !)
crosschecking files in changesets and manifests
checking files
4 files, 8 changesets, 4 total revisions
@@ -276,6 +285,7 @@
$ hg verify
checking changesets
checking manifests
+ checking directory manifests (tree !)
crosschecking files in changesets and manifests
checking files
5 files, 9 changesets, 5 total revisions
--- a/tests/test-narrow.t Mon Jan 29 18:16:23 2018 -0500
+++ b/tests/test-narrow.t Thu Feb 01 17:19:41 2018 -0500
@@ -1,5 +1,14 @@
+#testcases flat tree
+
$ . "$TESTDIR/narrow-library.sh"
+#if tree
+ $ cat << EOF >> $HGRCPATH
+ > [experimental]
+ > treemanifest = 1
+ > EOF
+#endif
+
$ hg init master
$ cd master
$ cat >> .hg/hgrc <<EOF
@@ -119,6 +128,7 @@
* (glob)
saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
deleting data/d0/f.i
+ deleting meta/d0/00manifest.i (tree !)
$ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
*: local change to d3 (glob)
*: add d10/f outsidenarrow (glob)
@@ -145,6 +155,7 @@
looking for local changes to affected paths
saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
deleting data/d0/f.i
+ deleting meta/d0/00manifest.i (tree !)
Updates off of stripped commit if necessary
$ hg co -r 'desc("local change to d3")' -q
$ echo local change >> d6/f
@@ -159,6 +170,7 @@
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
deleting data/d3/f.i
+ deleting meta/d3/00manifest.i (tree !)
$ hg log -T '{desc}\n' -r .
add d10/f
Updates to nullid if necessary
@@ -178,6 +190,7 @@
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
deleting data/d3/f.i
+ deleting meta/d3/00manifest.i (tree !)
$ hg id
000000000000
$ cd ..
@@ -197,6 +210,7 @@
searching for changes
looking for local changes to affected paths
deleting data/d0/f.i
+ deleting meta/d0/00manifest.i (tree !)
$ hg tracked
$ hg files
[1]
@@ -252,6 +266,7 @@
searching for changes
looking for local changes to affected paths
deleting data/d6/f.i
+ deleting meta/d6/00manifest.i (tree !)
$ hg tracked
I path:d0
I path:d3
@@ -289,6 +304,7 @@
searching for changes
looking for local changes to affected paths
deleting data/d0/f.i
+ deleting meta/d0/00manifest.i (tree !)
$ hg tracked
I path:d3
I path:d9