Commit Graph

10 Commits

Author SHA1 Message Date
Mads Kiilerich
29285eb86d ui: show prompt choice if input is not a tty but is forced to be interactive
The tests often set ui.interactive to control normally interactive prompts from
stdin. That gave an output where it was non-obvious what prompts got which
which response, and the output lacked the newline users would see after input.

Instead, if the input not is a tty, write the selection and a newline.
2014-10-01 01:04:18 +02: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
540b8eb745 help: tweak --verbose command help hint
We used to have two slightly different message which people wouldn't read...
and then complain that they couldn't find the global options or examples.

So we unify them into one message that's upfront that STUFF IS
INTENTIONALLY HIDDEN and that looks more like our normal hint style.
2014-08-12 03:01:37 -05:00
FUJIWARA Katsunori
5f213b8584 doc: unify help text for "--edit" option
This patch changes help text for "--edit" option of commands below:

  - fetch
  - qnew
  - qrefresh
  - qfold
  - commit
  - tag

This unification reduces translation cost, too.

This patch chooses not "further edit commit message already specified"
(of "hg commit") but "invoke editor on commit messages" as unified
help text for "--edit" option, because the latter is much older than
the former.
2014-07-30 00:14:52 +09:00
FUJIWARA Katsunori
477c2590ac help: indicate help omitting if help document is not fully displayed
Before this patch, there is no information about whether help document
is fully displayed or not.

So, some users seem to misunderstand "-v" for "hg help" just as "the
option to show list of global options": experience on "hg help -v" for
some commands not containing verbose containers may strengthen this
misunderstanding.

Such users have less opportunity for noticing omitted help document,
and this may cause insufficient understanding about Mercurial.

This patch indicates help omitting, if help document is not fully
displayed.

For command help, the message below is displayed at the end of help
output, if help document is not fully displayed:

    use "hg -v help xxxx" to show more complete help and the global
    options

and otherwise:

    use "hg -v help xxxx" to show the global options

For topics and extensions help, the message below is displayed, only
if help document is not fully displayed:

    use "hg help -v xxxx" to show more complete help

This allows users to know whether there is any omitted information or
not exactly, and can trigger "hg help -v" invocation.

This patch causes formatting help document twice, to switch messages
one for omitted help, and another for not omitted. This decreases
performance of help document formatting, but it is not mainly focused
at help command invocation, so this wouldn't become problem.
2012-10-18 10:31:15 +09:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
A. S. Budden
285680e0f0 record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines.  The
current record extension does not allow these to be committed independently.

An example use case for this is in software development for deeply embedded
real-time systems.  In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used.  When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong.  printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository.  If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines.  This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest.  It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.

There were two alternatives I considered for the user interface.  One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration.  The latter option would require a significant
refactor of the record module and is less flexible.  While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.

I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable.  This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there.  It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.

Possible future improvements include:

* Tidying up the 'prompt' code to base everything on the choices variable.
  This would allow entries to be removed from the prompt as currently 'e' is
  offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
  this would require quite a large refactor without much benefit, so I decided
  to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
  This would require quite a bit of refactoring given the current 'hg record'
  implementation, so it's debatable whether it's worth it.

Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch.  This opens the
user's configured editor with the patch.  A comment is added to the bottom of
the patch explaining what to do (based on Git's one).

A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?).  Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-30 22:08:46 +01:00
Matt Mackall
58c81fa35e help: unify the two -v notes for command help 2011-10-07 16:36:54 -05:00
Matt Mackall
4204f3ffa5 help: use RST to format option lists 2011-09-21 13:00:48 -05:00
Idan Kamara
dcebc5aaa6 record: add qrefresh -i/--interactive
interactively select changes to refresh
2011-05-24 19:17:19 +03:00