split: compute revision to split after locking
This would avoid strange behavior from race condition.
--- a/hgext3rd/evolve/cmdrewrite.py Sun Jul 23 20:25:26 2017 +0200
+++ b/hgext3rd/evolve/cmdrewrite.py Mon Jul 24 00:01:10 2017 +0200
@@ -776,10 +776,10 @@
hnt = _("use either `hg split <rs>` or `hg split --rev <rs>`, not both")
raise error.Abort(msg, hint=hnt)
- rev = scmutil.revsingle(repo, revarg[0])
try:
wlock = repo.wlock()
lock = repo.lock()
+ rev = scmutil.revsingle(repo, revarg[0])
cmdutil.bailifchanged(repo)
tr = repo.transaction('split')
ctx = repo[rev]