comparison mercurial/commands.py @ 2412:e5cb39577b9f

addremove: add -n/--dry-run option
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 09 Jun 2006 08:42:36 -0700
parents 734df6333ca4
children c1ec81319870
comparison
equal deleted inserted replaced
2411:734df6333ca4 2412:e5cb39577b9f
669 ui.status(_('adding %s\n') % ((pats and rel) or abs)) 669 ui.status(_('adding %s\n') % ((pats and rel) or abs))
670 if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel): 670 if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
671 remove.append(abs) 671 remove.append(abs)
672 if ui.verbose or not exact: 672 if ui.verbose or not exact:
673 ui.status(_('removing %s\n') % ((pats and rel) or abs)) 673 ui.status(_('removing %s\n') % ((pats and rel) or abs))
674 repo.add(add, wlock=wlock) 674 if not opts.get('dry_run'):
675 repo.remove(remove, wlock=wlock) 675 repo.add(add, wlock=wlock)
676 repo.remove(remove, wlock=wlock)
676 677
677 def annotate(ui, repo, *pats, **opts): 678 def annotate(ui, repo, *pats, **opts):
678 """show changeset information per file line 679 """show changeset information per file line
679 680
680 List changes in files, showing the revision id responsible for each line 681 List changes in files, showing the revision id responsible for each line
2806 ('n', 'dry-run', None, _('print what would be done'))], 2807 ('n', 'dry-run', None, _('print what would be done'))],
2807 _('hg add [OPTION]... [FILE]...')), 2808 _('hg add [OPTION]... [FILE]...')),
2808 "debugaddremove|addremove": 2809 "debugaddremove|addremove":
2809 (addremove, 2810 (addremove,
2810 [('I', 'include', [], _('include names matching the given patterns')), 2811 [('I', 'include', [], _('include names matching the given patterns')),
2811 ('X', 'exclude', [], _('exclude names matching the given patterns'))], 2812 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2813 ('n', 'dry-run', None, _('print what would be done'))],
2812 _('hg addremove [OPTION]... [FILE]...')), 2814 _('hg addremove [OPTION]... [FILE]...')),
2813 "^annotate": 2815 "^annotate":
2814 (annotate, 2816 (annotate,
2815 [('r', 'rev', '', _('annotate the specified revision')), 2817 [('r', 'rev', '', _('annotate the specified revision')),
2816 ('a', 'text', None, _('treat all files as text')), 2818 ('a', 'text', None, _('treat all files as text')),