[PATCH] localrepo: document lock(), wlock() methods

Greg Ward greg-hg at gerg.ca
Tue Jul 21 19:29:16 CDT 2009


# HG changeset patch
# User Greg Ward <greg-hg at gerg.ca>
# Date 1248222544 14400
# Node ID 13910cfbd6519d1bbe09be7a11a9b710e3405c06
# Parent  4a01bd7064a1a7a3e8e33631f0ab9aec745775db
localrepo: document lock(), wlock() methods.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -651,6 +651,8 @@
         return l
 
     def lock(self, wait=True):
+        '''Take out a lock on the repository and return a weak reference
+        to the lock.  Use this before modifying the repository.'''
         l = self._lockref and self._lockref()
         if l is not None and l.held:
             l.lock()
@@ -662,6 +664,9 @@
         return l
 
     def wlock(self, wait=True):
+        '''Take out a lock on the working copy and return a weak
+        reference to the lock.  Use this before modifying files in the
+        working copy.'''
         l = self._wlockref and self._wlockref()
         if l is not None and l.held:
             l.lock()


More information about the Mercurial-devel mailing list