# HG changeset patch # User Matt Mackall # Date 2012-10-02 04:06:14 # Node ID b3f0f9a39c4e1d0250048cd803ab03542d6f140a # Parent 75f25bd4c7d43cce38b9da91aa17b8f685adc79c # Parent 829919ef894acb189c8ec0431e59f36338eb038f merge with i18n diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -97,7 +97,12 @@ class lock(object): The lock file is only deleted when None is returned. """ - locker = util.readlock(self.f) + try: + locker = util.readlock(self.f) + except OSError, why: + if why.errno == errno.ENOENT: + return None + raise try: host, pid = locker.split(":", 1) except ValueError: diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -1622,8 +1622,8 @@ Test commit's addremove option prior to A large.dat A large2.dat A normal - $ find .hglf/ | sort - .hglf/ + $ find .hglf | sort + .hglf .hglf/large.dat .hglf/large2.dat