commit: avoid potential deadlock
We must acquire 'wlock' before 'lock'.
--- 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
--- 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'),