Mercurial > hg
annotate tests/test-record.t @ 30152:d65e246100ed
help: backout f3c4edfd35e1 (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.)
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sun, 09 Oct 2016 03:11:18 +0200 |
parents | f3c4edfd35e1 |
children | 1baa0e2cfc37 |
rev | line source |
---|---|
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
1 Set up a repo |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
2 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
3 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
4 > [ui] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
5 > interactive = true |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
6 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
7 > record = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23054
diff
changeset
|
8 > EOF |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 |
12074
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
10 $ hg init a |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
11 $ cd a |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
12 |
24308
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
13 Record help |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
14 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
15 $ hg record -h |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
16 hg record [OPTION]... [FILE]... |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
17 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
18 interactively select changes to commit |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
19 |
27729
58f8b29c37ff
minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents:
25304
diff
changeset
|
20 If a list of files is omitted, all changes reported by 'hg status' will be |
24308
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
21 candidates for recording. |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
22 |
27729
58f8b29c37ff
minirst: change hgrole to use single quotes
timeless <timeless@mozdev.org>
parents:
25304
diff
changeset
|
23 See 'hg help dates' for a list of formats valid for -d/--date. |
24308
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
24 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
25 You will be prompted for whether to record changes to each modified file, |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
26 and for files with multiple changes, for each change to use. For each |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
27 query, the following responses are possible: |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
28 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
29 y - record this change |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
30 n - skip this change |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
31 e - edit this change manually |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
32 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
33 s - skip remaining changes to this file |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
34 f - record remaining changes to this file |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
35 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
36 d - done, skip remaining changes and files |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
37 a - record all changes to all remaining files |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
38 q - quit, recording no changes |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
39 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
40 ? - display help |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
41 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
42 This command is not available when committing a merge. |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
43 |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
28697
diff
changeset
|
44 (use 'hg help -e record' to show help for the record extension) |
28697
d001d6d27570
record: deprecate the extension
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
27729
diff
changeset
|
45 |
24308
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
46 options ([+] can be repeated): |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
47 |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
48 -A --addremove mark new/missing files as added/removed before |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
49 committing |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
50 --close-branch mark a branch head as closed |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
51 --amend amend the parent of the working directory |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
52 -s --secret use the secret phase for committing |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
53 -e --edit invoke editor on commit messages |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
54 -I --include PATTERN [+] include names matching the given patterns |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
55 -X --exclude PATTERN [+] exclude names matching the given patterns |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
56 -m --message TEXT use text as commit message |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
57 -l --logfile FILE read commit message from file |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
58 -d --date DATE record the specified date as commit date |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
59 -u --user USER record the specified user as committer |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
60 -S --subrepos recurse into subrepositories |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
61 -w --ignore-all-space ignore white space when comparing lines |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
62 -b --ignore-space-change ignore changes in the amount of white space |
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
63 -B --ignore-blank-lines ignore changes whose lines are all blank |
24308
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
64 |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
65 (some details hidden, use --verbose to show complete help) |
1725843a7644
record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com>
parents:
24235
diff
changeset
|
66 |
12074
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
67 Select no files |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 |
12074
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
69 $ touch empty-rw |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
70 $ hg add empty-rw |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
71 |
12074
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
72 $ hg record empty-rw<<EOF |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
73 > n |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
74 > EOF |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
75 diff --git a/empty-rw b/empty-rw |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
76 new file mode 100644 |
22589
9ab18a912c44
ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents:
20580
diff
changeset
|
77 examine changes to 'empty-rw'? [Ynesfdaq?] n |
9ab18a912c44
ui: show prompt choice if input is not a tty but is forced to be interactive
Mads Kiilerich <madski@unity3d.com>
parents:
20580
diff
changeset
|
78 |
12074
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
79 no changes to record |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
80 |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
81 $ hg tip -p |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
82 changeset: -1:000000000000 |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
83 tag: tip |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
84 user: |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
85 date: Thu Jan 01 00:00:00 1970 +0000 |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
86 |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
87 |
35c143e85b1b
tests: unify test-record
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11238
diff
changeset
|
88 |
5037
b2607267236d
Add record extension, giving darcs-like interactive hunk picking
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
89 |