next: start transaction before calling _solveone()
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 19 Apr 2019 11:12:00 -0700
changeset 4609 fe2999627556
parent 4608 fe22c36b5563
child 4610 c54d4c2c2846
next: start transaction before calling _solveone() All other callers do this, and I'm about to make _solveone() not create a transaction.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Fri Apr 19 10:22:25 2019 -0700
+++ b/hgext3rd/evolve/__init__.py	Fri Apr 19 11:12:00 2019 -0700
@@ -1148,10 +1148,15 @@
     cmdutil.bailifchanged(repo)
     evolvestate = state.cmdstate(repo, opts={'command': 'next',
                                              'bookmarkchanges': []})
-    result = evolvecmd._solveone(ui, repo, repo[aspchildren],
-                                 evolvestate, opts.get('dry_run'), False,
-                                 lambda: None, category='orphan',
-                                 stacktmplt=opts.get('stacktemplate', False))
+    with repo.wlock(), repo.lock():
+        tr = repo.transaction("evolve")
+        with util.acceptintervention(tr):
+            result = evolvecmd._solveone(ui, repo, repo[aspchildren],
+                                         evolvestate, opts.get('dry_run'),
+                                         False,
+                                         lambda: None, category='orphan',
+                                         stacktmplt=opts.get('stacktemplate',
+                                                             False))
     # making sure a next commit is formed
     if result[0] and result[1]:
         ui.status(_('working directory now at %s\n')