comparison mercurial/sparse.py @ 33355:9087f9997f42

sparse: move printing of sparse config changes function into core As part of the port, all arguments now have default values of 0. Strings are now also given the i18n treatment.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Jul 2017 13:34:19 -0700
parents 4695f1829045
children ccb3e5399921
comparison
equal deleted inserted replaced
33354:4695f1829045 33355:9087f9997f42
510 510
511 oldstatus = repo.status() 511 oldstatus = repo.status()
512 oldmatch = matcher(repo) 512 oldmatch = matcher(repo)
513 writeconfig(repo, set(), set(), profiles) 513 writeconfig(repo, set(), set(), profiles)
514 refreshwdir(repo, oldstatus, oldmatch, force=force) 514 refreshwdir(repo, oldstatus, oldmatch, force=force)
515
516 def printchanges(ui, opts, profilecount=0, includecount=0, excludecount=0,
517 added=0, dropped=0, conflicting=0):
518 """Print output summarizing sparse config changes."""
519 with ui.formatter('sparse', opts) as fm:
520 fm.startitem()
521 fm.condwrite(ui.verbose, 'profiles_added', _('Profiles changed: %d\n'),
522 profilecount)
523 fm.condwrite(ui.verbose, 'include_rules_added',
524 _('Include rules changed: %d\n'), includecount)
525 fm.condwrite(ui.verbose, 'exclude_rules_added',
526 _('Exclude rules changed: %d\n'), excludecount)
527
528 # In 'plain' verbose mode, mergemod.applyupdates already outputs what
529 # files are added or removed outside of the templating formatter
530 # framework. No point in repeating ourselves in that case.
531 if not fm.isplain():
532 fm.condwrite(ui.verbose, 'files_added', _('Files added: %d\n'),
533 added)
534 fm.condwrite(ui.verbose, 'files_dropped', _('Files dropped: %d\n'),
535 dropped)
536 fm.condwrite(ui.verbose, 'files_conflicting',
537 _('Files conflicting: %d\n'), conflicting)