fold: move sanity check after locking
Checking for operation validaty without the locks open us to race condition.
--- a/hgext/evolve.py Mon Apr 25 16:24:42 2016 -0700
+++ b/hgext/evolve.py Mon May 02 18:21:54 2016 +0200
@@ -3121,12 +3121,13 @@
ui.write_err(_('single revision specified, nothing to fold\n'))
return 1
- root, head = _foldcheck(repo, revs)
-
wlock = lock = None
try:
wlock = repo.wlock()
lock = repo.lock()
+
+ root, head = _foldcheck(repo, revs)
+
tr = repo.transaction('touch')
try:
commitopts = opts.copy()