# HG changeset patch # User Pierre-Yves David # Date 2023-02-19 01:47:28 # Node ID 0ca8dc8a135ff38c33ffedfe14fa81772d72a801 # Parent a860298776f04d61b2861b3ffcfc6d9d1a5b769a mq: wrap the dirstate's rebuild in a `changing_parents` context This code is dealing with `qreshesh` failure. In that case the working copy will be left on the parent of the refreshed patch, so the parents are changing and `changing_parents` make sens. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2121,9 +2121,9 @@ class queue: finally: lockmod.release(tr, lock) except: # re-raises - ctx = repo[cparents[0]] - repo.dirstate.rebuild(ctx.node(), ctx.manifest()) - repo.dirstate.write(repo.currenttransaction()) + with repo.dirstate.changing_parents(repo): + ctx = repo[cparents[0]] + repo.dirstate.rebuild(ctx.node(), ctx.manifest()) self.savedirty() self.ui.warn( _(