# HG changeset patch # User Christian Ebert # Date 1171417806 -3600 # Node ID 3485b0ef99c476160123f6436e61bdbc7fad2988 # Parent aedce5bcc9ebfc1651dd57a92ee1adec30c52435 Add wlock during overwrite Message-ID: <20070213102701.GC30656@cecm.usp.br> diff -r aedce5bcc9eb -r 3485b0ef99c4 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):