graft: avoid potential deadlock
We must acquire 'wlock' before 'lock'.
--- a/README Mon Apr 20 13:47:04 2015 +0200
+++ b/README Mon Apr 20 13:48:06 2015 +0200
@@ -57,6 +57,7 @@
- pull: properly install the bundle2 par generator
(avoid sending all markers for each pull)
- commit: avoid potential deadlock (acquires wlock before lock)
+- graft: avoid potential deadlock (acquires wlock before lock)
5.1.2 -- 2015-04-01
--- a/hgext/evolve.py Mon Apr 20 13:47:04 2015 +0200
+++ b/hgext/evolve.py Mon Apr 20 13:48:06 2015 +0200
@@ -2240,8 +2240,10 @@
kwargs['rev'] = []
obsoleted = kwargs.setdefault('obsolete', [])
- lock = repo.lock()
+ wlock = lock = None
try:
+ wlock = repo.wlock()
+ lock = repo.lock()
if kwargs.get('old_obsolete'):
if kwargs.get('continue'):
obsoleted.extend(repo.opener.read('graftstate').splitlines())
@@ -2256,7 +2258,7 @@
return commitwrapper(orig, ui, repo,*revs, **kwargs)
finally:
- lock.release()
+ lockmod.release(lock, wlock)
@eh.extsetup
def oldevolveextsetup(ui):