comparison mercurial/merge.py @ 23398:9da5a7413eb8

merge: use None as filename for base in 'both created' conflicts Instead of using a file that we know is not in the common ancestor's maniffest, let's use None. This is safe as the only place that cares about the value (applyupdates) already checks if the item exists in the ancestor.
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 24 Nov 2014 16:17:02 -0800
parents c7c95838be9a
children 2a038deeac9a
comparison
equal deleted inserted replaced
23397:c7c95838be9a 23398:9da5a7413eb8
419 fa = copy.get(f, None) 419 fa = copy.get(f, None)
420 if fa is not None: 420 if fa is not None:
421 actions['m'].append((f, (f, f, fa, False, pa.node()), 421 actions['m'].append((f, (f, f, fa, False, pa.node()),
422 "both renamed from " + fa)) 422 "both renamed from " + fa))
423 else: 423 else:
424 # Note: f as ancestor is wrong - we can't really make a 424 actions['m'].append((f, (f, f, None, False, pa.node()),
425 # 3-way merge without an ancestor file.
426 actions['m'].append((f, (f, f, f, False, pa.node()),
427 "both created")) 425 "both created"))
428 else: 426 else:
429 a = ma[f] 427 a = ma[f]
430 fla = ma.flags(f) 428 fla = ma.flags(f)
431 nol = 'l' not in fl1 + fl2 + fla 429 nol = 'l' not in fl1 + fl2 + fla
491 if force and not branchmerge: 489 if force and not branchmerge:
492 actions['g'].append((f, (fl2,), "remote created")) 490 actions['g'].append((f, (fl2,), "remote created"))
493 else: 491 else:
494 different = _checkunknownfile(repo, wctx, p2, f) 492 different = _checkunknownfile(repo, wctx, p2, f)
495 if force and branchmerge and different: 493 if force and branchmerge and different:
496 # FIXME: This is wrong - f is not in ma ... 494 actions['m'].append((f, (f, f, None, False, pa.node()),
497 actions['m'].append((f, (f, f, f, False, pa.node()),
498 "remote differs from untracked local")) 495 "remote differs from untracked local"))
499 elif not force and different: 496 elif not force and different:
500 aborts.append((f, 'ud')) 497 aborts.append((f, 'ud'))
501 else: 498 else:
502 actions['g'].append((f, (fl2,), "remote created")) 499 actions['g'].append((f, (fl2,), "remote created"))