tests/test-convert-p4.out
author Adrian Buehlmann <adrian@cadifra.com>
Sun, 17 Apr 2011 11:37:11 +0200
changeset 13950 14d0553bd48b
parent 8063 ee8d9b93b316
permissions -rw-r--r--
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.

% create p4 depot
% start the p4 server
% create a client spec
Client hg-p4-import saved.
% populate the depot
//depot/test-mercurial-import/a#1 - opened for add
//depot/test-mercurial-import/b/c#1 - opened for add
Submitting change 1.
Locking 2 files ...
add //depot/test-mercurial-import/a#1
add //depot/test-mercurial-import/b/c#1
Change 1 submitted.
% change some files
//depot/test-mercurial-import/a#1 - opened for edit
Submitting change 2.
Locking 1 files ...
edit //depot/test-mercurial-import/a#2
Change 2 submitted.
//depot/test-mercurial-import/b/c#1 - opened for edit
Submitting change 3.
Locking 1 files ...
edit //depot/test-mercurial-import/b/c#2
Change 3 submitted.
% convert
initializing destination dst repository
reading p4 views
collecting p4 changelists
1 initial
2 change a
3 change b/c
scanning source...
sorting...
converting...
2 initial
1 change a
0 change b/c
rev=2 desc="change b/c" tags="tip" files="b/c"
rev=1 desc="change a" tags="" files="a"
rev=0 desc="initial" tags="" files="a b/c"
% change some files
//depot/test-mercurial-import/a#2 - opened for edit
//depot/test-mercurial-import/b/c#2 - opened for edit
Submitting change 4.
Locking 2 files ...
edit //depot/test-mercurial-import/a#3
edit //depot/test-mercurial-import/b/c#3
Change 4 submitted.
% convert again
reading p4 views
collecting p4 changelists
1 initial
2 change a
3 change b/c
4 change a b/c
scanning source...
sorting...
converting...
0 change a b/c
rev=3 desc="change a b/c" tags="tip" files="a b/c"
rev=2 desc="change b/c" tags="" files="b/c"
rev=1 desc="change a" tags="" files="a"
rev=0 desc="initial" tags="" files="a b/c"
% interesting names
//depot/test-mercurial-import/d d#1 - opened for add
//depot/test-mercurial-import/ e/ f#1 - opened for add
Submitting change 5.
Locking 2 files ...
add //depot/test-mercurial-import/ e/ f#1
add //depot/test-mercurial-import/d d#1
Change 5 submitted.
% convert again
reading p4 views
collecting p4 changelists
1 initial
2 change a
3 change b/c
4 change a b/c
5 add d e f
scanning source...
sorting...
converting...
0 add d e f
rev=4 desc="add d e f" tags="tip" files=" e/ f d d"
rev=3 desc="change a b/c" tags="" files="a b/c"
rev=2 desc="change b/c" tags="" files="b/c"
rev=1 desc="change a" tags="" files="a"
rev=0 desc="initial" tags="" files="a b/c"
% stop the p4 server