# HG changeset patch # User Pierre-Yves David # Date 1429530424 -7200 # Node ID a2d4901e211e9ccfd633fefaf2d52326ab22ae3c # Parent 87d62639027065429cd4bda66ae0227e33af156f commit: avoid potential deadlock We must acquire 'wlock' before 'lock'. diff -r 87d626390270 -r a2d4901e211e README --- a/README Mon Apr 20 13:41:27 2015 +0200 +++ b/README Mon Apr 20 13:47:04 2015 +0200 @@ -56,6 +56,7 @@ - discovery: fix misbehaving discovery accros python version - pull: properly install the bundle2 par generator (avoid sending all markers for each pull) +- commit: avoid potential deadlock (acquires wlock before lock) 5.1.2 -- 2015-04-01 diff -r 87d626390270 -r a2d4901e211e hgext/evolve.py --- a/hgext/evolve.py Mon Apr 20 13:41:27 2015 +0200 +++ b/hgext/evolve.py Mon Apr 20 13:47:04 2015 +0200 @@ -2039,8 +2039,9 @@ @eh.wrapcommand('commit') def commitwrapper(orig, ui, repo, *arg, **kwargs): if kwargs.get('amend', False): - lock = None + wlock = lock = None else: + wlock = repo.wlock() lock = repo.lock() try: obsoleted = kwargs.get('obsolete', []) @@ -2064,6 +2065,8 @@ finally: if lock is not None: lock.release() + if wlock is not None: + wlock.release() @command('^touch', [('r', 'rev', [], 'revision to update'),