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

login
register
mail settings
Submitter Tuli Uchitel
Date March 8, 2016, 8:50 p.m.
Message ID <1ffef024963c56879289.1457470215@yous-iphone.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/13693/
State Changes Requested
Delegated to: Pierre-Yves David
Headers show

Comments

Tuli Uchitel - March 8, 2016, 8:50 p.m.
# HG changeset patch
# User Tuli Uchitel <tuli@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

Patch

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