2015-09-25 23:45:08 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
2017-06-17 04:31:25 +03:00
|
|
|
> perftweaks=$TESTDIR/../hgext3rd/perftweaks.py
|
2015-09-25 23:45:08 +03:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
Test disabling the tag cache
|
|
|
|
$ hg init tagcache
|
|
|
|
$ cd tagcache
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> blackbox=
|
|
|
|
> EOF
|
|
|
|
$ touch a && hg add -q a
|
|
|
|
$ hg commit -qm "Foo"
|
|
|
|
$ hg tag foo
|
|
|
|
|
|
|
|
$ rm -rf .hg/cache .hg/blackbox.log
|
|
|
|
$ hg tags
|
|
|
|
tip 1:2cc13e58bcd8
|
|
|
|
foo 0:be5a2292aa62
|
|
|
|
$ hg blackbox | grep tag
|
|
|
|
*> tags (glob)
|
|
|
|
*> writing * bytes to cache/hgtagsfnodes1 (glob)
|
|
|
|
*> writing .hg/cache/tags2-visible with 1 tags (glob)
|
|
|
|
*> tags exited 0 after * seconds (glob)
|
|
|
|
|
|
|
|
$ rm -rf .hg/cache .hg/blackbox.log
|
|
|
|
$ hg tags --config perftweaks.disabletags=True
|
|
|
|
tip 1:2cc13e58bcd8
|
|
|
|
$ hg blackbox | grep tag
|
|
|
|
*> tags (glob)
|
2017-03-21 19:18:01 +03:00
|
|
|
*> tags --config 'perftweaks.disabletags=True' exited 0 after * seconds (glob)
|
2015-10-07 22:29:56 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
2016-10-25 19:03:15 +03:00
|
|
|
#if osx
|
|
|
|
#else
|
2015-10-07 22:29:56 +03:00
|
|
|
Test disabling the case conflict check (only fails on case sensitive systems)
|
|
|
|
$ hg init casecheck
|
|
|
|
$ cd casecheck
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [perftweaks]
|
|
|
|
> disablecasecheck=True
|
|
|
|
> EOF
|
|
|
|
$ touch a
|
|
|
|
$ hg add a
|
|
|
|
$ hg commit -m a
|
|
|
|
$ touch A
|
|
|
|
$ hg add A
|
|
|
|
warning: possible case-folding collision for A
|
|
|
|
$ hg commit -m A
|
2015-11-09 22:33:38 +03:00
|
|
|
$ cd ..
|
2016-10-25 19:03:15 +03:00
|
|
|
#endif
|
2015-11-09 22:33:38 +03:00
|
|
|
|
|
|
|
Test disabling the branchcache
|
|
|
|
$ hg init branchcache
|
|
|
|
$ cd branchcache
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> blackbox=
|
|
|
|
> strip=
|
|
|
|
> EOF
|
|
|
|
$ echo a > a
|
|
|
|
$ hg commit -Aqm a
|
|
|
|
$ hg blackbox
|
|
|
|
*> commit -Aqm a (glob)
|
|
|
|
*> updated served branch cache in * seconds (glob)
|
|
|
|
*> wrote served branch cache with 1 labels and 1 nodes (glob)
|
|
|
|
*> commit -Aqm a exited 0 after * seconds (glob)
|
2016-02-18 02:31:37 +03:00
|
|
|
*> blackbox (glob)
|
2015-11-09 22:33:38 +03:00
|
|
|
$ hg strip -q -r . -k
|
|
|
|
$ rm .hg/blackbox.log
|
|
|
|
$ rm -rf .hg/cache
|
|
|
|
$ hg commit -Aqm a --config perftweaks.disablebranchcache=True
|
|
|
|
$ hg blackbox
|
|
|
|
*> commit -Aqm a (glob)
|
|
|
|
*> perftweaks updated served branch cache (glob)
|
|
|
|
*> wrote served branch cache with 1 labels and 1 nodes (glob)
|
2017-03-21 19:18:01 +03:00
|
|
|
*> commit -Aqm a --config 'perftweaks.disablebranchcache=True' exited 0 after * seconds (glob)
|
2016-02-18 02:31:37 +03:00
|
|
|
*> blackbox (glob)
|
2015-11-09 22:33:38 +03:00
|
|
|
|
2015-11-25 02:18:39 +03:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test changing the delta heuristic
|
|
|
|
(this isn't a good test, but it executes the code path)
|
|
|
|
$ hg init preferdeltaserver
|
|
|
|
$ cd preferdeltaserver
|
|
|
|
$ touch a && hg commit -Aqm a
|
|
|
|
$ touch b && hg commit -Aqm b
|
|
|
|
$ cd ..
|
|
|
|
$ hg init preferdelta
|
|
|
|
$ cd preferdelta
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [perftweaks]
|
|
|
|
> preferdeltas=True
|
|
|
|
> EOF
|
|
|
|
$ hg pull ../preferdeltaserver
|
|
|
|
pulling from ../preferdeltaserver
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 2 changesets with 2 changes to 2 files
|
|
|
|
(run 'hg update' to get a working copy)
|
2016-04-01 21:49:05 +03:00
|
|
|
|
|
|
|
Test file permissions
|
|
|
|
$ umask 002
|
|
|
|
$ cd ..
|
|
|
|
$ mkdir permcheck
|
|
|
|
$ chmod g+ws permcheck
|
|
|
|
$ cd permcheck
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ touch a
|
|
|
|
$ hg commit -qAm a
|
|
|
|
$ ls -la .hg/cache/noderevs/
|
2016-04-08 02:53:18 +03:00
|
|
|
total * (glob)
|
2016-10-25 19:03:15 +03:00
|
|
|
drwxrw[sx]r-x.? [0-9]+ .* \. (re)
|
|
|
|
drwxrw[sx]r-x.? [0-9]+ .* \.\. (re)
|
2016-04-08 02:53:18 +03:00
|
|
|
-rw-rw-r--.? 1 .* branchheads-served (re)
|
2016-12-17 01:46:36 +03:00
|
|
|
|
2016-12-20 19:34:33 +03:00
|
|
|
Test logging the dirsize and sparse profiles
|
2016-12-17 01:46:36 +03:00
|
|
|
|
|
|
|
Set up the sampling extension and set a log file, then do a repo status.
|
|
|
|
We need to disable the SCM_SAMPLING_FILEPATH env var because arcanist may set it!
|
|
|
|
|
|
|
|
$ LOGDIR=`pwd`/logs
|
|
|
|
$ mkdir $LOGDIR
|
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [sampling]
|
|
|
|
> key.dirstate_size=dirstate_size
|
2016-12-20 19:34:33 +03:00
|
|
|
> key.sparse_profiles=sparse_profiles
|
2016-12-17 01:46:36 +03:00
|
|
|
> filepath = $LOGDIR/samplingpath.txt
|
|
|
|
> [extensions]
|
|
|
|
> sampling=
|
|
|
|
> EOF
|
|
|
|
$ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
|
|
|
|
$ export PYTHONPATH
|
2016-12-17 02:19:23 +03:00
|
|
|
$ unset SCM_SAMPLING_FILEPATH
|
|
|
|
$ hg status
|
2016-12-17 01:46:36 +03:00
|
|
|
>>> import json
|
|
|
|
>>> with open("$LOGDIR/samplingpath.txt") as f:
|
|
|
|
... data = f.read()
|
|
|
|
>>> for record in data.strip("\0").split("\0"):
|
|
|
|
... parsedrecord = json.loads(record)
|
|
|
|
... print '{0}: {1}'.format(parsedrecord['category'],
|
|
|
|
... parsedrecord['data']['dirstate_size'])
|
|
|
|
dirstate_size: 1
|
2016-12-20 19:34:33 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [extensions]
|
|
|
|
> sparse=
|
|
|
|
> EOF
|
|
|
|
$ cat >> profile_base << EOF
|
|
|
|
> [include]
|
|
|
|
> a
|
|
|
|
> EOF
|
|
|
|
$ cat >> profile_extended << EOF
|
|
|
|
> %include profile_base
|
|
|
|
> EOF
|
|
|
|
$ hg add profile_base profile_extended
|
|
|
|
$ hg ci -m 'adding sparse profiles'
|
|
|
|
$ hg sparse --enable-profile profile_extended
|
|
|
|
>>> import json
|
|
|
|
>>> with open("$LOGDIR/samplingpath.txt") as f:
|
|
|
|
... data = f.read()
|
|
|
|
>>> for record in data.strip("\0").split("\0"):
|
|
|
|
... parsedrecord = json.loads(record)
|
|
|
|
... if parsedrecord['category'] == 'sparse_profiles':
|
2017-02-23 01:36:28 +03:00
|
|
|
... print 'active_profiles:', parsedrecord['data']['active_profiles']
|
2016-12-20 19:34:33 +03:00
|
|
|
active_profiles:
|
|
|
|
active_profiles:
|
2017-02-23 01:36:28 +03:00
|
|
|
active_profiles: profile_base,profile_extended
|