tests/test-hgweb-descend-empties.t
author Adrian Buehlmann <adrian@cadifra.com>
Sun, 17 Apr 2011 11:37:11 +0200
changeset 13950 14d0553bd48b
parent 13597 38c9837b1f75
child 14046 b24e5a708fad
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.

Test chains of near empty directories, terminating 3 different ways:
- a1: file at level 4 (deepest)
- b1: two dirs at level 3
- e1: file at level 2

Set up the repo

  $ hg init test
  $ cd test
  $ mkdir -p a1/a2/a3/a4
  $ mkdir -p b1/b2/b3/b4
  $ mkdir -p b1/b2/c3/c4
  $ mkdir -p d1/d2/d3/d4
  $ echo foo > a1/a2/a3/a4/foo
  $ echo foo > b1/b2/b3/b4/foo
  $ echo foo > b1/b2/c3/c4/foo
  $ echo foo > d1/d2/d3/d4/foo
  $ echo foo > d1/d2/foo
  $ hg ci -Ama
  adding a1/a2/a3/a4/foo
  adding b1/b2/b3/b4/foo
  adding b1/b2/c3/c4/foo
  adding d1/d2/d3/d4/foo
  adding d1/d2/foo
  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
  $ cat hg.pid >> $DAEMON_PIDS

manifest with descending

  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file'
  200 Script output follows
  
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
  <head>
  <link rel="icon" href="/static/hgicon.png" type="image/png" />
  <meta name="robots" content="index, nofollow" />
  <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
  
  <title>test: 9087c84a0f5d /</title>
  </head>
  <body>
  
  <div class="container">
  <div class="menu">
  <div class="logo">
  <a href="http://mercurial.selenic.com/">
  <img src="/static/hglogo.png" alt="mercurial" /></a>
  </div>
  <ul>
  <li><a href="/shortlog/9087c84a0f5d">log</a></li>
  <li><a href="/graph/9087c84a0f5d">graph</a></li>
  <li><a href="/tags">tags</a></li>
  <li><a href="/bookmarks">bookmarks</a></li>
  <li><a href="/branches">branches</a></li>
  </ul>
  <ul>
  <li><a href="/rev/9087c84a0f5d">changeset</a></li>
  <li class="active">browse</li>
  </ul>
  <ul>
  
  </ul>
  <ul>
   <li><a href="/help">help</a></li>
  </ul>
  </div>
  
  <div class="main">
  <h2><a href="/">test</a></h2>
  <h3>directory / @ 0:9087c84a0f5d <span class="tag">tip</span> </h3>
  
  <form class="search" action="/log">
  
  <p><input name="rev" id="search1" type="text" size="30" /></p>
  <div id="hint">find changesets by author, revision,
  files, or words in the commit message</div>
  </form>
  
  <table class="bigtable">
  <tr>
    <th class="name">name</th>
    <th class="size">size</th>
    <th class="permissions">permissions</th>
  </tr>
  <tr class="fileline parity0">
    <td class="name"><a href="/file/9087c84a0f5d/">[up]</a></td>
    <td class="size"></td>
    <td class="permissions">drwxr-xr-x</td>
  </tr>
  
  <tr class="fileline parity1">
  <td class="name">
  <a href="/file/9087c84a0f5d/a1">
  <img src="/static/coal-folder.png" alt="dir."/> a1/
  </a>
  <a href="/file/9087c84a0f5d/a1/a2/a3/a4">
  a2/a3/a4
  </a>
  </td>
  <td class="size"></td>
  <td class="permissions">drwxr-xr-x</td>
  </tr>
  <tr class="fileline parity0">
  <td class="name">
  <a href="/file/9087c84a0f5d/b1">
  <img src="/static/coal-folder.png" alt="dir."/> b1/
  </a>
  <a href="/file/9087c84a0f5d/b1/b2">
  b2
  </a>
  </td>
  <td class="size"></td>
  <td class="permissions">drwxr-xr-x</td>
  </tr>
  <tr class="fileline parity1">
  <td class="name">
  <a href="/file/9087c84a0f5d/d1">
  <img src="/static/coal-folder.png" alt="dir."/> d1/
  </a>
  <a href="/file/9087c84a0f5d/d1/d2">
  d2
  </a>
  </td>
  <td class="size"></td>
  <td class="permissions">drwxr-xr-x</td>
  </tr>
  
  </table>
  </div>
  </div>
  
  
  </body>
  </html>
  

  $ cat errors.log