[PATCH] debugsetparents: remove redundant invocations of begin/endparentchange

liscju piotr.listkiewicz at gmail.com
Mon Mar 28 07:14:43 UTC 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1459149123 -7200
#      Mon Mar 28 09:12:03 2016 +0200
# Node ID 1e05ab137ca418290438b876629ba70158b1c803
# Parent  345f4fa4cc8912bb722ad3e35d68858487420bc6
debugsetparents: remove redundant invocations of begin/endparentchange

Method localrepo.setparents invokes begin/endparentchange internally,
so there is no need to invoke it explicitly in debugsetparents.

diff -r 345f4fa4cc89 -r 1e05ab137ca4 mercurial/commands.py
--- a/mercurial/commands.py	Fri Mar 25 16:23:23 2016 -0500
+++ b/mercurial/commands.py	Mon Mar 28 09:12:03 2016 +0200
@@ -3494,9 +3494,7 @@ def debugsetparents(ui, repo, rev1, rev2
     r2 = scmutil.revsingle(repo, rev2, 'null').node()
 
     with repo.wlock():
-        repo.dirstate.beginparentchange()
         repo.setparents(r1, r2)
-        repo.dirstate.endparentchange()
 
 @command('debugdirstate|debugstate',
     [('', 'nodates', None, _('do not display the saved mtime')),


More information about the Mercurial-devel mailing list