[PATCH 2 of 4] lock message: calculate lock description file name

Tuli Uchitel tuli at fb.com
Tue Mar 8 15:50:15 EST 2016


# HG changeset patch
# User Tuli Uchitel <tuli at fb.com>
# Date 1457463708 0
#      Tue Mar 08 19:01:48 2016 +0000
# Branch stable
# Node ID 1ffef024963c56879289caf534575d0c72f4b7e9
# Parent  9fb33594d0e791034812adb34e12a4a3ee636418
lock message: calculate lock description file name

implement a method that creates a name for a file that will hold description about the lock that has been acquired

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1237,6 +1237,13 @@
                 continue
             ce.refresh()
 
+    def _getlockdescriptionfilename(self, lockfilepath):
+        lockdescriptionfilename = None
+        if isinstance(lockfilepath, basestring):
+            lockfilename = lockfilepath.split("/")[-1]
+            lockdescriptionfilename = "%s.description" % lockfilename
+        return lockdescriptionfilename
+
     def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc,
               inheritchecker=None, parentenvvar=None):
         parentlock = None


More information about the Mercurial-devel mailing list