--- a/hgkw/keyword.py Mon Aug 20 05:08:39 2007 +0200
+++ b/hgkw/keyword.py Tue Aug 21 13:27:48 2007 +0200
@@ -461,24 +461,23 @@
def commit(self, files=None, text='', user=None, date=None,
match=util.always, force=False, lock=None, wlock=None,
force_editor=False, p1=None, p2=None, extra={}):
+ # (w)lock arguments removed in 126f527b3ba3
+ # so they are None or what was passed to commit
+ # use private _(w)lock for deletion
+ _lock = lock
+ _wlock = wlock
+ del wlock, lock
try:
- kwlock = lock
- kwwlock = wlock
- del wlock, lock
- except NameError:
- # (w)lock arguments removed in recent Hg versions
- kwwlock = kwlock = None
- try:
- if not kwwlock:
- kwwlock = self.wlock()
- if not kwlock:
- kwlock = self.lock()
+ if not _wlock:
+ _wlock = self.wlock()
+ if not _lock:
+ _lock = self.lock()
try:
node = super(kwrepo,
self).commit(files=files, text=text,
user=user, date=date,
match=match, force=force,
- lock=kwlock, wlock=kwwlock,
+ lock=_lock, wlock=_wlock,
force_editor=force_editor,
p1=p1, p2=p2, extra=extra)
except TypeError:
@@ -498,7 +497,7 @@
kwt.overwrite(candidates, mn, commit)
return node
finally:
- del kwwlock, kwlock
+ del _wlock, _lock
repo.__class__ = kwrepo