Patchwork [1,of,4] revert: add a message to noop action

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 18, 2014, 11:36 p.m.
Message ID <8fd7b8a721f0fa8b35f0.1408405010@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5482/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 18, 2014, 11:36 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1407010021 25200
#      Sat Aug 02 13:07:01 2014 -0700
# Node ID 8fd7b8a721f0fa8b35f02354b643bfc73c6f0524
# Parent  66e2897ab70fa5a2d7ff58aa8c93419294045244
revert: add a message to noop action

This prepare the arrival of a second "not touching file" action: revert on
untracked file.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2468,11 +2468,11 @@  def revert(ui, repo, ctx, parents, *pats
         # (<list of file>, message>) tuple
         actions = {'revert': ([], _('reverting %s\n')),
                    'add': ([], _('adding %s\n')),
                    'remove': ([], removeforget),
                    'undelete': ([], _('undeleting %s\n')),
-                   'noop': (None, None),
+                   'noop': (None, _('no changes needed to %s\n')),
                   }
 
 
         # should we do a backup ?
         backup = not opts.get('no_backup')
@@ -2512,11 +2512,11 @@  def revert(ui, repo, ctx, parents, *pats
                     if ui.verbose or not exact:
                         if not isinstance(msg, basestring):
                             msg = msg(abs)
                         ui.status(msg % rel)
                 elif exact:
-                        ui.warn(_('no changes needed to %s\n') % rel)
+                        ui.warn(msg % rel)
                 break
             else:
                 # Not touched in current dirstate.
 
                 # file is unknown in parent, restore older version or ignore.