Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 22234:fe9fc29ac2d0
revert: add a message to noop action
This prepares for the arrival of a second "not touching file" action:
revert of an untracked file.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 02 Aug 2014 13:07:01 -0700 |
parents | 4ab61b24e20c |
children | 41a07d4f909f |
comparison
equal
deleted
inserted
replaced
22233:4ab61b24e20c | 22234:fe9fc29ac2d0 |
---|---|
2468 # (<list of file>, message>) tuple | 2468 # (<list of file>, message>) tuple |
2469 actions = {'revert': ([], _('reverting %s\n')), | 2469 actions = {'revert': ([], _('reverting %s\n')), |
2470 'add': ([], _('adding %s\n')), | 2470 'add': ([], _('adding %s\n')), |
2471 'remove': ([], removeforget), | 2471 'remove': ([], removeforget), |
2472 'undelete': ([], _('undeleting %s\n')), | 2472 'undelete': ([], _('undeleting %s\n')), |
2473 'noop': (None, None), | 2473 'noop': (None, _('no changes needed to %s\n')), |
2474 } | 2474 } |
2475 | 2475 |
2476 | 2476 |
2477 # should we do a backup? | 2477 # should we do a backup? |
2478 backup = not opts.get('no_backup') | 2478 backup = not opts.get('no_backup') |
2512 if ui.verbose or not exact: | 2512 if ui.verbose or not exact: |
2513 if not isinstance(msg, basestring): | 2513 if not isinstance(msg, basestring): |
2514 msg = msg(abs) | 2514 msg = msg(abs) |
2515 ui.status(msg % rel) | 2515 ui.status(msg % rel) |
2516 elif exact: | 2516 elif exact: |
2517 ui.warn(_('no changes needed to %s\n') % rel) | 2517 ui.warn(msg % rel) |
2518 break | 2518 break |
2519 else: | 2519 else: |
2520 # Not touched in current dirstate. | 2520 # Not touched in current dirstate. |
2521 | 2521 |
2522 # file is unknown in parent, restore older version or ignore. | 2522 # file is unknown in parent, restore older version or ignore. |