Mercurial > hg
view tests/test-i18n.t @ 32334:6e0d1043e8fc
fsmonitor: acquire localrepo.wlock prior to emitting hg.update state
we see some weird things in the watchman logs where the mercurial
process is seemingly confused about which hg.update state it is publishing
through watchman.
On closer examination, we're seeing conflicting pids for the clients involved
and this implies a race.
To resolve this, we extend the wlock around the state-enter/state-leave
events that are emitted to watchman.
Test Plan:
Some manual testing:
In one window, run this, and then checkout a different rev:
```
$ watchman -p -j <<<'["subscribe", "/data/users/wez/fbsource", "wez", {"expression": ["name", ".hg/updatestate"]}]'
{
"version": "4.9.0",
"subscribe": "wez",
"clock": "c:1495034090:814028:1:312576"
}
{
"state-enter": "hg.update",
"version": "4.9.0",
"clock": "c:1495034090:814028:1:312596",
"unilateral": true,
"subscription": "wez",
"metadata": {
"status": "ok",
"distance": 125,
"rev": "a1275d79ffa6c58b53116c8ec401c275ca6c1e2a",
"partial": false
},
"root": "/data/users/wez/fbsource"
}
{
"root": "/data/users/wez/fbsource",
"metadata": {
"status": "ok",
"distance": 125,
"rev": "a1275d79ffa6c58b53116c8ec401c275ca6c1e2a",
"partial": false
},
"subscription": "wez",
"unilateral": true,
"version": "4.9.0",
"clock": "c:1495034090:814028:1:312627",
"state-leave": "hg.update"
}
```
Tailed the watchman log file and looked for invalid state assertion errors,
then ran my `rebase-all` script to update/rebase all of my heads.
Didn't trigger the error condition (but couldn't reliably trigger it previously
anyway), and the output captured above shows that the states are being emitted
correctly.
author | Wez Furlong <wez@fb.com> |
---|---|
date | Thu, 18 May 2017 12:48:07 -0700 |
parents | a0e4df5a4d5d |
children | 75be14993fda |
line wrap: on
line source
(Translations are optional) #if gettext no-outer-repo Test that translations are compiled and installed correctly. Default encoding in tests is "ascii" and the translation is encoded using the "replace" error handler: $ LANGUAGE=pt_BR hg tip abortado: n?o foi encontrado um reposit?rio em '$TESTTMP' (.hg n?o encontrado)! [255] Using a more accommodating encoding: $ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip abortado: n\xc3\xa3o foi encontrado um reposit\xc3\xb3rio em '$TESTTMP' (.hg n\xc3\xa3o encontrado)! (esc) [255] Different encoding: $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip abortado: n\xe3o foi encontrado um reposit\xf3rio em '$TESTTMP' (.hg n\xe3o encontrado)! (esc) [255] #endif #if gettext Test keyword search in translated help text: $ HGENCODING=UTF-8 LANGUAGE=de hg help -k Aktualisiert Themen: subrepos Unterarchive Befehle: pull Ruft \xc3\x84nderungen von der angegebenen Quelle ab (esc) update Aktualisiert das Arbeitsverzeichnis (oder wechselt die Version) #endif Check Mercurial specific translation problems in each *.po files, and tool itself by doctest $ cd "$TESTDIR"/../i18n $ python check-translation.py *.po $ python check-translation.py --doctest $ cd $TESTTMP