split: compute revision to split after locking
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 24 Jul 2017 00:01:10 +0200
changeset 2774 0f167320f90f
parent 2773 9e363e8c1c06
child 2775 1d16c9dcb825
split: compute revision to split after locking This would avoid strange behavior from race condition.
hgext3rd/evolve/cmdrewrite.py
--- 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]