Patchwork D3823: fix: include cleanupnodes() in transaction

login
register
mail settings
Submitter phabricator
Date June 20, 2018, 4:29 p.m.
Message ID <differential-rev-PHID-DREV-gxf3mwyz5zpbldz2xink-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32343/
State Superseded
Headers show

Comments

phabricator - June 20, 2018, 4:29 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  As pointed out by Yuya, we need a transaction to make sure the state
  before the call to cleanupnodes() is not observable.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3823

AFFECTED FILES
  hgext/fix.py
  tests/test-fix-topology.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-fix-topology.t b/tests/test-fix-topology.t
--- a/tests/test-fix-topology.t
+++ b/tests/test-fix-topology.t
@@ -322,7 +322,6 @@ 
   
 
   $ hg fix --all
-  1 new orphan changesets
 
   $ hg log --graph --template '{rev} {desc}\n' -r 'sort(all(), topo)' --hidden
   o  11 fifth
diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -133,7 +133,7 @@ 
             raise error.Abort(_('cannot specify both "--rev" and "--all"'))
         opts['rev'] = ['not public() and not obsolete()']
         opts['working_dir'] = True
-    with repo.wlock(), repo.lock():
+    with repo.wlock(), repo.lock(), repo.transaction('fix'):
         revstofix = getrevstofix(ui, repo, opts)
         basectxs = getbasectxs(repo, opts, revstofix)
         workqueue, numitems = getworkqueue(ui, repo, pats, opts, revstofix,