[PATCH 2 of 2] wlock: reword the devel warning
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Sun Apr 12 17:33:54 UTC 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1428859715 14400
# Sun Apr 12 13:28:35 2015 -0400
# Node ID 505448ce45f664d435678c5778f4fc85fb478c18
# Parent 66b327c773f63f0b9f2b00b2126adbf113f1ca36
wlock: reword the devel warning
We change the wording of the developer warning:
- "lock" taken before "wlock"
+ "wlock" acquired after "lock"
The goals here are to:
- Put the "subject" as the first word,
- use "acquired" instead of "taken" since it seems more accurate.
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1208,11 +1208,11 @@ class localrepository(object):
if (self.ui.configbool('devel', 'all')
or self.ui.configbool('devel', 'check-locks')):
l = self._lockref and self._lockref()
if l is not None and l.held:
- msg = '"lock" taken before "wlock"\n'
+ msg = '"wlock" acquired after "lock"\n'
if self.ui.tracebackflag:
util.debugstacktrace(msg, 1)
else:
self.ui.write_err(msg)
diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
--- a/tests/test-devel-warnings.t
+++ b/tests/test-devel-warnings.t
@@ -42,19 +42,19 @@
$ hg init lock-checker
$ cd lock-checker
$ hg buggylocking
transaction with no lock
- "lock" taken before "wlock"
+ "wlock" acquired after "lock"
$ cat << EOF >> $HGRCPATH
> [devel]
> all=0
> check-locks=1
> EOF
$ hg buggylocking
transaction with no lock
- "lock" taken before "wlock"
+ "wlock" acquired after "lock"
$ hg buggylocking --traceback
transaction with no lock
at:
*/hg:* in * (glob)
*/mercurial/dispatch.py:* in run (glob)
@@ -65,11 +65,11 @@
*/mercurial/dispatch.py:* in _runcommand (glob)
*/mercurial/dispatch.py:* in checkargs (glob)
*/mercurial/dispatch.py:* in <lambda> (glob)
*/mercurial/util.py:* in check (glob)
$TESTTMP/buggylocking.py:* in buggylocking (glob)
- "lock" taken before "wlock"
+ "wlock" acquired after "lock"
at:
*/hg:* in * (glob)
*/mercurial/dispatch.py:* in run (glob)
*/mercurial/dispatch.py:* in dispatch (glob)
*/mercurial/dispatch.py:* in _runcatch (glob)
More information about the Mercurial-devel
mailing list