comparison mercurial/merge.py @ 12664:545ec1775021

merge: handle no file parent in backwards merge (issue2364)
author Matt Mackall <mpm@selenic.com>
date Sat, 09 Oct 2010 14:50:20 -0500
parents 4cdaf1adafc8
children bc13e17067d9
comparison
equal deleted inserted replaced
12663:8269af351a64 12664:545ec1775021
274 continue 274 continue
275 repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd)) 275 repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
276 fcl = wctx[f] 276 fcl = wctx[f]
277 fco = mctx[f2] 277 fco = mctx[f2]
278 if mctx == actx: # backwards, use working dir parent as ancestor 278 if mctx == actx: # backwards, use working dir parent as ancestor
279 fca = fcl.parents()[0] 279 if fcl.parents():
280 fca = fcl.parents()[0]
281 else:
282 fca = repo.filectx(f, fileid=nullrev)
280 else: 283 else:
281 fca = fcl.ancestor(fco, actx) 284 fca = fcl.ancestor(fco, actx)
282 if not fca: 285 if not fca:
283 fca = repo.filectx(f, fileid=nullrev) 286 fca = repo.filectx(f, fileid=nullrev)
284 ms.add(fcl, fco, fca, fd, flags) 287 ms.add(fcl, fco, fca, fd, flags)