changeset 4958:9a2a73ea6135

repo locks: use True/False
author Matt Mackall <mpm@selenic.com>
date Sat, 21 Jul 2007 16:02:09 -0500
parents 46e39935ce33
children 97b734fb9c6f
files mercurial/commands.py mercurial/localrepo.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -675,7 +675,7 @@ def copy(ui, repo, *pats, **opts):
     This command takes effect in the next commit. To undo a copy
     before that, see hg revert.
     """
-    wlock = repo.wlock(0)
+    wlock = repo.wlock(False)
     errs, copied = docopy(ui, repo, pats, opts, wlock)
     return errs
 
@@ -2247,7 +2247,7 @@ def rename(ui, repo, *pats, **opts):
     This command takes effect in the next commit. To undo a rename
     before that, see hg revert.
     """
-    wlock = repo.wlock(0)
+    wlock = repo.wlock(False)
     errs, copied = docopy(ui, repo, pats, opts, wlock)
     names = []
     for abs, rel, exact in copied:
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -561,11 +561,11 @@ class localrepository(repo.repository):
             acquirefn()
         return l
 
-    def lock(self, wait=1):
+    def lock(self, wait=True):
         return self._lock(self.sjoin("lock"), wait, None, self.invalidate,
                           _('repository %s') % self.origroot)
 
-    def wlock(self, wait=1):
+    def wlock(self, wait=True):
         return self._lock(self.join("wlock"), wait, self.dirstate.write,
                           self.dirstate.invalidate,
                           _('working directory of %s') % self.origroot)
@@ -898,7 +898,7 @@ class localrepository(repo.repository):
                         cleanup = False
                         if not wlock:
                             try:
-                                wlock = self.wlock(wait=0)
+                                wlock = self.wlock(False)
                                 cleanup = True
                             except lock.LockException:
                                 pass