Add wlock during overwrite kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Wed, 14 Feb 2007 02:50:06 +0100
branchkwmap-templates
changeset 143 3485b0ef99c4
parent 142 aedce5bcc9eb
child 144 19b3d1de3db0
Add wlock during overwrite Message-ID: <20070213102701.GC30656@cecm.usp.br>
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Feb 14 02:44:25 2007 +0100
+++ b/hgkw/keyword.py	Wed Feb 14 02:50:06 2007 +0100
@@ -207,8 +207,16 @@
             if not candidates:
                 return node
 
-            kwt = kwtemplater(self.ui, self)
-            kwt.overwrite(candidates, node)
+            wrelease = False
+            if not wlock:
+                wlock = self.wlock()
+                wrelease = True
+            try:
+                kwt = kwtemplater(self.ui, self)
+                kwt.overwrite(candidates, node)
+            finally:
+                if wrelease:
+                    wlock.release()
             return node
 
     class kwfilelog(filelog.filelog):