comparison mercurial/merge.py @ 42953:085295f82845 stable

merge: respect parents order when using `graft` on a merge, this time for real See a4ca0610c754. potherp1 is a boolean variable that means "pother is ctx.p1", and parents is naturally [ctx.p1, ctx.p2]. pctx is always removed from parents, so if pctx is parents[0], then we end up using parents[1] as pother. To be true to its name, potherp1 should then be True only when pctx is at parents[1].
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 18 Sep 2019 17:53:10 +0700
parents a4ca0610c754
children 2c14bf83b58b 181e52f2b62f
comparison
equal deleted inserted replaced
42917:e26c2440a030 42953:085295f82845
2254 pother = ctx.node() 2254 pother = ctx.node()
2255 else: 2255 else:
2256 pother = nullid 2256 pother = nullid
2257 parents = ctx.parents() 2257 parents = ctx.parents()
2258 if keepparent and len(parents) == 2 and pctx in parents: 2258 if keepparent and len(parents) == 2 and pctx in parents:
2259 if pctx == parents[0]: 2259 if pctx == parents[1]:
2260 potherp1 = True 2260 potherp1 = True
2261 parents.remove(pctx) 2261 parents.remove(pctx)
2262 pother = parents[0].node() 2262 pother = parents[0].node()
2263 2263
2264 with repo.dirstate.parentchange(): 2264 with repo.dirstate.parentchange():