tests/test-paths.t
author Adrian Buehlmann <adrian@cadifra.com>
Sun, 17 Apr 2011 11:37:11 +0200
changeset 13950 14d0553bd48b
parent 13797 16d5e80876de
child 14331 3b9a896af09c
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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11785
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     1
  $ hg init a
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     2
  $ hg clone a b
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     3
  updating to branch default
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     4
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     5
  $ cd a
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     6
  $ echo '[paths]' >> .hg/hgrc
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     7
  $ echo 'dupe = ../b' >> .hg/hgrc
12662
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
     8
  $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc
11785
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
     9
  $ hg in dupe
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12587
diff changeset
    10
  comparing with $TESTTMP/b
11785
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
    11
  no changes found
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11785
diff changeset
    12
  [1]
11785
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
    13
  $ cd ..
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
    14
  $ hg -R a in dupe
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12587
diff changeset
    15
  comparing with $TESTTMP/b
11785
7d9be960cd9a tests: unify test-paths
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 5951
diff changeset
    16
  no changes found
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11785
diff changeset
    17
  [1]
12662
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    18
  $ cd a
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    19
  $ hg paths
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    20
  dupe = $TESTTMP/b
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    21
  expand = $TESTTMP/a/$SOMETHING/bar
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    22
  $ SOMETHING=foo hg paths
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    23
  dupe = $TESTTMP/b
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    24
  expand = $TESTTMP/a/foo/bar
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    25
  $ SOMETHING=/foo hg paths
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    26
  dupe = $TESTTMP/b
7285b2824fb7 ui.paths: expand paths directly in fixconfig (issue2373)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 12640
diff changeset
    27
  expand = /foo/bar
13797
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    28
  $ cd ..
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    29
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    30
'file:' disables [paths] entries for clone destination
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    31
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    32
  $ cat >> $HGRCPATH <<EOF
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    33
  > [paths]
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    34
  > gpath1 = http://hg.example.com
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    35
  > EOF
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    36
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    37
  $ hg clone a gpath1
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    38
  abort: cannot create new http repository
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    39
  [255]
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    40
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    41
  $ hg clone a file:gpath1
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    42
  updating to branch default
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    43
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    44
  $ cd gpath1
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    45
  $ hg -q id
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    46
  000000000000
16d5e80876de test-paths.t: 'file:' disables [paths] entries for clone dest
Adrian Buehlmann <adrian@cadifra.com>
parents: 12662
diff changeset
    47