comparison mercurial/merge.py @ 42958:181e52f2b62f stable 5.1.2

merge: back out changeset a4ca0610c754 (parents order when grafting a merge) Turns out it's not enough to just swap parents, because when we do, there are unexpected bad side effects, such as a tracked file becoming untracked. These side effects need more code to be handled properly, but it's not written yet. Let's back this feature out from stable for now and some day implement it on default instead.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 20 Sep 2019 23:31:03 +0700
parents 085295f82845
children af2b5562fcaf
comparison
equal deleted inserted replaced
42953:085295f82845 42958:181e52f2b62f
2247 2247
2248 stats = update(repo, ctx.node(), True, True, pctx.node(), 2248 stats = update(repo, ctx.node(), True, True, pctx.node(),
2249 mergeancestor=mergeancestor, labels=labels) 2249 mergeancestor=mergeancestor, labels=labels)
2250 2250
2251 2251
2252 potherp1 = False
2253 if keepconflictparent and stats.unresolvedcount: 2252 if keepconflictparent and stats.unresolvedcount:
2254 pother = ctx.node() 2253 pother = ctx.node()
2255 else: 2254 else:
2256 pother = nullid 2255 pother = nullid
2257 parents = ctx.parents() 2256 parents = ctx.parents()
2258 if keepparent and len(parents) == 2 and pctx in parents: 2257 if keepparent and len(parents) == 2 and pctx in parents:
2259 if pctx == parents[1]:
2260 potherp1 = True
2261 parents.remove(pctx) 2258 parents.remove(pctx)
2262 pother = parents[0].node() 2259 pother = parents[0].node()
2263 2260
2264 with repo.dirstate.parentchange(): 2261 with repo.dirstate.parentchange():
2265 if potherp1: 2262 repo.setparents(repo['.'].node(), pother)
2266 repo.setparents(pother, repo['.'].node())
2267 else:
2268 repo.setparents(repo['.'].node(), pother)
2269 repo.dirstate.write(repo.currenttransaction()) 2263 repo.dirstate.write(repo.currenttransaction())
2270 # fix up dirstate for copies and renames 2264 # fix up dirstate for copies and renames
2271 copies.duplicatecopies(repo, repo[None], ctx.rev(), pctx.rev()) 2265 copies.duplicatecopies(repo, repo[None], ctx.rev(), pctx.rev())
2272 return stats 2266 return stats
2273 2267