tests/test-issue522.t
author Adrian Buehlmann <adrian@cadifra.com>
Sun, 17 Apr 2011 11:37:11 +0200
changeset 13950 14d0553bd48b
parent 12328 b63f6422d2a7
child 14182 ec5886db9dc6
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.

http://mercurial.selenic.com/bts/issue522

In the merge below, the file "foo" has the same contents in both
parents, but if we look at the file-level history, we'll notice that
the version in p1 is an ancestor of the version in p2. This test makes
sure that we'll use the version from p2 in the manifest of the merge
revision.

  $ hg init

  $ echo foo > foo
  $ hg ci -qAm 'add foo'

  $ echo bar >> foo
  $ hg ci -m 'change foo'

  $ hg backout -r tip -m 'backout changed foo'
  reverting foo
  changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e

  $ hg up -C 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  $ touch bar
  $ hg ci -qAm 'add bar'

  $ hg merge --debug
    searching for copies back to rev 1
    unmatched files in local:
     bar
  resolving manifests
   overwrite None partial False
   ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee
   foo: remote is newer -> g
  updating: foo 1/1 files (100.00%)
  getting foo
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)

  $ hg debugstate | grep foo
  n   0         -2 unset               foo

  $ hg st -A foo
  M foo

  $ hg ci -m 'merge'

  $ hg manifest --debug | grep foo
  c6fc755d7e68f49f880599da29f15add41f42f5a 644   foo

  $ hg debugindex .hg/store/data/foo.i
     rev    offset  length   base linkrev nodeid       p1           p2
       0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
       1         5       9      1       1 6f4310b00b9a 2ed2a3912a0b 000000000000
       2        14       5      2       2 c6fc755d7e68 6f4310b00b9a 000000000000