[PATCH 2 of 2] lock: make trylock private

Matt Mackall mpm at selenic.com
Mon Aug 24 17:13:01 CDT 2015


# HG changeset patch
# User Matt Mackall <mpm at selenic.com>
# Date 1440440770 18000
#      Mon Aug 24 13:26:10 2015 -0500
# Node ID 38b5f5169be213b9e6187fbf63a8e55e7b1961fd
# Parent  d7b7ac6570ada6329bbe777e40ec61287966eb57
lock: make trylock private

diff -r d7b7ac6570ad -r 38b5f5169be2 mercurial/lock.py
--- a/mercurial/lock.py	Mon Aug 24 13:24:43 2015 -0500
+++ b/mercurial/lock.py	Mon Aug 24 13:26:10 2015 -0500
@@ -65,7 +65,7 @@
         timeout = self.timeout
         while True:
             try:
-                self.trylock()
+                self._trylock()
                 return self.timeout - timeout
             except error.LockHeld as inst:
                 if timeout != 0:
@@ -76,7 +76,7 @@
                 raise error.LockHeld(errno.ETIMEDOUT, inst.filename, self.desc,
                                      inst.locker)
 
-    def trylock(self):
+    def _trylock(self):
         if self.held:
             self.held += 1
             return


More information about the Mercurial-devel mailing list