Patchwork [1,of,3,V2] lock: use configint for 'ui.timeout' config

login
register
mail settings
Submitter Boris Feld
Date Dec. 4, 2017, 10:28 a.m.
Message ID <144214ed28417180a25a.1512383322@FB>
Download mbox | patch
Permalink /patch/25913/
State Accepted
Headers show

Comments

Boris Feld - Dec. 4, 2017, 10:28 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1512007202 18000
#      Wed Nov 29 21:00:02 2017 -0500
# Node ID 144214ed28417180a25a0f6311de1f0ac0b02b8e
# Parent  8287df8b7be545fdafa22b771012ac65f6264d12
# EXP-Topic lock-message
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 144214ed2841
lock: use configint for 'ui.timeout' config

The ui object can do the conversion itself.
Yuya Nishihara - Dec. 4, 2017, 2:12 p.m.
On Mon, 04 Dec 2017 11:28:42 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1512007202 18000
> #      Wed Nov 29 21:00:02 2017 -0500
> # Node ID 144214ed28417180a25a0f6311de1f0ac0b02b8e
> # Parent  8287df8b7be545fdafa22b771012ac65f6264d12
> # EXP-Topic lock-message
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 144214ed2841
> lock: use configint for 'ui.timeout' config

Looks good, queued, thanks.

Patch

diff --git a/hgext/journal.py b/hgext/journal.py
--- a/hgext/journal.py
+++ b/hgext/journal.py
@@ -304,7 +304,7 @@  class journalstorage(object):
             # default to 600 seconds timeout
             l = lock.lock(
                 vfs, 'namejournal.lock',
-                int(self.ui.config("ui", "timeout")), desc=desc)
+                self.ui.configint("ui", "timeout"), desc=desc)
             self.ui.warn(_("got lock after %s seconds\n") % l.delay)
         self._lockref = weakref.ref(l)
         return l
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1609,7 +1609,7 @@  class localrepository(object):
                              (desc, inst.locker))
             # default to 600 seconds timeout
             l = lockmod.lock(vfs, lockname,
-                             int(self.ui.config("ui", "timeout")),
+                             self.ui.configint("ui", "timeout"),
                              releasefn=releasefn, acquirefn=acquirefn,
                              desc=desc)
             self.ui.warn(_("got lock after %s seconds\n") % l.delay)