sapling/tests/test-treestate-downgrade.t
Durham Goode ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00

49 lines
1.2 KiB
Perl

#require fsmonitor
$ setconfig extensions.treemanifest=!
Fsmonitor is required for treestate to track untracked files.
Nonnormalset, otherparentset, copymap might have reference to untracked files.
They should be filtered out when downgrading from treestate to treedirstate.
Create a treestate repo
$ hg init repo1 --config format.dirstate=2
$ cd repo1
$ touch x
Write the untracked file to treestate
$ hg status
? x
$ hg debugtree
dirstate v2 (* 1 files tracked) (glob)
Downgrade to treedirstate
$ hg debugtree v1
Check nonnormalset
$ hg debugshell --command 'print(repr(sorted(repo.dirstate._map.nonnormalset)))'
[]
Check downgrade with "hg pull"
$ hg init $TESTTMP/repo2 --config format.dirstate=2
$ cd $TESTTMP/repo2
$ touch x
$ hg ci -m init -A x -q
$ hg init $TESTTMP/repo3 --config format.dirstate=2
$ cd $TESTTMP/repo3
$ hg pull ../repo2 --config format.dirstate=1 --config treestate.automigrate=true --config extensions.rebase= --rebase -q
fsmonitor state is invalidated after upgrade
$ ls .hg/fsmonitor.state
.hg/fsmonitor.state
$ hg pull ../repo2 --config format.dirstate=2 --config treestate.automigrate=true --config extensions.rebase= --rebase -q
$ [ -f .hg/fsmonitor.state ]
[1]