Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 2413:c1ec81319870
copy: add -n/--dry-run option
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 09 Jun 2006 08:48:30 -0700 |
parents | e5cb39577b9f |
children | 86e07466bcfc |
comparison
equal
deleted
inserted
replaced
2412:e5cb39577b9f | 2413:c1ec81319870 |
---|---|
1170 continue | 1170 continue |
1171 copylist.append((tfn(pat, dest, srcs), srcs)) | 1171 copylist.append((tfn(pat, dest, srcs), srcs)) |
1172 if not copylist: | 1172 if not copylist: |
1173 raise util.Abort(_('no files to copy')) | 1173 raise util.Abort(_('no files to copy')) |
1174 | 1174 |
1175 for targetpath, srcs in copylist: | 1175 if not opts.get('dry_run'): |
1176 for origsrc, abssrc, relsrc, exact in srcs: | 1176 for targetpath, srcs in copylist: |
1177 copy(origsrc, abssrc, relsrc, targetpath(abssrc), exact) | 1177 for origsrc, abssrc, relsrc, exact in srcs: |
1178 copy(origsrc, abssrc, relsrc, targetpath(abssrc), exact) | |
1178 | 1179 |
1179 if errors: | 1180 if errors: |
1180 ui.warn(_('(consider using --after)\n')) | 1181 ui.warn(_('(consider using --after)\n')) |
1181 return errors, copied | 1182 return errors, copied |
1182 | 1183 |
2880 (copy, | 2881 (copy, |
2881 [('A', 'after', None, _('record a copy that has already occurred')), | 2882 [('A', 'after', None, _('record a copy that has already occurred')), |
2882 ('f', 'force', None, | 2883 ('f', 'force', None, |
2883 _('forcibly copy over an existing managed file')), | 2884 _('forcibly copy over an existing managed file')), |
2884 ('I', 'include', [], _('include names matching the given patterns')), | 2885 ('I', 'include', [], _('include names matching the given patterns')), |
2885 ('X', 'exclude', [], _('exclude names matching the given patterns'))], | 2886 ('X', 'exclude', [], _('exclude names matching the given patterns')), |
2887 ('n', 'dry-run', None, _('print what would be done'))], | |
2886 _('hg copy [OPTION]... [SOURCE]... DEST')), | 2888 _('hg copy [OPTION]... [SOURCE]... DEST')), |
2887 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')), | 2889 "debugancestor": (debugancestor, [], _('debugancestor INDEX REV1 REV2')), |
2888 "debugcomplete": | 2890 "debugcomplete": |
2889 (debugcomplete, | 2891 (debugcomplete, |
2890 [('o', 'options', None, _('show the command options'))], | 2892 [('o', 'options', None, _('show the command options'))], |