Patchwork resolve: report no argument warning using a hint

login
register
mail settings
Submitter Nathan Goldbaum
Date July 24, 2014, 9:41 p.m.
Message ID <bba64b611762854c2da2.1406238103@ROUS>
Download mbox | patch
Permalink /patch/5198/
State Accepted
Commit 9209c02f1f2548045f37f4a0f617723079503028
Headers show

Comments

Nathan Goldbaum - July 24, 2014, 9:41 p.m.
# HG changeset patch
# User Nathan Goldbaum <ngoldbau@ucsc.edu>
# Date 1406237348 25200
#      Thu Jul 24 14:29:08 2014 -0700
# Node ID bba64b611762854c2da2a08d5a343fd0378b8a4b
# Parent  7142e04b438eab39685e63085503b8af0e42b31e
resolve: report no argument warning using a hint

With this change resolve and revert produce consistent output when run with no
arguments:

$ hg resolve
abort: no files or directories specified
(use --all to remerge all files)

$ hg revert
abort: no files or directories specified
(use --all to revert all files)
Matt Mackall - July 25, 2014, 4:52 p.m.
On Thu, 2014-07-24 at 14:41 -0700, Nathan Goldbaum wrote:
> # HG changeset patch
> # User Nathan Goldbaum <ngoldbau@ucsc.edu>
> # Date 1406237348 25200
> #      Thu Jul 24 14:29:08 2014 -0700
> # Node ID bba64b611762854c2da2a08d5a343fd0378b8a4b
> # Parent  7142e04b438eab39685e63085503b8af0e42b31e
> resolve: report no argument warning using a hint

Patch queued for stable, thanks.

Patch

diff -r 7142e04b438e -r bba64b611762 mercurial/commands.py
--- a/mercurial/commands.py	Fri Jul 18 19:46:56 2014 -0400
+++ b/mercurial/commands.py	Thu Jul 24 14:29:08 2014 -0700
@@ -4994,8 +4994,8 @@ 
     if pats and all:
         raise util.Abort(_("can't specify --all and patterns"))
     if not (all or pats or show or mark or unmark):
-        raise util.Abort(_('no files or directories specified; '
-                           'use --all to remerge all files'))
+        raise util.Abort(_('no files or directories specified'),
+                         hint=('use --all to remerge all files'))
 
     wlock = repo.wlock()
     try:
diff -r 7142e04b438e -r bba64b611762 tests/test-merge9.t
--- a/tests/test-merge9.t	Fri Jul 18 19:46:56 2014 -0400
+++ b/tests/test-merge9.t	Thu Jul 24 14:29:08 2014 -0700
@@ -76,7 +76,8 @@ 
 
 resolve all warning
   $ hg resolve
-  abort: no files or directories specified; use --all to remerge all files
+  abort: no files or directories specified
+  (use --all to remerge all files)
   [255]
 
 resolve all