Despite the size, this is pretty straightforward.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Despite the size, this is pretty straightforward.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | tests/test-fncache.t (153 lines) |
Status | Author | Revision | |
---|---|---|---|
Abandoned | indygreg | ||
Abandoned | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
Init repo1: | Init repo1: | ||||
$ hg init repo1 | $ hg init repo1 | ||||
$ cd repo1 | $ cd repo1 | ||||
$ echo "some text" > a | $ echo "some text" > a | ||||
$ hg add | $ hg add | ||||
adding a | adding a | ||||
$ hg ci -m first | $ hg ci -m first | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/a.i | data/a.i (reporevlogstore !) | ||||
data/a/f62022d3d590043fa311a6f49c238b13c9d12709 (reposimplestore !) | |||||
data/a/index (reposimplestore !) | |||||
Testing a.i/b: | Testing a.i/b: | ||||
$ mkdir a.i | $ mkdir a.i | ||||
$ echo "some other text" > a.i/b | $ echo "some other text" > a.i/b | ||||
$ hg add | $ hg add | ||||
adding a.i/b | adding a.i/b | ||||
$ hg ci -m second | $ hg ci -m second | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/a.i | data/a.i (reporevlogstore !) | ||||
data/a.i.hg/b.i | data/a.i.hg/b.i (reporevlogstore !) | ||||
data/a.i.hg/b/87213410d500fe45662db2a54f759a46c27192bb (reposimplestore !) | |||||
data/a.i.hg/b/index (reposimplestore !) | |||||
data/a/f62022d3d590043fa311a6f49c238b13c9d12709 (reposimplestore !) | |||||
data/a/index (reposimplestore !) | |||||
Testing a.i.hg/c: | Testing a.i.hg/c: | ||||
$ mkdir a.i.hg | $ mkdir a.i.hg | ||||
$ echo "yet another text" > a.i.hg/c | $ echo "yet another text" > a.i.hg/c | ||||
$ hg add | $ hg add | ||||
adding a.i.hg/c | adding a.i.hg/c | ||||
$ hg ci -m third | $ hg ci -m third | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/a.i | data/a.i (reporevlogstore !) | ||||
data/a.i.hg.hg/c.i | data/a.i.hg.hg/c.i (reporevlogstore !) | ||||
data/a.i.hg/b.i | data/a.i.hg/b.i (reporevlogstore !) | ||||
data/a.i.hg.hg/c/d81723aa78f2dd2d77884d165313984fcc9e5893 (reposimplestore !) | |||||
data/a.i.hg.hg/c/index (reposimplestore !) | |||||
data/a.i.hg/b/87213410d500fe45662db2a54f759a46c27192bb (reposimplestore !) | |||||
data/a.i.hg/b/index (reposimplestore !) | |||||
data/a/f62022d3d590043fa311a6f49c238b13c9d12709 (reposimplestore !) | |||||
data/a/index (reposimplestore !) | |||||
Testing verify: | Testing verify: | ||||
$ hg verify | $ hg verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
3 files, 3 changesets, 3 total revisions | 3 files, 3 changesets, 3 total revisions | ||||
$ rm .hg/store/fncache | $ rm .hg/store/fncache | ||||
$ hg verify | $ hg verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
warning: revlog 'data/a.i' not in fncache! | warning: revlog 'data/a.i' not in fncache! (reporevlogstore !) | ||||
warning: revlog 'data/a.i.hg/c.i' not in fncache! | warning: revlog 'data/a.i.hg/c.i' not in fncache! (reporevlogstore !) | ||||
warning: revlog 'data/a.i/b.i' not in fncache! | warning: revlog 'data/a.i/b.i' not in fncache! (reporevlogstore !) | ||||
warning: revlog 'data/a/f62022d3d590043fa311a6f49c238b13c9d12709' not in fncache! (reposimplestore !) | |||||
warning: revlog 'data/a/index' not in fncache! (reposimplestore !) | |||||
warning: revlog 'data/a.i.hg/c/index' not in fncache! (reposimplestore !) | |||||
warning: revlog 'data/a.i.hg/c/d81723aa78f2dd2d77884d165313984fcc9e5893' not in fncache! (reposimplestore !) | |||||
warning: revlog 'data/a.i/b/87213410d500fe45662db2a54f759a46c27192bb' not in fncache! (reposimplestore !) | |||||
warning: revlog 'data/a.i/b/index' not in fncache! (reposimplestore !) | |||||
3 files, 3 changesets, 3 total revisions | 3 files, 3 changesets, 3 total revisions | ||||
3 warnings encountered! | 3 warnings encountered! (reporevlogstore !) | ||||
6 warnings encountered! (reposimplestore !) | |||||
hint: run "hg debugrebuildfncache" to recover from corrupt fncache | hint: run "hg debugrebuildfncache" to recover from corrupt fncache | ||||
Follow the hint to make sure it works | Follow the hint to make sure it works | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
adding data/a.i | adding data/a.i (reporevlogstore !) | ||||
adding data/a.i.hg/c.i | adding data/a.i.hg/c.i (reporevlogstore !) | ||||
adding data/a.i/b.i | adding data/a.i/b.i (reporevlogstore !) | ||||
3 items added, 0 removed from fncache | adding data/a.i.hg/c/d81723aa78f2dd2d77884d165313984fcc9e5893 (reposimplestore !) | ||||
adding data/a.i.hg/c/index (reposimplestore !) | |||||
adding data/a.i/b/87213410d500fe45662db2a54f759a46c27192bb (reposimplestore !) | |||||
adding data/a.i/b/index (reposimplestore !) | |||||
adding data/a/f62022d3d590043fa311a6f49c238b13c9d12709 (reposimplestore !) | |||||
adding data/a/index (reposimplestore !) | |||||
3 items added, 0 removed from fncache (reporevlogstore !) | |||||
6 items added, 0 removed from fncache (reposimplestore !) | |||||
$ hg verify | $ hg verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
3 files, 3 changesets, 3 total revisions | 3 files, 3 changesets, 3 total revisions | ||||
.hg/00changelog.i | .hg/00changelog.i | ||||
.hg/00manifest.i | .hg/00manifest.i | ||||
.hg/cache | .hg/cache | ||||
.hg/cache/branch2-served | .hg/cache/branch2-served | ||||
.hg/cache/rbc-names-v1 | .hg/cache/rbc-names-v1 | ||||
.hg/cache/rbc-revs-v1 | .hg/cache/rbc-revs-v1 | ||||
.hg/data | .hg/data | ||||
.hg/data/tst.d.hg | .hg/data/tst.d.hg | ||||
.hg/data/tst.d.hg/foo.i | .hg/data/tst.d.hg/foo.i (reporevlogstore !) | ||||
.hg/data/tst.d.hg/foo (reposimplestore !) | |||||
.hg/data/tst.d.hg/foo/2ed2a3912a0b24502043eae84ee4b279c18b90dd (reposimplestore !) | |||||
.hg/data/tst.d.hg/foo/index (reposimplestore !) | |||||
.hg/dirstate | .hg/dirstate | ||||
.hg/fsmonitor.state (fsmonitor !) | .hg/fsmonitor.state (fsmonitor !) | ||||
.hg/last-message.txt | .hg/last-message.txt | ||||
.hg/phaseroots | .hg/phaseroots | ||||
.hg/requires | .hg/requires | ||||
.hg/undo | .hg/undo | ||||
.hg/undo.backup.dirstate | .hg/undo.backup.dirstate | ||||
.hg/undo.backupfiles | .hg/undo.backupfiles | ||||
.hg/fsmonitor.state (fsmonitor !) | .hg/fsmonitor.state (fsmonitor !) | ||||
.hg/last-message.txt | .hg/last-message.txt | ||||
.hg/requires | .hg/requires | ||||
.hg/store | .hg/store | ||||
.hg/store/00changelog.i | .hg/store/00changelog.i | ||||
.hg/store/00manifest.i | .hg/store/00manifest.i | ||||
.hg/store/data | .hg/store/data | ||||
.hg/store/data/tst.d.hg | .hg/store/data/tst.d.hg | ||||
.hg/store/data/tst.d.hg/_foo.i | .hg/store/data/tst.d.hg/_foo.i (reporevlogstore !) | ||||
.hg/store/data/tst.d.hg/_foo (reposimplestore !) | |||||
.hg/store/data/tst.d.hg/_foo/2ed2a3912a0b24502043eae84ee4b279c18b90dd (reposimplestore !) | |||||
.hg/store/data/tst.d.hg/_foo/index (reposimplestore !) | |||||
.hg/store/phaseroots | .hg/store/phaseroots | ||||
.hg/store/undo | .hg/store/undo | ||||
.hg/store/undo.backupfiles | .hg/store/undo.backupfiles | ||||
.hg/store/undo.phaseroots | .hg/store/undo.phaseroots | ||||
.hg/undo.backup.dirstate | .hg/undo.backup.dirstate | ||||
.hg/undo.bookmarks | .hg/undo.bookmarks | ||||
.hg/undo.branch | .hg/undo.branch | ||||
.hg/undo.desc | .hg/undo.desc | ||||
> +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider | > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider | ||||
> @@ -0,0 +1,1 @@ | > @@ -0,0 +1,1 @@ | ||||
> +foo | > +foo | ||||
> EOF | > EOF | ||||
$ find .hg/store -name *.i | sort | $ find .hg/store -name *.i | sort | ||||
.hg/store/00changelog.i | .hg/store/00changelog.i | ||||
.hg/store/00manifest.i | .hg/store/00manifest.i | ||||
.hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i | .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i (reporevlogstore !) | ||||
.hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i | .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i (reporevlogstore !) | ||||
.hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i | .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i (reporevlogstore !) | ||||
.hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i | .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i (reporevlogstore !) | ||||
.hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i | .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i (reporevlogstore !) | ||||
$ cd .. | $ cd .. | ||||
Aborting lock does not prevent fncache writes | Aborting lock does not prevent fncache writes | ||||
$ cat > exceptionext.py <<EOF | $ cat > exceptionext.py <<EOF | ||||
> from __future__ import absolute_import | > from __future__ import absolute_import | ||||
> import os | > import os | ||||
$ extpath=`pwd`/exceptionext.py | $ extpath=`pwd`/exceptionext.py | ||||
$ hg init fncachetxn | $ hg init fncachetxn | ||||
$ cd fncachetxn | $ cd fncachetxn | ||||
$ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc | $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc | ||||
$ touch y | $ touch y | ||||
$ hg ci -qAm y | $ hg ci -qAm y | ||||
abort: forced lock failure | abort: forced lock failure | ||||
[255] | [255] | ||||
$ cat .hg/store/fncache | $ cat .hg/store/fncache | sort | ||||
data/y.i | data/y.i (reporevlogstore !) | ||||
data/y/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !) | |||||
data/y/index (reposimplestore !) | |||||
Aborting transaction prevents fncache change | Aborting transaction prevents fncache change | ||||
$ cat > ../exceptionext.py <<EOF | $ cat > ../exceptionext.py <<EOF | ||||
> from __future__ import absolute_import | > from __future__ import absolute_import | ||||
> import os | > import os | ||||
> from mercurial import commands, error, extensions, localrepo | > from mercurial import commands, error, extensions, localrepo | ||||
> | > | ||||
$ rm -Rf "`dirname $extpath`/__pycache__" | $ rm -Rf "`dirname $extpath`/__pycache__" | ||||
$ touch z | $ touch z | ||||
$ hg ci -qAm z | $ hg ci -qAm z | ||||
transaction abort! | transaction abort! | ||||
rollback completed | rollback completed | ||||
abort: forced transaction failure | abort: forced transaction failure | ||||
[255] | [255] | ||||
$ cat .hg/store/fncache | $ cat .hg/store/fncache | sort | ||||
data/y.i | data/y.i (reporevlogstore !) | ||||
data/y/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !) | |||||
data/y/index (reposimplestore !) | |||||
Aborted transactions can be recovered later | Aborted transactions can be recovered later | ||||
$ cat > ../exceptionext.py <<EOF | $ cat > ../exceptionext.py <<EOF | ||||
> from __future__ import absolute_import | > from __future__ import absolute_import | ||||
> import os | > import os | ||||
> from mercurial import ( | > from mercurial import ( | ||||
> commands, | > commands, | ||||
$ rm -f "${extpath}c" | $ rm -f "${extpath}c" | ||||
$ rm -Rf "`dirname $extpath`/__pycache__" | $ rm -Rf "`dirname $extpath`/__pycache__" | ||||
$ hg up -q 1 | $ hg up -q 1 | ||||
$ touch z | $ touch z | ||||
$ hg ci -qAm z 2>/dev/null | $ hg ci -qAm z 2>/dev/null | ||||
[255] | [255] | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/y.i | data/y.i (reporevlogstore !) | ||||
data/z.i | data/z.i (reporevlogstore !) | ||||
data/y/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !) | |||||
data/y/index (reposimplestore !) | |||||
$ hg recover | $ hg recover | ||||
rolling back interrupted transaction | rolling back interrupted transaction | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
1 files, 1 changesets, 1 total revisions | 1 files, 1 changesets, 1 total revisions | ||||
$ cat .hg/store/fncache | $ cat .hg/store/fncache | sort | ||||
data/y.i | data/y.i (reporevlogstore !) | ||||
data/y/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !) | |||||
data/y/index (reposimplestore !) | |||||
$ cd .. | $ cd .. | ||||
debugrebuildfncache does nothing unless repo has fncache requirement | debugrebuildfncache does nothing unless repo has fncache requirement | ||||
$ hg --config format.usefncache=false init nofncache | $ hg --config format.usefncache=false init nofncache | ||||
$ cd nofncache | $ cd nofncache | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
$ cd repo | $ cd repo | ||||
$ echo initial > foo | $ echo initial > foo | ||||
$ echo initial > .bar | $ echo initial > .bar | ||||
$ hg commit -A -m initial | $ hg commit -A -m initial | ||||
adding .bar | adding .bar | ||||
adding foo | adding foo | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/.bar.i | data/.bar.i (reporevlogstore !) | ||||
data/foo.i | data/foo.i (reporevlogstore !) | ||||
data/.bar/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | |||||
data/.bar/index (reposimplestore !) | |||||
data/foo/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | |||||
data/foo/index (reposimplestore !) | |||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
fncache already up to date | fncache already up to date | ||||
debugrebuildfncache restores deleted fncache file | debugrebuildfncache restores deleted fncache file | ||||
$ rm -f .hg/store/fncache | $ rm -f .hg/store/fncache | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
adding data/.bar.i | adding data/.bar.i (reporevlogstore !) | ||||
adding data/foo.i | adding data/foo.i (reporevlogstore !) | ||||
2 items added, 0 removed from fncache | adding data/.bar/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | ||||
adding data/.bar/index (reposimplestore !) | |||||
adding data/foo/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | |||||
adding data/foo/index (reposimplestore !) | |||||
2 items added, 0 removed from fncache (reporevlogstore !) | |||||
4 items added, 0 removed from fncache (reposimplestore !) | |||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/.bar.i | data/.bar.i (reporevlogstore !) | ||||
data/foo.i | data/foo.i (reporevlogstore !) | ||||
data/.bar/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | |||||
data/.bar/index (reposimplestore !) | |||||
data/foo/bb212e613448bd83ecb63be18e3e59f509e15664 (reposimplestore !) | |||||
data/foo/index (reposimplestore !) | |||||
Rebuild after rebuild should no-op | Rebuild after rebuild should no-op | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
fncache already up to date | fncache already up to date | ||||
A single missing file should get restored, an extra file should be removed | A single missing file should get restored, an extra file should be removed | ||||
#if reporevlogstore | |||||
$ cat > .hg/store/fncache << EOF | $ cat > .hg/store/fncache << EOF | ||||
> data/foo.i | > data/foo.i | ||||
> data/bad-entry.i | > data/bad-entry.i | ||||
> EOF | > EOF | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
removing data/bad-entry.i | removing data/bad-entry.i | ||||
adding data/.bar.i | adding data/.bar.i | ||||
1 items added, 1 removed from fncache | 1 items added, 1 removed from fncache | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/.bar.i | data/.bar.i | ||||
data/foo.i | data/foo.i | ||||
#endif | |||||
#if reposimplestore | |||||
$ cat > .hg/store/fncache << EOF | |||||
> data/.bar/index | |||||
> data/.bar/bb212e613448bd83ecb63be18e3e59f509e15664 | |||||
> data/bad-entry | |||||
> EOF | |||||
$ hg debugrebuildfncache | |||||
removing data/bad-entry | |||||
adding data/foo/bb212e613448bd83ecb63be18e3e59f509e15664 | |||||
adding data/foo/index | |||||
2 items added, 1 removed from fncache | |||||
$ cat .hg/store/fncache | sort | |||||
data/.bar/bb212e613448bd83ecb63be18e3e59f509e15664 | |||||
data/.bar/index | |||||
data/foo/bb212e613448bd83ecb63be18e3e59f509e15664 | |||||
data/foo/index | |||||
#endif | |||||
$ cd .. | $ cd .. | ||||
Try a simple variation without dotencode to ensure fncache is ignorant of encoding | Try a simple variation without dotencode to ensure fncache is ignorant of encoding | ||||
#if reporevlogstore | |||||
$ hg --config format.dotencode=false init nodotencode | $ hg --config format.dotencode=false init nodotencode | ||||
$ cd nodotencode | $ cd nodotencode | ||||
$ echo initial > foo | $ echo initial > foo | ||||
$ echo initial > .bar | $ echo initial > .bar | ||||
$ hg commit -A -m initial | $ hg commit -A -m initial | ||||
adding .bar | adding .bar | ||||
adding foo | adding foo | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/.bar.i | data/.bar.i | ||||
data/foo.i | data/foo.i | ||||
$ rm .hg/store/fncache | $ rm .hg/store/fncache | ||||
$ hg debugrebuildfncache | $ hg debugrebuildfncache | ||||
adding data/.bar.i | adding data/.bar.i | ||||
adding data/foo.i | adding data/foo.i | ||||
2 items added, 0 removed from fncache | 2 items added, 0 removed from fncache | ||||
$ cat .hg/store/fncache | sort | $ cat .hg/store/fncache | sort | ||||
data/.bar.i | data/.bar.i | ||||
data/foo.i | data/foo.i | ||||
#endif |