Commit Graph

16 Commits

Author SHA1 Message Date
Pierre-Yves David
d482e52866 help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now
The ability to negate any boolean flags itself is great, but I think we are not
ready to expose the help side of it yet.

First, while there exist a handful of such flags whose default value can be
changed (eg: git diff, patchwork confirmation), there is only a few of them. The
users who benefit the most from this change are alias users and large
installation that can deploy extension to change behavior (eg: facebook
tweakdefault).  So the majority of user who will be affected by a large change
to command help that is not yet relevant to them. (I expect this to become
relevant when ui.progressive start to exists).

Below is an example of the impact of the new help on 'hg help diff':

  -r --rev REV [+]              revision
  -c --change REV               change made by revision
  -a --[no-]text                treat all files as text
  -g --[no-]git                 use git extended diff format
     --[no-]nodates             omit dates from diff headers
     --[no-]noprefix            omit a/ and b/ prefixes from filenames
  -p --[no-]show-function       show which function each change is in
     --[no-]reverse             produce a diff that undoes the changes
  -w --[no-]ignore-all-space    ignore white space when comparing lines
  -b --[no-]ignore-space-change ignore changes in the amount of white space
  -B --[no-]ignore-blank-lines  ignore changes whose lines are all blank
  -U --unified NUM              number of lines of context to show
     --[no-]stat                output diffstat-style summary of changes
     --root DIR                 produce diffs relative to subdirectory
  -I --include PATTERN [+]      include names matching the given patterns
  -X --exclude PATTERN [+]      exclude names matching the given patterns
  -S --[no-]subrepos            recurse into subrepositories

Another issue with the current state of help, the default value for the
flag is not conveyed to the user. For example in the 'backout' help, there is
no real distinction between "--[no-]backup" (default to True) and "--[no-]keep"
(default) to False:

  --[no-]backup        no backups
  --[no-]keep          do not modify working directory during strip

In addition, I've discussed with Augie Fackler and the last batch of the work on
this have burned him out quite some. Therefore he is not intending to perform
any more work on this topic. Quoting him, he would rather see the help part
backed out than spending more time on it.

I do not think we are ready to expose this to users in 4.0 (freeze in a week),
especially because we cannot expect quick improvement on these aspect as this
topic no longer have an owner. We should be able to reintroduce that change in
the future when someone get back on it and the main issues are solves:

* Introduction of  ui.progressive makes it relevant for a majority of user,
* Current default value are efficiently conveyed to the user.

(In addition, the excerpt from diff help show that we still have some issue with
some negative option like '--nodates' so further improvement are probably
welcome there.)
2016-10-09 03:11:18 +02:00
Augie Fackler
8843ab4c98 help: mark boolean flags with [no-] to explain that they can be negated
That is, help gets tweaked thus:

  global options ([+] can be repeated):
   -v --[no-]verbose      enable additional output


Other proposals have included:

  global options ([+] can be repeated, options marked [?] are boolean flags):
   -v --verbose[?]        enable additional output

and

  global options ([+] can be repeated, options marked [^] are boolean flags):
   -v --verbose[^]        enable additional output

which avoid the unfortunate visual noise in this patch. In this
version's favor, it's consistent with what I'm used to seeing in man
pages and similar documentation venues.
2016-09-13 22:58:12 -04:00
timeless
5fd9e9e1b5 help: use single quotes in use warning 2016-09-20 23:47:46 +00:00
Matt Mackall
68762ac0d2 help: fold repeatable option message into option table header
This will hopefully conserve some limited user attention.
2014-08-12 04:00:42 -05:00
Matt Mackall
106c32f507 help: improve command summary hint
This adds our normal hint parentheses, corrects the command syntax
(consider config), and corrects the fullness of help you'll get.
2014-08-12 03:09:26 -05:00
Mads Kiilerich
4f2a779466 tests: fix for windows - slashes and no serve 2013-01-30 19:40:07 +01:00
Mads Kiilerich
5584e7ca16 dispatch: show empty filename in OSError aborts
Mercurial would sometimes exit with:
  abort: No such file or directory
where str of the actual OSError exception was the more helpful:
  [Errno 2] No such file or directory: ''

The exception will now always show the filename and quote it:
  abort: No such file or directory: ''
2013-01-07 02:00:29 +01:00
Mads Kiilerich
33fe5e6036 test-dispatch.t: remove incorrect "cd $dir"
A line that should have been removed in 8041254f9d0f.
2013-01-06 04:04:44 +01:00
Mads Kiilerich
db42f91a88 tests: convert some 'hghave no-outer-repo' to #if
In some places we instead use 'hg init' to create a well-known outer repo
without any special extensions or other config settings.
2012-06-20 23:41:21 +02:00
Matt Mackall
4204f3ffa5 help: use RST to format option lists 2011-09-21 13:00:48 -05:00
Nicolas Dumazet
561d5dd9fb tests: move test-issue436 in test-dispatch where fancyopts is tested 2011-04-30 17:38:06 +02:00
Matt Mackall
a33ce77f33 dispatch: improve repository not found message
This should help clarify what the problem is in various problematic
cases like ssh.
2011-04-20 14:28:40 -05:00
Adrian Buehlmann
3efb31d590 help: do not show full help text for command on option errors
Example

  $ hg clone --jump foo bar
  hg clone: option --jump not recognized
  hg clone [OPTION]... SOURCE [DEST]

  make a copy of an existing repository

  options:

   -U --noupdate           the clone will include an empty working copy (only a
                           repository)
   -u --updaterev REV      revision, tag or branch to check out
   -r --rev REV [+]        include the specified changeset
   -b --branch BRANCH [+]  clone only the specified branch
      --pull               use pull protocol to copy metadata
      --uncompressed       use uncompressed transfer (fast over LAN)
   -e --ssh CMD            specify ssh command to use
      --remotecmd CMD      specify hg command to run on the remote side
      --insecure           do not verify server certificate (ignoring
                           web.cacerts config)

  [+] marked option can be specified multiple times

  use "hg help clone" to show the full help text

Motivation for this change

  If the user already has specified the command, he probably already knows
  the command to some extent. Apparently, he has a problem with the options,
  so we show him just the synopsis with the short help and the details about
  the options, with a hint on the last line how to get the full help text.

Why is Mercurial better with this change?

  Experts who just forgot about the details of an option don't get that
  much text thrown at them, while the newbies still get a hint on the last
  line how to get the full help text.
2011-04-17 11:37:11 +02:00
Matt Mackall
bf9417da11 tests: exit 0 no longer needed on unified tests 2010-09-17 17:03:04 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Adrian Buehlmann
9686dc8dba tests: unify test-dispatch 2010-09-02 17:13:23 +02:00