# HG changeset patch # User Pierre-Yves David # Date 1676771248 -3600 # 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 -r a860298776f0 -r 0ca8dc8a135f hgext/mq.py --- a/hgext/mq.py Mon Feb 20 11:37:05 2023 +0100 +++ b/hgext/mq.py Sun Feb 19 02:47:28 2023 +0100 @@ -2121,9 +2121,9 @@ 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( _(