diff hgext/rebase.py @ 32387:082fc4abdc31

rebase: migrate to context manager for changing dirstate parents
author Augie Fackler <augie@google.com>
date Thu, 18 May 2017 17:11:01 -0400
parents 46ba2cdda476
children 04baab18d60a
line wrap: on
line diff
--- 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: