changeset 225:1651a3e61925

fix repo locking -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 fix repo locking We've actually got to assign the lock to a local variable, otherwise it gets released immediately. manifest hash: d55fc8858649c59ed9fa1f8cb90b63b33a71c223 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCoMERywK+sNU5EO8RAgqwAKCPhmTOK/n5bjJ6Xh4mC9Q8mJDx4wCfZBGX Uik+3sUcQRqgHjsP0fIjjiU= =U1p0 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Fri, 03 Jun 2005 12:44:01 -0800
parents ccbcc4d76f81
children 1536ccac47e9
files mercurial/hg.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Fri Jun 03 12:43:16 2005 -0800
+++ b/mercurial/hg.py	Fri Jun 03 12:44:01 2005 -0800
@@ -346,7 +346,7 @@
                            self.join("undo"))
 
     def recover(self):
-        self.lock()
+        lock = self.lock()
         if os.path.exists(self.join("recover")):
             self.ui.status("attempting to rollback interrupted transaction\n")
             return rollback(self.opener, self.join("recover"))
@@ -354,7 +354,7 @@
             self.ui.warn("no interrupted transaction available\n")
 
     def undo(self):
-        self.lock()
+        lock = self.lock()
         if os.path.exists(self.join("undo")):
             f = self.changelog.read(self.changelog.tip())[3]
             self.ui.status("attempting to rollback last transaction\n")
@@ -428,6 +428,7 @@
             self.ui.status("nothing changed\n")
             return
 
+        lock = self.lock()
         tr = self.transaction()
 
         # check in files
@@ -807,8 +808,9 @@
 
         if not generator: return
         changesets = files = revisions = 0
-        self.lock()
+
         source = genread(generator)
+        lock = self.lock()
         tr = self.transaction()
 
         # pull off the changeset group