rebase: migrate to context manager for changing dirstate parents
authorAugie Fackler <augie@google.com>
Thu, 18 May 2017 17:11:01 -0400
changeset 32387 082fc4abdc31
parent 32386 f4aee989ebec
child 32388 81936f6462c1
rebase: migrate to context manager for changing dirstate parents
hgext/rebase.py
--- a/hgext/rebase.py	Thu May 18 17:10:53 2017 -0400
+++ b/hgext/rebase.py	Thu May 18 17:11:01 2017 -0400
@@ -427,9 +427,8 @@
                         mergemod.mergestate.clean(repo)
                 else:
                     # Skip commit if we are collapsing
-                    repo.dirstate.beginparentchange()
-                    repo.setparents(repo[p1].node())
-                    repo.dirstate.endparentchange()
+                    with repo.dirstate.parentchange():
+                        repo.setparents(repo[p1].node())
                     newnode = None
                 # Update the state
                 if newnode is not None: