# HG changeset patch # User Augie Fackler # Date 2017-05-18 21:11:01 # Node ID 082fc4abdc31e7138a3c03decf922e5a32d1f1ee # Parent f4aee989ebec484ca3b71261b4484caf740535e4 rebase: migrate to context manager for changing dirstate parents diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -427,9 +427,8 @@ class rebaseruntime(object): 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: