sapling/tests/test-dirstate-completion.t
Mark Thomas 5351ce3851 treestate: implement debugpathcomplete fastpath
Summary:
Treestate is missing its pathcomplete fastpath.  This makes tab completion for
filenames slow on large repositories.

The Rust implementation already supported the feature, it just needs to be
called from the debugpathcomplete commands.

Reviewed By: quark-zju

Differential Revision: D10259633

fbshipit-source-id: f918d55c5bcd21805615710c0eb6302f8ea4b15c
2018-10-10 06:49:05 -07:00

65 lines
1.1 KiB
Perl

#testcases v0 v1 v2
#if v0
$ setconfig format.dirstate=0
#endif
#if v1
$ setconfig format.dirstate=1
#endif
#if v2
$ setconfig format.dirstate=2
#endif
$ hg init repo
$ cd repo
$ echo file1 > file1
$ echo file2 > file2
$ mkdir -p dira dirb
$ echo file3 > dira/file3
$ echo file4 > dirb/file4
$ echo file5 > dirb/file5
$ hg ci -q -Am base
Test debugpathcomplete with just normal files
$ hg debugpathcomplete f
file1
file2
$ hg debugpathcomplete -f d
dira/file3
dirb/file4
dirb/file5
Test debugpathcomplete with removed files
$ hg rm dirb/file5
$ hg debugpathcomplete -r d
dirb
$ hg debugpathcomplete -fr d
dirb/file5
$ hg rm dirb/file4
$ hg debugpathcomplete -n d
dira
Test debugpathcomplete with merges
$ cd ..
$ newrepo
$ drawdag << EOS
> D # A/filenormal = 1
> / \ # B/filep1 = 1
> B C # B/filemerged = 1
> \ / # C/filep2 = 1
> A # C/filemerged = 2
> # D/filemerged = 12
> EOS
$ hg up -q $D
$ hg debugpathcomplete f
filemerged
filenormal
filep1
filep2