Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 16095:3eab42088be4
update: just merge unknown file collisions
The unknown file collision rule was introduced as an extension of the
"should be clean when merging" rule. Unfortunately, it got applied to
the normal update path, which should be happy to merge local changes.
This patch gives us merges for unknown file collisions on update,
while preserving abort for merge and update -c.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 09 Feb 2012 17:54:47 -0600 |
parents | 0776a6cababe |
children | c12d4aceba79 |
comparison
equal
deleted
inserted
replaced
16094:0776a6cababe | 16095:3eab42088be4 |
---|---|
543 hint=_("use 'hg update' " | 543 hint=_("use 'hg update' " |
544 "or check 'hg heads'")) | 544 "or check 'hg heads'")) |
545 if not force and (wc.files() or wc.deleted()): | 545 if not force and (wc.files() or wc.deleted()): |
546 raise util.Abort(_("outstanding uncommitted changes"), | 546 raise util.Abort(_("outstanding uncommitted changes"), |
547 hint=_("use 'hg status' to list changes")) | 547 hint=_("use 'hg status' to list changes")) |
548 if not force: | |
549 _checkunknown(repo, wc, p2) | |
548 for s in wc.substate: | 550 for s in wc.substate: |
549 if wc.sub(s).dirty(): | 551 if wc.sub(s).dirty(): |
550 raise util.Abort(_("outstanding uncommitted changes in " | 552 raise util.Abort(_("outstanding uncommitted changes in " |
551 "subrepository '%s'") % s) | 553 "subrepository '%s'") % s) |
552 | 554 |
564 pa = p1 | 566 pa = p1 |
565 | 567 |
566 ### calculate phase | 568 ### calculate phase |
567 action = [] | 569 action = [] |
568 folding = not util.checkcase(repo.path) | 570 folding = not util.checkcase(repo.path) |
569 if not force: | |
570 _checkunknown(repo, wc, p2) | |
571 if folding: | 571 if folding: |
572 _checkcollision(p2, branchmerge and p1) | 572 _checkcollision(p2, branchmerge and p1) |
573 action += _forgetremoved(wc, p2, branchmerge) | 573 action += _forgetremoved(wc, p2, branchmerge) |
574 action += manifestmerge(repo, wc, p2, pa, overwrite, partial) | 574 action += manifestmerge(repo, wc, p2, pa, overwrite, partial) |
575 | 575 |