mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
98d9269874
Summary: Create a fork of the Mercurial code that we can use to build server rpms. The hg servers will continue to exist for a few more months while we move the darkstorm and ediscovery use cases off them. In the mean time, we want to start making breaking changes to the client, so let's create a stable copy of the hg code to produce rpms for the hg servers. The fork is based off c7770c78d, the latest hg release. This copies the files as is, then adds some minor tweaks to get it to build: - Disables some lint checks that appear to be bypassed by path - sed replace eden/scm with eden/hg-server - Removed a dependency on scm/telemetry from the edenfs-client tests since scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts with the hg-server conflict parser. allow-large-files Reviewed By: quark-zju Differential Revision: D27632557 fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
68 lines
1.6 KiB
Perl
68 lines
1.6 KiB
Perl
#require fsmonitor
|
|
|
|
$ setconfig fsmonitor.detectrace=1
|
|
$ newrepo
|
|
|
|
No races for common operations
|
|
|
|
$ touch x
|
|
$ hg status
|
|
? x
|
|
|
|
$ rm x
|
|
$ touch y
|
|
$ hg status
|
|
? y
|
|
|
|
Create a race by write files by writing files if context._dirstatestatus is called
|
|
|
|
$ echo 'f' > .gitignore
|
|
$ mkdir c
|
|
$ touch e f g
|
|
$ cat > $TESTTMP/racy.py << EOF
|
|
> from edenscm.hgext import fsmonitor
|
|
> from edenscm.mercurial import extensions
|
|
> def _race(orig, *args, **kwargs):
|
|
> open('a', 'w').close()
|
|
> open('f', 'w').close()
|
|
> open('c/d.txt', 'w').close()
|
|
> return orig(*args, **kwargs)
|
|
> def uisetup(ui):
|
|
> extensions.wrapfunction(fsmonitor, "_walk", _race)
|
|
> EOF
|
|
|
|
$ hg status --config extensions.racy=$TESTTMP/racy.py
|
|
abort: [race-detector] files changed when scanning changes in working copy:
|
|
a
|
|
c/d.txt
|
|
|
|
(this is an error because HGDETECTRACE or fsmonitor.detectrace is set to true)
|
|
[75]
|
|
|
|
The race detector does not check files outside specified patterns:
|
|
|
|
$ hg status --config extensions.racy=$TESTTMP/racy.py y
|
|
? y
|
|
|
|
$ hg status --config extensions.racy=$TESTTMP/racy.py y a
|
|
abort: [race-detector] files changed when scanning changes in working copy:
|
|
a
|
|
|
|
(this is an error because HGDETECTRACE or fsmonitor.detectrace is set to true)
|
|
[75]
|
|
|
|
Ignored files do not use fsmonitor. So race detector does not detect it:
|
|
|
|
$ hg status -i --config extensions.racy=$TESTTMP/racy.py
|
|
I f
|
|
|
|
Race detector can be turned off:
|
|
|
|
$ hg status --config extensions.racy=$TESTTMP/racy.py --config fsmonitor.detectrace=0
|
|
? .gitignore
|
|
? a
|
|
? c/d.txt
|
|
? e
|
|
? g
|
|
? y
|