[PATCH 1 of 4 STABLE V3] lock: avoid unintentional lock acquisition at failure of readlock

Yuya Nishihara yuya at tcha.org
Mon May 1 08:56:29 EDT 2017


On Mon, 01 May 2017 20:02:49 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1493636332 -32400
> #      Mon May 01 19:58:52 2017 +0900
> # Branch stable
> # Node ID e1938d6051da1eff0c0d78fc7aae0d426e99aad2
> # Parent  b59a292d0a536ee21e17d018829c36d8d4415569
> lock: avoid unintentional lock acquisition at failure of readlock

Queued the first two, thanks. Since we're very close to the release, let's
revisit the message improvements later.

> diff --git a/mercurial/lock.py b/mercurial/lock.py
> --- a/mercurial/lock.py
> +++ b/mercurial/lock.py
> @@ -131,6 +131,9 @@ class lock(object):
>              except (OSError, IOError) as why:
>                  if why.errno == errno.EEXIST:
>                      locker = self._readlock()
> +                    if locker is None:
> +                        continue

Perhaps we can get rid of the subsequent "if locker is not None" condition,
as a follow up.


More information about the Mercurial-devel mailing list