##// END OF EJS Templates
merge: factor out code to get checkunknown config...
Siddharth Agarwal -
r27740:da5634e1 default
parent child Browse files
Show More
@@ -557,6 +557,16 b' class mergestate(object):'
557 557 Meant for use by custom merge drivers."""
558 558 self._results[f] = 0, 'g'
559 559
560 def _getcheckunknownconfig(repo, section, name):
561 config = repo.ui.config(section, name, default='abort')
562 valid = ['abort', 'ignore', 'warn']
563 if config not in valid:
564 validstr = ', '.join(["'" + v + "'" for v in valid])
565 raise error.ConfigError(_("%s.%s not valid "
566 "('%s' is none of %s)")
567 % (section, name, config, validstr))
568 return config
569
560 570 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
561 571 if f2 is None:
562 572 f2 = f
@@ -573,14 +583,7 b' def _checkunknownfiles(repo, wctx, mctx,'
573 583 """
574 584 conflicts = set()
575 585 if not force:
576 config = repo.ui.config('merge', 'checkunknown', default='abort')
577 valid = ['abort', 'ignore', 'warn']
578 if config not in valid:
579 validstr = ', '.join(["'" + v + "'" for v in valid])
580 raise error.ConfigError(_("merge.checkunknown not valid "
581 "('%s' is none of %s)")
582 % (config, validstr))
583
586 config = _getcheckunknownconfig(repo, 'merge', 'checkunknown')
584 587 for f, (m, args, msg) in actions.iteritems():
585 588 if m in ('c', 'dc'):
586 589 if _checkunknownfile(repo, wctx, mctx, f):
General Comments 0
You need to be logged in to leave comments. Login now