##// END OF EJS Templates
merge: move abort/warn checks up to the top level of _checkunknownfiles...
Siddharth Agarwal -
r28018:3feadb0b default
parent child Browse files
Show More
@@ -610,17 +610,17 b' def _checkunknownfiles(repo, wctx, mctx,'
610 choose a different action.
610 choose a different action.
611 """
611 """
612 conflicts = set()
612 conflicts = set()
613 warnconflicts = set()
614 abortconflicts = set()
615 unknownconfig = _getcheckunknownconfig(repo, 'merge', 'checkunknown')
616 ignoredconfig = _getcheckunknownconfig(repo, 'merge', 'checkignored')
613 if not force:
617 if not force:
614 abortconflicts = set()
615 warnconflicts = set()
616 def collectconflicts(conflicts, config):
618 def collectconflicts(conflicts, config):
617 if config == 'abort':
619 if config == 'abort':
618 abortconflicts.update(conflicts)
620 abortconflicts.update(conflicts)
619 elif config == 'warn':
621 elif config == 'warn':
620 warnconflicts.update(conflicts)
622 warnconflicts.update(conflicts)
621
623
622 unknownconfig = _getcheckunknownconfig(repo, 'merge', 'checkunknown')
623 ignoredconfig = _getcheckunknownconfig(repo, 'merge', 'checkignored')
624 for f, (m, args, msg) in actions.iteritems():
624 for f, (m, args, msg) in actions.iteritems():
625 if m in ('c', 'dc'):
625 if m in ('c', 'dc'):
626 if _checkunknownfile(repo, wctx, mctx, f):
626 if _checkunknownfile(repo, wctx, mctx, f):
@@ -634,14 +634,15 b' def _checkunknownfiles(repo, wctx, mctx,'
634 unknownconflicts = conflicts - ignoredconflicts
634 unknownconflicts = conflicts - ignoredconflicts
635 collectconflicts(ignoredconflicts, ignoredconfig)
635 collectconflicts(ignoredconflicts, ignoredconfig)
636 collectconflicts(unknownconflicts, unknownconfig)
636 collectconflicts(unknownconflicts, unknownconfig)
637 for f in sorted(abortconflicts):
638 repo.ui.warn(_("%s: untracked file differs\n") % f)
639 if abortconflicts:
640 raise error.Abort(_("untracked files in working directory "
641 "differ from files in requested revision"))
642
637
643 for f in sorted(warnconflicts):
638 for f in sorted(abortconflicts):
644 repo.ui.warn(_("%s: replacing untracked file\n") % f)
639 repo.ui.warn(_("%s: untracked file differs\n") % f)
640 if abortconflicts:
641 raise error.Abort(_("untracked files in working directory "
642 "differ from files in requested revision"))
643
644 for f in sorted(warnconflicts):
645 repo.ui.warn(_("%s: replacing untracked file\n") % f)
645
646
646 for f, (m, args, msg) in actions.iteritems():
647 for f, (m, args, msg) in actions.iteritems():
647 backup = f in conflicts
648 backup = f in conflicts
General Comments 0
You need to be logged in to leave comments. Login now