# HG changeset patch # User Ronny Pfannschmidt # Date 2009-04-22 00:01:22 # Node ID 87a1605979e477dbf35b27b1e6b6e122db2c9fbf # Parent 6ee71f78497c5647fe0b88d37edd9fdaedb812c0 add a deprecation warning for gc based lock releasing diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -6,6 +6,7 @@ # of the GNU General Public License, incorporated herein by reference. import errno, os, socket, time, util, error +import warnings class lock(object): # lock is symlink on platforms that support it, file on others. @@ -28,6 +29,10 @@ class lock(object): def __del__(self): if self.held: + warnings.warn("use lock.release instead of del lock", + category=DeprecationWarning, + stacklevel=2) + # ensure the lock will be removed # even if recursive locking did occur self.held = 1