changeset 12569:27e014189d3b

merge with iin
author Matt Mackall <mpm@selenic.com>
date Mon, 27 Sep 2010 10:47:36 -0500
parents dece1f46f7a2 (diff) 52f93dc2980b (current diff)
children aa0d842b4f5d
files
diffstat 355 files changed, 21725 insertions(+), 22276 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Sep 24 19:47:50 2010 -0300
+++ b/Makefile	Mon Sep 27 10:47:36 2010 -0500
@@ -43,9 +43,9 @@
 
 clean:
 	-$(PYTHON) setup.py clean --all # ignore errors from this command
-	find . -name '*.py[cdo]' -exec rm -f '{}' ';'
-	rm -f MANIFEST mercurial/__version__.py mercurial/*.so tests/*.err
-	rm -rf mercurial/locale
+	find . \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
+	rm -f MANIFEST mercurial/__version__.py tests/*.err
+	rm -rf build mercurial/locale
 	$(MAKE) -C doc clean
 
 install: install-bin install-doc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/vim/hgtest.vim	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,41 @@
+" Vim syntax file
+" Language: Mercurial unified tests
+" Author: Steve Losh (steve@stevelosh.com)
+"
+" Add the following line to your ~/.vimrc to enable:
+" au BufNewFile,BufRead *.t set filetype=hgtest
+"
+" If you want folding you'll need the following line as well:
+" let hgtest_fold=1
+"
+" You might also want to set the starting foldlevel for hgtest files:
+" autocmd Syntax hgtest setlocal foldlevel=1
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn include @Shell syntax/sh.vim
+
+syn match hgtestComment /^[^ ].*$/
+syn region hgtestOutput start=/^  [^$>]/ start=/^  $/ end=/\v.(\n\n*[^ ])\@=/me=s end=/^  [$>]/me=e-3 end=/^$/ fold containedin=hgtestBlock
+syn match hgtestCommandStart /^  \$ / containedin=hgtestCommand
+syn region hgtestCommand start=/^  \$ /hs=s+4,rs=s+4 end=/^  [^>]/me=e-3 end=/^  $/me=e-2 containedin=hgtestBlock contains=@Shell keepend
+syn region hgtestBlock start=/^  /ms=e-2 end=/\v.(\n\n*[^ ])\@=/me=s end=/^$/me=e-1 fold keepend
+
+hi link hgtestCommandStart Keyword
+hi link hgtestComment Normal
+hi link hgtestOutput Comment
+
+if exists("hgtest_fold")
+  setlocal foldmethod=syntax
+endif
+
+syn sync match hgtestSync grouphere NONE "^$"
+syn sync maxlines=200
+
+" It's okay to set tab settings here, because an indent of two spaces is specified
+" by the file format.
+setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
+
+let b:current_syntax = "hgtest"
--- a/hgext/keyword.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/hgext/keyword.py	Mon Sep 27 10:47:36 2010 -0500
@@ -92,8 +92,7 @@
 
 # hg commands that do not act on keywords
 nokwcommands = ('add addremove annotate bundle copy export grep incoming init'
-                ' log outgoing push rename rollback tip verify'
-                ' convert email glog')
+                ' log outgoing push rename tip verify convert email glog')
 
 # hg commands that trigger expansion only when writing to working dir,
 # not when reading filelog, and unexpand when reading from working dir
@@ -192,18 +191,20 @@
         Caveat: localrepository._link fails on Windows.'''
         return self.match(path) and not 'l' in flagfunc(path)
 
-    def overwrite(self, ctx, candidates, iswctx, expand):
+    def overwrite(self, ctx, candidates, iswctx, expand, cfiles):
         '''Overwrites selected files expanding/shrinking keywords.'''
-        if self.record:
-            candidates = [f for f in ctx.files() if f in ctx]
+        if cfiles is not None:
+            candidates = [f for f in candidates if f in cfiles]
         candidates = [f for f in candidates if self.iskwfile(f, ctx.flags)]
         if candidates:
+            restrict = self.restrict
             self.restrict = True        # do not expand when reading
+            rollback = kwtools['hgcmd'] == 'rollback'
             mf = ctx.manifest()
             msg = (expand and _('overwriting %s expanding keywords\n')
                    or _('overwriting %s shrinking keywords\n'))
             for f in candidates:
-                if not self.record:
+                if not self.record and not rollback:
                     data = self.repo.file(f).read(mf[f])
                 else:
                     data = self.repo.wread(f)
@@ -219,11 +220,11 @@
                 if found:
                     self.ui.note(msg % f)
                     self.repo.wwrite(f, data, mf.flags(f))
-                    if iswctx:
+                    if iswctx and not rollback:
                         self.repo.dirstate.normal(f)
                     elif self.record:
                         self.repo.dirstate.normallookup(f)
-            self.restrict = False
+            self.restrict = restrict
 
     def shrinktext(self, text):
         '''Unconditionally removes all keyword substitutions from text.'''
@@ -298,7 +299,7 @@
         modified, added, removed, deleted, unknown, ignored, clean = status
         if modified or added or removed or deleted:
             raise util.Abort(_('outstanding uncommitted changes'))
-        kwt.overwrite(wctx, clean, True, expand)
+        kwt.overwrite(wctx, clean, True, expand, None)
     finally:
         wlock.release()
 
@@ -502,9 +503,24 @@
             # no lock needed, only called from repo.commit() which already locks
             if not kwt.record:
                 kwt.overwrite(self[n], sorted(ctx.added() + ctx.modified()),
-                              False, True)
+                              False, True, None)
             return n
 
+        def rollback(self, dryrun=False):
+            wlock = repo.wlock()
+            try:
+                if not dryrun:
+                    cfiles = self['.'].files()
+                ret = super(kwrepo, self).rollback(dryrun)
+                if not dryrun:
+                    ctx = self['.']
+                    modified, added = super(kwrepo, self).status()[:2]
+                    kwt.overwrite(ctx, added, True, False, cfiles)
+                    kwt.overwrite(ctx, modified, True, True, cfiles)
+                return ret
+            finally:
+                wlock.release()
+
     # monkeypatches
     def kwpatchfile_init(orig, self, ui, fname, opener,
                          missing=False, eolmode=None):
@@ -516,12 +532,8 @@
 
     def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None,
                 opts=None, prefix=''):
-        '''Monkeypatch patch.diff to avoid expansion except when
-        comparing against working dir.'''
-        if node2 is not None:
-            kwt.match = util.never
-        elif node1 is not None and node1 != repo['.'].node():
-            kwt.restrict = True
+        '''Monkeypatch patch.diff to avoid expansion.'''
+        kwt.restrict = True
         return orig(repo, node1, node2, match, changes, opts, prefix)
 
     def kwweb_skip(orig, web, req, tmpl):
@@ -539,7 +551,8 @@
             ret = orig(ui, repo, commitfunc, *pats, **opts)
             recordctx = repo['.']
             if ctx != recordctx:
-                kwt.overwrite(recordctx, None, False, True)
+                kwt.overwrite(recordctx, recordctx.files(),
+                              False, True, recordctx)
             return ret
         finally:
             wlock.release()
@@ -547,8 +560,7 @@
     repo.__class__ = kwrepo
 
     extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init)
-    if not kwt.restrict:
-        extensions.wrapfunction(patch, 'diff', kw_diff)
+    extensions.wrapfunction(patch, 'diff', kw_diff)
     for c in 'annotate changeset rev filediff diff'.split():
         extensions.wrapfunction(webcommands, c, kwweb_skip)
     for name in recordextensions.split():
--- a/hgext/mq.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/hgext/mq.py	Mon Sep 27 10:47:36 2010 -0500
@@ -1753,7 +1753,9 @@
     return 0
 
 def applied(ui, repo, patch=None, **opts):
-    """print the patches already applied"""
+    """print the patches already applied
+
+    Returns 0 on success."""
 
     q = repo.mq
 
@@ -1776,11 +1778,14 @@
     else:
         start = 0
 
-    return q.qseries(repo, length=end, start=start, status='A',
-                     summary=opts.get('summary'))
+    q.qseries(repo, length=end, start=start, status='A',
+              summary=opts.get('summary'))
+
 
 def unapplied(ui, repo, patch=None, **opts):
-    """print the patches not yet applied"""
+    """print the patches not yet applied
+
+    Returns 0 on success."""
 
     q = repo.mq
     if patch:
@@ -1795,8 +1800,8 @@
         return 1
 
     length = opts.get('first') and 1 or None
-    return q.qseries(repo, start=start, length=length, status='U',
-                     summary=opts.get('summary'))
+    q.qseries(repo, start=start, length=length, status='U',
+              summary=opts.get('summary'))
 
 def qimport(ui, repo, *filename, **opts):
     """import a patch
@@ -1828,6 +1833,8 @@
     To import an existing patch while renaming it::
 
       hg qimport -e existing-patch -n new-name
+
+    Returns 0 if import succeeded.
     """
     q = repo.mq
     try:
@@ -1846,7 +1853,9 @@
 
     This command also creates a series file for ordering patches, and
     an mq-specific .hgignore file in the queue repository, to exclude
-    the status and guards files (these contain mostly transient state)."""
+    the status and guards files (these contain mostly transient state).
+
+    Returns 0 if initialization succeeded."""
     q = repo.mq
     r = q.init(repo, create)
     q.save_dirty()
@@ -1892,6 +1901,8 @@
 
     The patch directory must be a nested Mercurial repository, as
     would be created by :hg:`init --mq`.
+
+    Return 0 on success.
     '''
     def patchdir(repo):
         url = repo.url()
@@ -1953,32 +1964,40 @@
     commands.commit(r.ui, r, *pats, **opts)
 
 def series(ui, repo, **opts):
-    """print the entire series file"""
+    """print the entire series file
+
+    Returns 0 on success."""
     repo.mq.qseries(repo, missing=opts.get('missing'), summary=opts.get('summary'))
     return 0
 
 def top(ui, repo, **opts):
-    """print the name of the current patch"""
+    """print the name of the current patch
+
+    Returns 0 on success."""
     q = repo.mq
     t = q.applied and q.series_end(True) or 0
     if t:
-        return q.qseries(repo, start=t - 1, length=1, status='A',
-                         summary=opts.get('summary'))
+        q.qseries(repo, start=t - 1, length=1, status='A',
+                  summary=opts.get('summary'))
     else:
         ui.write(_("no patches applied\n"))
         return 1
 
 def next(ui, repo, **opts):
-    """print the name of the next patch"""
+    """print the name of the next patch
+
+    Returns 0 on success."""
     q = repo.mq
     end = q.series_end()
     if end == len(q.series):
         ui.write(_("all patches applied\n"))
         return 1
-    return q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
+    q.qseries(repo, start=end, length=1, summary=opts.get('summary'))
 
 def prev(ui, repo, **opts):
-    """print the name of the previous patch"""
+    """print the name of the previous patch
+
+    Returns 0 on success."""
     q = repo.mq
     l = len(q.applied)
     if l == 1:
@@ -1987,8 +2006,8 @@
     if not l:
         ui.write(_("no patches applied\n"))
         return 1
-    return q.qseries(repo, start=l - 2, length=1, status='A',
-                     summary=opts.get('summary'))
+    q.qseries(repo, start=l - 2, length=1, status='A',
+              summary=opts.get('summary'))
 
 def setupheaderopts(ui, opts):
     if not opts.get('user') and opts.get('currentuser'):
@@ -2018,6 +2037,8 @@
     format. Read the diffs help topic for more information on why this
     is important for preserving permission changes and copy/rename
     information.
+
+    Returns 0 on successful creation of a new patch.
     """
     msg = cmdutil.logmessage(opts)
     def getmsg():
@@ -2051,6 +2072,8 @@
     use git-style patches (-g/--git or [diff] git=1) to track copies
     and renames. See the diffs help topic for more information on the
     git diff format.
+
+    Returns 0 on success.
     """
     q = repo.mq
     message = cmdutil.logmessage(opts)
@@ -2084,6 +2107,8 @@
     last qrefresh, or :hg:`export qtip` if you want to see changes
     made by the current patch without including changes made since the
     qrefresh.
+
+    Returns 0 on success.
     """
     repo.mq.diff(repo, pats, opts)
     return 0
@@ -2099,7 +2124,9 @@
     removed afterwards.
 
     The header for each folded patch will be concatenated with the
-    current patch header, separated by a line of '* * *'."""
+    current patch header, separated by a line of '* * *'.
+
+    Returns 0 on success."""
 
     q = repo.mq
 
@@ -2153,7 +2180,9 @@
     q.save_dirty()
 
 def goto(ui, repo, patch, **opts):
-    '''push or pop patches until named patch is at top of stack'''
+    '''push or pop patches until named patch is at top of stack
+
+    Returns 0 on success.'''
     q = repo.mq
     patch = q.lookup(patch)
     if q.isapplied(patch):
@@ -2181,6 +2210,8 @@
     To set guards on another patch::
 
       hg qguard other.patch -- +2.6.17 -stable
+
+    Returns 0 on success.
     '''
     def status(idx):
         guards = q.series_guards[idx] or ['unguarded']
@@ -2231,7 +2262,9 @@
         status(q.series.index(q.lookup(patch)))
 
 def header(ui, repo, patch=None):
-    """print the header of the topmost or specified patch"""
+    """print the header of the topmost or specified patch
+
+    Returns 0 on success."""
     q = repo.mq
 
     if patch:
@@ -2274,6 +2307,8 @@
 
     When -f/--force is applied, all local changes in patched files
     will be lost.
+
+    Return 0 on succces.
     """
     q = repo.mq
     mergeq = None
@@ -2298,6 +2333,8 @@
     By default, pops off the top of the patch stack. If given a patch
     name, keeps popping off patches until the named patch is at the
     top of the stack.
+
+    Return 0 on success.
     """
     localupdate = True
     if opts.get('name'):
@@ -2315,7 +2352,9 @@
     """rename a patch
 
     With one argument, renames the current patch to PATCH1.
-    With two arguments, renames PATCH1 to PATCH2."""
+    With two arguments, renames PATCH1 to PATCH2.
+
+    Returns 0 on success."""
 
     q = repo.mq
 
@@ -2439,6 +2478,8 @@
 
     Use the --no-backup option to discard the backup bundle once the
     operation completes.
+
+    Return 0 on success.
     """
     backup = 'all'
     if opts.get('backup'):
@@ -2515,7 +2556,9 @@
     guarded patches.
 
     Use -s/--series to print a list of all guards in the series file
-    (no other arguments needed). Use -v for more information.'''
+    (no other arguments needed). Use -v for more information.
+
+    Returns 0 on success.'''
 
     q = repo.mq
     guards = q.active()
@@ -2602,6 +2645,8 @@
     This can be especially useful if your changes have been applied to
     an upstream repository, or if you are about to push your changes
     to upstream.
+
+    Returns 0 on success.
     """
     if not opts.get('applied') and not revrange:
         raise util.Abort(_('no revisions specified'))
@@ -2635,6 +2680,8 @@
 
     To delete an existing queue, use --delete. You cannot delete the currently
     active queue.
+
+    Returns 0 on success.
     '''
 
     q = repo.mq
@@ -3046,7 +3093,7 @@
           ('n', 'name', '',
            _('merge queue name (DEPRECATED)'), _('NAME')),
           ('', 'move', None, _('reorder patch series and apply only the patch'))],
-         _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]')),
+         _('hg qpush [-f] [-l] [-a] [-n NAME] [--move] [PATCH | INDEX]')),
     "^qrefresh":
         (refresh,
          [('e', 'edit', None, _('edit commit message')),
--- a/mercurial/dispatch.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/mercurial/dispatch.py	Mon Sep 27 10:47:36 2010 -0500
@@ -218,6 +218,7 @@
             return
 
         if self.definition.startswith('!'):
+            self.shell = True
             def fn(ui, *args):
                 env = {'HG_ARGS': ' '.join((self.name,) + args)}
                 def _checkvar(m):
@@ -404,18 +405,11 @@
               result=ret, pats=cmdpats, opts=cmdoptions)
     return ret
 
-_loaded = set()
-def _dispatch(ui, args):
-    # read --config before doing anything else
-    # (e.g. to change trust settings for reading .hg/hgrc)
-    _parseconfig(ui, _earlygetopt(['--config'], args))
-
-    # check for cwd
-    cwd = _earlygetopt(['--cwd'], args)
-    if cwd:
-        os.chdir(cwd[-1])
-
-    # read the local repository .hgrc into a local ui object
+def _getlocal(ui, rpath):
+    """Return (path, local ui object) for the given target path.
+    
+    Takes paths in [cwd]/.hg/hgrc into account."
+    """
     try:
         wd = os.getcwd()
     except OSError, e:
@@ -431,13 +425,64 @@
         except IOError:
             pass
 
-    # now we can expand paths, even ones in .hg/hgrc
-    rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
     if rpath:
         path = lui.expandpath(rpath[-1])
         lui = ui.copy()
         lui.readconfig(os.path.join(path, ".hg", "hgrc"))
 
+    return path, lui
+
+def _checkshellalias(ui, args):
+    cwd = os.getcwd()
+    options = {}
+    args = fancyopts.fancyopts(args, commands.globalopts, options)
+
+    if not args:
+        return
+
+    _parseconfig(ui, options['config'])
+    if options['cwd']:
+        os.chdir(options['cwd'])
+
+    path, lui = _getlocal(ui, [options['repository']])
+
+    cmdtable = commands.table.copy()
+    addaliases(lui, cmdtable)
+
+    cmd = args[0]
+    try:
+        aliases, entry = cmdutil.findcmd(cmd, cmdtable, lui.config("ui", "strict"))
+    except error.UnknownCommand:
+        os.chdir(cwd)
+        return
+
+    cmd = aliases[0]
+    fn = entry[0]
+
+    if cmd and hasattr(fn, 'shell'):
+        d = lambda: fn(ui, *args[1:])
+        return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, [], {})
+
+    os.chdir(cwd)
+
+_loaded = set()
+def _dispatch(ui, args):
+    shellaliasfn = _checkshellalias(ui, args)
+    if shellaliasfn:
+        return shellaliasfn()
+
+    # read --config before doing anything else
+    # (e.g. to change trust settings for reading .hg/hgrc)
+    _parseconfig(ui, _earlygetopt(['--config'], args))
+
+    # check for cwd
+    cwd = _earlygetopt(['--cwd'], args)
+    if cwd:
+        os.chdir(cwd[-1])
+
+    rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
+    path, lui = _getlocal(ui, rpath)
+
     # Configure extensions in phases: uisetup, extsetup, cmdtable, and
     # reposetup. Programs like TortoiseHg will call _dispatch several
     # times so we keep track of configured extensions in _loaded.
--- a/mercurial/help/revsets.txt	Fri Sep 24 19:47:50 2010 -0300
+++ b/mercurial/help/revsets.txt	Mon Sep 27 10:47:36 2010 -0500
@@ -7,8 +7,11 @@
 Identifiers such as branch names must be quoted with single or double
 quotes if they contain characters outside of
 ``[._a-zA-Z0-9\x80-\xff]`` or if they match one of the predefined
-predicates. Special characters can be used in quoted identifiers by
-escaping them, e.g., ``\n`` is interpreted as a newline.
+predicates.
+
+Special characters can be used in quoted identifiers by escaping them,
+e.g., ``\n`` is interpreted as a newline. To prevent them from being
+interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
 
 There is a single prefix operator:
 
@@ -82,7 +85,8 @@
   An alias for ``::.`` (ancestors of the working copy's first parent).
 
 ``grep(regex)``
-  Like ``keyword(string)`` but accepts a regex.
+  Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')``
+  to ensure special escape characters are handled correctly.
 
 ``head()``
   Changeset is a head.
--- a/mercurial/revset.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/mercurial/revset.py	Mon Sep 27 10:47:36 2010 -0500
@@ -48,7 +48,14 @@
             pos += 1 # skip ahead
         elif c in "():,-|&+!": # handle simple operators
             yield (c, None, pos)
-        elif c in '"\'': # handle quoted strings
+        elif (c in '"\'' or c == 'r' and
+              program[pos:pos + 2] in ("r'", 'r"')): # handle quoted strings
+            if c == 'r':
+                pos += 1
+                c = program[pos]
+                decode = lambda x: x
+            else:
+                decode = lambda x: x.decode('string-escape')
             pos += 1
             s = pos
             while pos < l: # find closing quote
@@ -57,7 +64,7 @@
                     pos += 2
                     continue
                 if d == c:
-                    yield ('string', program[s:pos].decode('string-escape'), s)
+                    yield ('string', decode(program[s:pos]), s)
                     break
                 pos += 1
             else:
--- a/mercurial/subrepo.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/mercurial/subrepo.py	Mon Sep 27 10:47:36 2010 -0500
@@ -220,7 +220,7 @@
         """
         raise NotImplementedError
 
-    def checknested(path):
+    def checknested(self, path):
         """check if path is a subrepository within this repository"""
         return False
 
@@ -331,7 +331,7 @@
             ctx2 = self._repo[rev2]
             return self._repo.status(ctx1, ctx2, **opts)
         except error.RepoLookupError, inst:
-            self._repo.ui.warn(_("warning: %s in %s\n")
+            self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, relpath(self)))
             return [], [], [], [], [], [], []
 
@@ -347,7 +347,7 @@
                                    prefix=os.path.join(prefix, self._path),
                                    listsubrepos=True, **opts)
         except error.RepoLookupError, inst:
-            self._repo.ui.warn(_("warning: %s in %s\n")
+            self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
                                % (inst, relpath(self)))
 
     def archive(self, archiver, prefix):
--- a/mercurial/templater.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/mercurial/templater.py	Mon Sep 27 10:47:36 2010 -0500
@@ -138,10 +138,12 @@
             pos = n + 1
 
             if '%' in expr:
+                # the keyword should be formatted with a template
                 key, t = expr.split('%')
                 parsed.append((self._format, (key.strip(),
                                               self._load(t.strip()))))
             elif '|' in expr:
+                # process the keyword value with one or more filters
                 parts = expr.split('|')
                 val = parts[0].strip()
                 try:
@@ -150,6 +152,7 @@
                     raise SyntaxError(_("unknown filter '%s'") % i[0])
                 parsed.append((self._filter, (filters, val)))
             else:
+                # just get the keyword
                 parsed.append((self._get, expr.strip()))
 
         return parsed
--- a/setup.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/setup.py	Mon Sep 27 10:47:36 2010 -0500
@@ -229,7 +229,7 @@
         try:
             build_ext.build_extension(self, ext)
         except CCompilerError:
-            if not hasattr(ext, 'optional') or not ext.optional:
+            if not getattr(ext, 'optional', False):
                 raise
             log.warn("Failed to build optional extension '%s' (skipping)",
                      ext.name)
--- a/tests/darcs/darcs1/_darcs/inventory	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-[adda
-test@test.com**20100923184058] 
--- a/tests/darcs/darcs1/_darcs/prefs/author	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-test@test.com
\ No newline at end of file
--- a/tests/darcs/darcs1/_darcs/prefs/binaries	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-# Binary file regexps:
-\.png$
-\.PNG$
-\.gz$
-\.GZ$
-\.pdf$
-\.PDF$
-\.jpg$
-\.JPG$
-\.jpeg$
-\.JPEG$
-\.gif$
-\.GIF$
-\.tif$
-\.TIF$
-\.tiff$
-\.TIFF$
-\.pnm$
-\.PNM$
-\.pbm$
-\.PBM$
-\.pgm$
-\.PGM$
-\.ppm$
-\.PPM$
-\.bmp$
-\.BMP$
-\.mng$
-\.MNG$
-\.tar$
-\.TAR$
-\.bz2$
-\.BZ2$
-\.z$
-\.Z$
-\.zip$
-\.ZIP$
-\.jar$
-\.JAR$
-\.so$
-\.SO$
-\.a$
-\.A$
-\.tgz$
-\.TGZ$
-\.mpg$
-\.MPG$
-\.mpeg$
-\.MPEG$
-\.iso$
-\.ISO$
-\.exe$
-\.EXE$
-\.doc$
-\.DOC$
-\.elc$
-\.ELC$
-\.pyc$
-\.PYC$
--- a/tests/darcs/darcs1/_darcs/prefs/boring	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-# Boring file regexps:
-\.hi$
-\.hi-boot$
-\.o-boot$
-\.o$
-\.o\.cmd$
-# *.ko files aren't boring by default because they might
-# be Korean translations rather than kernel modules.
-# \.ko$
-\.ko\.cmd$
-\.mod\.c$
-(^|/)\.tmp_versions($|/)
-(^|/)CVS($|/)
-\.cvsignore$
-^\.#
-(^|/)RCS($|/)
-,v$
-(^|/)\.svn($|/)
-\.bzr$
-(^|/)SCCS($|/)
-~$
-(^|/)_darcs($|/)
-\.bak$
-\.BAK$
-\.orig$
-\.rej$
-(^|/)vssver\.scc$
-\.swp$
-(^|/)MT($|/)
-(^|/)\{arch\}($|/)
-(^|/).arch-ids($|/)
-(^|/),
-\.prof$
-(^|/)\.DS_Store$
-(^|/)BitKeeper($|/)
-(^|/)ChangeSet($|/)
-\.py[co]$
-\.elc$
-\.class$
-\#
-(^|/)Thumbs\.db$
-(^|/)autom4te\.cache($|/)
-(^|/)config\.(log|status)$
-^\.depend$
-(^|/)(tags|TAGS)$
-#(^|/)\.[^/]
-(^|/|\.)core$
-\.(obj|a|exe|so|lo|la)$
-^\.darcs-temp-mail$
--- a/tests/darcs/darcs1/_darcs/pristine/a	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-a 
--- a/tests/darcs/darcs1/a	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-a 
Binary file tests/darcs1.hg has changed
--- a/tests/run-tests.py	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/run-tests.py	Mon Sep 27 10:47:36 2010 -0500
@@ -362,10 +362,11 @@
         # when they happen.
         nohome = ''
     cmd = ('%s setup.py %s clean --all'
+           ' build --build-base="%s"'
            ' install --force --prefix="%s" --install-lib="%s"'
            ' --install-scripts="%s" %s >%s 2>&1'
-           % (sys.executable, pure, INST, PYTHONDIR, BINDIR, nohome,
-              installerrs))
+           % (sys.executable, pure, os.path.join(HGTMP, "build"),
+              INST, PYTHONDIR, BINDIR, nohome, installerrs))
     vlog("# Running", cmd)
     if os.system(cmd) == 0:
         if not options.verbose:
--- a/tests/test-alias.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-alias.t	Mon Sep 27 10:47:36 2010 -0500
@@ -23,6 +23,7 @@
   > echo2 = !echo '\$2'
   > echo13 = !echo '\$1' '\$3'
   > count = !hg log -r '\$@' --template='.' | wc -c | sed -e 's/ //g'
+  > mcount = !hg log \$@ --template='.' | wc -c | sed -e 's/ //g'
   > rt = root
   > 
   > [defaults]
@@ -158,10 +159,10 @@
   
   $ hg blank foo
   
+  $ hg self
+  self
   $ hg echo
   
-  $ hg self
-  self
   $ hg echo foo
   foo
   $ hg echo 'test $2' foo
@@ -180,6 +181,59 @@
   1
   $ hg count 'branch(default)'
   2
+  $ hg mcount -r '"branch(default)"'
+  2
+
+
+shell aliases with global options
+
+  $ hg init sub
+  $ cd sub
+  $ hg count 'branch(default)'
+  0
+  $ hg -v count 'branch(default)'
+  0
+  $ hg -R .. count 'branch(default)'
+  0
+  $ hg --cwd .. count 'branch(default)'
+  2
+  $ hg echo --cwd ..
+  --cwd ..
+
+
+repo specific shell aliases
+
+  $ cat >> .hg/hgrc <<EOF
+  > [alias]
+  > subalias = !echo sub \$@
+  > EOF
+  $ cat >> ../.hg/hgrc <<EOF
+  > [alias]
+  > mainalias = !echo main \$@
+  > EOF
+
+
+shell alias defined in current repo
+
+  $ hg subalias
+  sub
+  $ hg --cwd .. subalias > /dev/null
+  hg: unknown command 'subalias'
+  [255]
+  $ hg -R .. subalias > /dev/null
+  hg: unknown command 'subalias'
+  [255]
+
+
+shell alias defined in other repo
+
+  $ hg mainalias > /dev/null
+  hg: unknown command 'mainalias'
+  [255]
+  $ hg -R .. mainalias
+  main
+  $ hg --cwd .. mainalias
+  main
 
 
 invalid arguments
--- a/tests/test-bisect.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-bisect.t	Mon Sep 27 10:47:36 2010 -0500
@@ -269,9 +269,6 @@
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     msg 1
   
-  $ false
-  [1]
-
 
   $ hg bisect -r
   $ hg bisect -g tip
--- a/tests/test-clone-cgi	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/bin/sh
-# This is a test of the wire protocol over CGI-based hgweb.
-
-echo % initialize repository
-hg init test
-cd test
-echo a > a
-hg ci -Ama
-cd ..
-
-cat >hgweb.cgi <<HGWEB
-#!/usr/bin/env python
-#
-# An example CGI script to use hgweb, edit as necessary
-
-import cgitb
-cgitb.enable()
-
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb
-from mercurial.hgweb import wsgicgi
-
-application = hgweb("test", "Empty test repository")
-wsgicgi.launch(application)
-HGWEB
-chmod 755 hgweb.cgi
-
-DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
-GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
-HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
-HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
-HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
-HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
-HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
-HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
-HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
-HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
-HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
-PATH_INFO="/"; export PATH_INFO
-PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
-REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
-REMOTE_PORT="44703"; export REMOTE_PORT
-REQUEST_METHOD="GET"; export REQUEST_METHOD
-REQUEST_URI="/test/"; export REQUEST_URI
-SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
-SCRIPT_NAME="/test"; export SCRIPT_NAME
-SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
-SCRIPT_URL="/test/"; export SCRIPT_URL
-SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
-SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
-SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
-SERVER_PORT="80"; export SERVER_PORT
-SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
-SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>"; export SERVER_SIGNATURE
-SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
-
-echo % try hgweb request
-QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
-python hgweb.cgi >page1 2>&1 ; echo $?
-python "$TESTDIR/md5sum.py" page1
-
-exit 0
--- a/tests/test-clone-cgi.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-% initialize repository
-adding a
-% try hgweb request
-0
-1f424bb22ec05c3c6bc866b6e67efe43  page1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone-cgi.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,56 @@
+This is a test of the wire protocol over CGI-based hgweb.
+initialize repository
+
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ cd ..
+  $ cat >hgweb.cgi <<HGWEB
+  > #
+  > # An example CGI script to use hgweb, edit as necessary
+  > import cgitb
+  > cgitb.enable()
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgweb
+  > from mercurial.hgweb import wsgicgi
+  > application = hgweb("test", "Empty test repository")
+  > wsgicgi.launch(application)
+  > HGWEB
+  $ chmod 755 hgweb.cgi
+  $ DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
+  $ GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
+  $ HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
+  $ HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
+  $ HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
+  $ HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
+  $ HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
+  $ HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
+  $ HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
+  $ HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
+  $ HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
+  $ PATH_INFO="/"; export PATH_INFO
+  $ PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
+  $ REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
+  $ REMOTE_PORT="44703"; export REMOTE_PORT
+  $ REQUEST_METHOD="GET"; export REQUEST_METHOD
+  $ REQUEST_URI="/test/"; export REQUEST_URI
+  $ SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
+  $ SCRIPT_NAME="/test"; export SCRIPT_NAME
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
+  $ SCRIPT_URL="/test/"; export SCRIPT_URL
+  $ SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
+  $ SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
+  $ SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
+  $ SERVER_PORT="80"; export SERVER_PORT
+  $ SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
+  $ SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>"; export SERVER_SIGNATURE
+  $ SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
+
+try hgweb request
+
+  $ QUERY_STRING="cmd=changegroup&roots=0000000000000000000000000000000000000000"; export QUERY_STRING
+  $ python hgweb.cgi >page1 2>&1
+  $ python "$TESTDIR/md5sum.py" page1
+  1f424bb22ec05c3c6bc866b6e67efe43  page1
--- a/tests/test-clone-failure	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-# No local source
-hg clone a b
-echo $?
-
-# No remote source
-hg clone http://127.0.0.1:3121/a b
-echo $?
-rm -rf b # work around bug with http clone
-
-# Inaccessible source
-mkdir a
-chmod 000 a
-hg clone a b
-echo $?
-
-# Inaccessible destination
-mkdir b
-cd b
-hg init
-hg clone . ../a
-echo $?
-cd ..
-chmod 700 a
-rm -r a b
-
-# Source of wrong type
-if "$TESTDIR/hghave" -q fifo; then
-    mkfifo a
-    hg clone a b
-    echo $?
-    rm a
-else
-    echo "abort: repository a not found!"
-    echo 255
-fi
-
-# Default destination, same directory
-mkdir q
-cd q
-hg init
-cd ..
-hg clone q
-
-# destination directory not empty
-mkdir a 
-echo stuff > a/a
-hg clone q a
-echo $?
-
-# leave existing directory in place after clone failure
-hg init c
-cd c
-echo c > c
-hg commit -A -m test
-chmod -rx .hg/store/data
-cd ..
-mkdir d
-hg clone c d 2> err
-echo $?
-test -d d && echo "dir is still here" || echo "dir is gone"
-test -d d/.hg && echo "repo is still here" || echo "repo is gone"
-
-# reenable perm to allow deletion
-chmod +rx c/.hg/store/data
-
-true
--- a/tests/test-clone-failure.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-abort: repository a not found!
-255
-abort: error: Connection refused
-255
-abort: repository a not found!
-255
-abort: Permission denied: ../a
-255
-abort: repository a not found!
-255
-destination directory: q
-abort: destination 'q' is not empty
-abort: destination 'a' is not empty
-255
-adding c
-255
-dir is still here
-repo is gone
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone-failure.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,83 @@
+No local source
+
+  $ hg clone a b
+  abort: repository a not found!
+  [255]
+
+No remote source
+
+  $ hg clone http://127.0.0.1:3121/a b
+  abort: error: Connection refused
+  [255]
+  $ rm -rf b # work around bug with http clone
+
+Inaccessible source
+
+  $ mkdir a
+  $ chmod 000 a
+  $ hg clone a b
+  abort: repository a not found!
+  [255]
+
+Inaccessible destination
+
+  $ mkdir b
+  $ cd b
+  $ hg init
+  $ hg clone . ../a
+  abort: Permission denied: ../a
+  [255]
+  $ cd ..
+  $ chmod 700 a
+  $ rm -r a b
+
+Source of wrong type
+
+  $ if "$TESTDIR/hghave" -q fifo; then
+  >     mkfifo a
+  >     hg clone a b
+  >     rm a
+  > else
+  >     echo "abort: repository a not found!"
+  >     echo 255
+  > fi
+  abort: repository a not found!
+
+Default destination, same directory
+
+  $ mkdir q
+  $ cd q
+  $ hg init
+  $ cd ..
+  $ hg clone q
+  destination directory: q
+  abort: destination 'q' is not empty
+  [255]
+
+destination directory not empty
+
+  $ mkdir a 
+  $ echo stuff > a/a
+  $ hg clone q a
+  abort: destination 'a' is not empty
+  [255]
+
+leave existing directory in place after clone failure
+
+  $ hg init c
+  $ cd c
+  $ echo c > c
+  $ hg commit -A -m test
+  adding c
+  $ chmod -rx .hg/store/data
+  $ cd ..
+  $ mkdir d
+  $ hg clone c d 2> err
+  [255]
+  $ test -d d
+  $ test -d d/.hg
+  [1]
+
+reenable perm to allow deletion
+
+  $ chmod +rx c/.hg/store/data
--- a/tests/test-clone-pull-corruption	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# Corrupt an hg repo with a pull started during an aborted commit
-#
-
-# Create two repos, so that one of them can pull from the other one.
-hg init source
-cd source
-touch foo
-hg add foo
-hg ci -m 'add foo'
-hg clone . ../corrupted
-echo >> foo
-hg ci -m 'change foo'
-
-# Add a hook to wait 5 seconds and then abort the commit
-cd ../corrupted
-echo '[hooks]' >> .hg/hgrc
-echo 'pretxncommit = sleep 5; exit 1' >> .hg/hgrc
-
-# start a commit...
-touch bar
-hg add bar
-hg ci -m 'add bar' &
-
-# ... and start a pull while the commit is still running
-sleep 1
-hg pull ../source 2>/dev/null
-
-# see what happened
-wait
-hg verify
--- a/tests/test-clone-pull-corruption.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../source
-transaction abort!
-rollback completed
-abort: pretxncommit hook exited with status 1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-clone-pull-corruption.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,50 @@
+Corrupt an hg repo with a pull started during an aborted commit
+Create two repos, so that one of them can pull from the other one.
+
+  $ hg init source
+  $ cd source
+  $ touch foo
+  $ hg add foo
+  $ hg ci -m 'add foo'
+  $ hg clone . ../corrupted
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo >> foo
+  $ hg ci -m 'change foo'
+
+Add a hook to wait 5 seconds and then abort the commit
+
+  $ cd ../corrupted
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'pretxncommit = sleep 5; exit 1' >> .hg/hgrc
+
+start a commit...
+
+  $ touch bar
+  $ hg add bar
+  $ hg ci -m 'add bar' &
+
+... and start a pull while the commit is still running
+
+  $ sleep 1
+  $ hg pull ../source 2>/dev/null
+  pulling from ../source
+  transaction abort!
+  rollback completed
+  abort: pretxncommit hook exited with status 1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+see what happened
+
+  $ wait
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
--- a/tests/test-convert	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-convert=
-[convert]
-hg.saverev=False
-EOF
-
-hg help convert
-
-hg init a
-cd a
-echo a > a
-hg ci -d'0 0' -Ama
-hg cp a b
-hg ci -d'1 0' -mb
-hg rm a
-hg ci -d'2 0' -mc
-hg mv b a
-hg ci -d'3 0' -md
-echo a >> a
-hg ci -d'4 0' -me
-
-cd ..
-hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
-hg --cwd a-hg pull ../a
-
-touch bogusfile
-echo % should fail
-hg convert a bogusfile
-
-mkdir bogusdir
-chmod 000 bogusdir
-
-echo % should fail
-hg convert a bogusdir
-
-echo % should succeed
-chmod 700 bogusdir
-hg convert a bogusdir
-
-echo % test pre and post conversion actions
-echo 'include b' > filemap
-hg convert --debug --filemap filemap a partialb | \
-    grep 'run hg'
-
-echo % converting empty dir should fail "nicely"
-mkdir emptydir
-# override $PATH to ensure p4 not visible; use $PYTHON in case we're
-# running from a devel copy, not a temp installation
-PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir 2>&1 | sed 's,file://.*/emptydir,.../emptydir,g'
-
-echo % convert with imaginary source type
-hg convert --source-type foo a a-foo
-echo % convert with imaginary sink type
-hg convert --dest-type foo a a-foo
-
-echo
-echo % "testing: convert must not produce duplicate entries in fncache"
-hg convert a b
-echo % "contents of fncache file:"
-cat b/.hg/store/fncache
-
-echo '% test bogus URL'
-hg convert -q bzr+ssh://foobar@selenic.com/baz baz
-
-true
--- a/tests/test-convert-authormap	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-convert=
-EOF
-
-# Prepare orig repo
-hg init orig
-cd orig
-echo foo > foo
-HGUSER='user name' hg ci -qAm 'foo'
-cd ..
-
-# Explicit --authors
-cat > authormap.txt <<EOF
-user name = Long User Name
-
-# comment
-this line is ignored
-EOF
-
-hg convert --authors authormap.txt orig new
-echo $?
-cat new/.hg/authormap
-
-hg -Rnew log
-rm -rf new
-
-# Implicit .hg/authormap
-hg init new
-mv authormap.txt new/.hg/authormap
-
-hg convert orig new
-echo $?
-
-hg -Rnew log
--- a/tests/test-convert-authormap.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-initializing destination new repository
-Ignoring bad line in author map file authormap.txt: this line is ignored
-scanning source...
-sorting...
-converting...
-0 foo
-Writing author map file new/.hg/authormap
-0
-user name=Long User Name
-changeset:   0:d89716e88087
-tag:         tip
-user:        Long User Name
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
-Ignoring bad line in author map file new/.hg/authormap: this line is ignored
-scanning source...
-sorting...
-converting...
-0 foo
-0
-changeset:   0:d89716e88087
-tag:         tip
-user:        Long User Name
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-authormap.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,58 @@
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > convert=
+  > EOF
+
+Prepare orig repo
+
+  $ hg init orig
+  $ cd orig
+  $ echo foo > foo
+  $ HGUSER='user name' hg ci -qAm 'foo'
+  $ cd ..
+
+Explicit --authors
+
+  $ cat > authormap.txt <<EOF
+  > user name = Long User Name
+  > 
+  > # comment
+  > this line is ignored
+  > EOF
+  $ hg convert --authors authormap.txt orig new
+  initializing destination new repository
+  Ignoring bad line in author map file authormap.txt: this line is ignored
+  scanning source...
+  sorting...
+  converting...
+  0 foo
+  Writing author map file new/.hg/authormap
+  $ cat new/.hg/authormap
+  user name=Long User Name
+  $ hg -Rnew log
+  changeset:   0:d89716e88087
+  tag:         tip
+  user:        Long User Name
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo
+  
+  $ rm -rf new
+
+Implicit .hg/authormap
+
+  $ hg init new
+  $ mv authormap.txt new/.hg/authormap
+  $ hg convert orig new
+  Ignoring bad line in author map file new/.hg/authormap: this line is ignored
+  scanning source...
+  sorting...
+  converting...
+  0 foo
+  $ hg -Rnew log
+  changeset:   0:d89716e88087
+  tag:         tip
+  user:        Long User Name
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo
+  
--- a/tests/test-convert-bzr	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/bzr-definitions"
-
-echo % create and rename on the same file in the same step
-mkdir test-createandrename
-cd test-createandrename
-bzr init -q source
-cd source
-echo a > a
-echo c > c
-echo e > e
-bzr add -q a c e
-bzr commit -q -m 'Initial add: a, c, e'
-bzr mv a b
-bzr mv c d
-bzr mv e f
-echo a2 >> a
-mkdir e
-bzr add -q a e
-bzr commit -q -m 'rename a into b, create a, rename c into d'
-cd ..
-hg convert source source-hg
-glog -R source-hg
-echo "% manifest"
-hg manifest -R source-hg -r tip
-echo "% test --rev option"
-hg convert -r 1 source source-1-hg
-glog -R source-1-hg
-echo "% test with filemap"
-cat > filemap <<EOF
-exclude a
-EOF
-hg convert --filemap filemap source source-filemap-hg
-hg -R source-filemap-hg manifest -r tip
-
-echo '% convert from lightweight checkout'
-bzr checkout --lightweight source source-light
-hg convert source-light source-light-hg
-echo "% lightweight manifest"
-hg manifest -R source-light-hg -r tip
-
-# extract timestamps that look just like hg's {date|isodate}:
-# yyyy-mm-dd HH:MM zzzz (no seconds!)
-echo "% compare timestamps"
-cd source
-bzr log | \
-  sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
-  > ../bzr-timestamps
-cd ..
-
-hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
-if diff -q bzr-timestamps hg-timestamps ; then
-  echo "good: hg timestamps match bzr timestamps"
-else
-  echo "fail: bzr timestamps are:"
-  cat bzr-timestamps
-  echo "but hg timestamps are:"
-  cat hg-timestamps
-fi
-
-cd ..
-
-echo % merge
-mkdir test-merge
-cd test-merge
-
-cat > helper.py <<EOF
-import sys
-from bzrlib import workingtree
-wt = workingtree.WorkingTree.open('.')
-
-message, stamp = sys.argv[1:]
-wt.commit(message, timestamp=int(stamp))
-EOF
-
-bzr init -q source
-cd source
-echo content > a
-echo content2 > b
-bzr add -q a b
-bzr commit -q -m 'Initial add'
-cd ..
-bzr branch -q source source-improve
-cd source
-echo more >> a
-python ../helper.py 'Editing a' 100
-cd ../source-improve
-echo content3 >> b
-python ../helper.py 'Editing b' 200
-cd ../source
-bzr merge -q ../source-improve
-bzr commit -q -m 'Merged improve branch'
-cd ..
-hg convert --datesort source source-hg
-glog -R source-hg
-cd ..
-
-echo % symlinks and executable files
-mkdir test-symlinks
-cd test-symlinks
-bzr init -q source
-cd source
-touch program
-chmod +x program
-ln -s program altname
-mkdir d
-echo a > d/a
-ln -s a syma
-bzr add -q altname program syma d/a
-bzr commit -q -m 'Initial setup'
-touch newprog
-chmod +x newprog
-rm altname
-ln -s newprog altname
-chmod -x program
-bzr add -q newprog
-bzr commit -q -m 'Symlink changed, x bits changed'
-cd ..
-hg convert source source-hg
-manifest source-hg 0
-manifest source-hg tip
-cd source-hg
-echo % test the symlinks can be recreated
-hg up
-hg cat syma
-cd ../..
--- a/tests/test-convert-bzr-114	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" bzr114 || exit 80
-
-. "$TESTDIR/bzr-definitions"
-
-# The file/directory replacement can only be reproduced on
-# bzr >= 1.4. Merge it back in test-convert-bzr-directories once
-# this version becomes mainstream.
-echo % replace file with dir
-mkdir test-replace-file-with-dir
-cd test-replace-file-with-dir
-bzr init -q source
-cd source
-echo d > d
-bzr add -q d
-bzr commit -q -m 'add d file'
-rm d
-mkdir d
-bzr add -q d
-bzr commit -q -m 'replace with d dir'
-echo a > d/a
-bzr add -q d/a
-bzr commit -q -m 'add d/a'
-cd ..
-hg convert source source-hg
-manifest source-hg tip
-cd source-hg
-hg update
-cd ../..
--- a/tests/test-convert-bzr-114.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-% replace file with dir
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-2 add d file
-1 replace with d dir
-0 add d/a
-% manifest of tip
-644   d/a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr-114.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,39 @@
+
+  $ "$TESTDIR/hghave" bzr114 || exit 80
+  $ . "$TESTDIR/bzr-definitions"
+
+The file/directory replacement can only be reproduced on
+bzr >= 1.4. Merge it back in test-convert-bzr-directories once
+this version becomes mainstream.
+replace file with dir
+
+  $ mkdir test-replace-file-with-dir
+  $ cd test-replace-file-with-dir
+  $ bzr init -q source
+  $ cd source
+  $ echo d > d
+  $ bzr add -q d
+  $ bzr commit -q -m 'add d file'
+  $ rm d
+  $ mkdir d
+  $ bzr add -q d
+  $ bzr commit -q -m 'replace with d dir'
+  $ echo a > d/a
+  $ bzr add -q d/a
+  $ bzr commit -q -m 'add d/a'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  2 add d file
+  1 replace with d dir
+  0 add d/a
+  $ manifest source-hg tip
+  % manifest of tip
+  644   d/a
+  $ cd source-hg
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd ../..
--- a/tests/test-convert-bzr-directories	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/bzr-definitions"
-
-echo % empty directory
-mkdir test-empty
-cd test-empty
-bzr init -q source
-cd source
-echo content > a
-bzr add -q a
-bzr commit -q -m 'Initial add'
-mkdir empty
-bzr add -q empty
-bzr commit -q -m 'Empty directory added'
-echo content > empty/something
-bzr add -q empty/something
-bzr commit -q -m 'Added file into directory'
-cd ..
-hg convert source source-hg
-manifest source-hg 1
-manifest source-hg tip
-cd ..
-
-echo % directory renames
-mkdir test-dir-rename
-cd test-dir-rename
-bzr init -q source
-cd source
-mkdir tpyo
-echo content > tpyo/something
-bzr add -q tpyo
-bzr commit -q -m 'Added directory'
-bzr mv tpyo typo
-bzr commit -q -m 'Oops, typo'
-cd ..
-hg convert source source-hg
-manifest source-hg 0
-manifest source-hg tip
-cd ..
-
-echo % nested directory renames
-mkdir test-nested-dir-rename
-cd test-nested-dir-rename
-bzr init -q source
-cd source
-mkdir -p firstlevel/secondlevel/thirdlevel
-echo content > firstlevel/secondlevel/file
-echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
-bzr add -q firstlevel
-bzr commit -q -m 'Added nested directories'
-bzr mv firstlevel/secondlevel secondlevel
-bzr commit -q -m 'Moved secondlevel one level up'
-cd ..
-hg convert source source-hg
-manifest source-hg tip
-cd ..
-
-echo % directory remove
-mkdir test-dir-remove
-cd test-dir-remove
-bzr init -q source
-cd source
-mkdir src
-echo content > src/sourcecode
-bzr add -q src
-bzr commit -q -m 'Added directory'
-bzr rm -q src
-bzr commit -q -m 'Removed directory'
-cd ..
-hg convert source source-hg
-manifest source-hg 0
-manifest source-hg tip
-cd ..
-
-echo % directory replace
-mkdir test-dir-replace
-cd test-dir-replace
-bzr init -q source
-cd source
-mkdir first second
-echo content > first/file
-echo morecontent > first/dummy
-echo othercontent > second/something
-bzr add -q first second
-bzr commit -q -m 'Initial layout'
-bzr mv first/file second/file
-bzr mv first third
-bzr commit -q -m 'Some conflicting moves'
-cd ..
-hg convert source source-hg
-manifest source-hg tip
-cd ..
--- a/tests/test-convert-bzr-directories.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-% empty directory
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-2 Initial add
-1 Empty directory added
-0 Added file into directory
-% manifest of 1
-644   a
-% manifest of tip
-644   a
-644   empty/something
-% directory renames
-tpyo => typo
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Added directory
-0 Oops, typo
-% manifest of 0
-644   tpyo/something
-% manifest of tip
-644   typo/something
-% nested directory renames
-firstlevel/secondlevel => secondlevel
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Added nested directories
-0 Moved secondlevel one level up
-% manifest of tip
-644   secondlevel/file
-644   secondlevel/thirdlevel/stuff
-% directory remove
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Added directory
-0 Removed directory
-% manifest of 0
-644   src/sourcecode
-% manifest of tip
-% directory replace
-first/file => second/file
-first => third
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial layout
-0 Some conflicting moves
-% manifest of tip
-644   second/file
-644   second/something
-644   third/dummy
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr-directories.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,151 @@
+
+  $ . "$TESTDIR/bzr-definitions"
+
+empty directory
+
+  $ mkdir test-empty
+  $ cd test-empty
+  $ bzr init -q source
+  $ cd source
+  $ echo content > a
+  $ bzr add -q a
+  $ bzr commit -q -m 'Initial add'
+  $ mkdir empty
+  $ bzr add -q empty
+  $ bzr commit -q -m 'Empty directory added'
+  $ echo content > empty/something
+  $ bzr add -q empty/something
+  $ bzr commit -q -m 'Added file into directory'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  2 Initial add
+  1 Empty directory added
+  0 Added file into directory
+  $ manifest source-hg 1
+  % manifest of 1
+  644   a
+  $ manifest source-hg tip
+  % manifest of tip
+  644   a
+  644   empty/something
+  $ cd ..
+
+directory renames
+
+  $ mkdir test-dir-rename
+  $ cd test-dir-rename
+  $ bzr init -q source
+  $ cd source
+  $ mkdir tpyo
+  $ echo content > tpyo/something
+  $ bzr add -q tpyo
+  $ bzr commit -q -m 'Added directory'
+  $ bzr mv tpyo typo
+  tpyo => typo
+  $ bzr commit -q -m 'Oops, typo'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Added directory
+  0 Oops, typo
+  $ manifest source-hg 0
+  % manifest of 0
+  644   tpyo/something
+  $ manifest source-hg tip
+  % manifest of tip
+  644   typo/something
+  $ cd ..
+
+nested directory renames
+
+  $ mkdir test-nested-dir-rename
+  $ cd test-nested-dir-rename
+  $ bzr init -q source
+  $ cd source
+  $ mkdir -p firstlevel/secondlevel/thirdlevel
+  $ echo content > firstlevel/secondlevel/file
+  $ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff
+  $ bzr add -q firstlevel
+  $ bzr commit -q -m 'Added nested directories'
+  $ bzr mv firstlevel/secondlevel secondlevel
+  firstlevel/secondlevel => secondlevel
+  $ bzr commit -q -m 'Moved secondlevel one level up'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Added nested directories
+  0 Moved secondlevel one level up
+  $ manifest source-hg tip
+  % manifest of tip
+  644   secondlevel/file
+  644   secondlevel/thirdlevel/stuff
+  $ cd ..
+
+directory remove
+
+  $ mkdir test-dir-remove
+  $ cd test-dir-remove
+  $ bzr init -q source
+  $ cd source
+  $ mkdir src
+  $ echo content > src/sourcecode
+  $ bzr add -q src
+  $ bzr commit -q -m 'Added directory'
+  $ bzr rm -q src
+  $ bzr commit -q -m 'Removed directory'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Added directory
+  0 Removed directory
+  $ manifest source-hg 0
+  % manifest of 0
+  644   src/sourcecode
+  $ manifest source-hg tip
+  % manifest of tip
+  $ cd ..
+
+directory replace
+
+  $ mkdir test-dir-replace
+  $ cd test-dir-replace
+  $ bzr init -q source
+  $ cd source
+  $ mkdir first second
+  $ echo content > first/file
+  $ echo morecontent > first/dummy
+  $ echo othercontent > second/something
+  $ bzr add -q first second
+  $ bzr commit -q -m 'Initial layout'
+  $ bzr mv first/file second/file
+  first/file => second/file
+  $ bzr mv first third
+  first => third
+  $ bzr commit -q -m 'Some conflicting moves'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial layout
+  0 Some conflicting moves
+  $ manifest source-hg tip
+  % manifest of tip
+  644   second/file
+  644   second/something
+  644   third/dummy
+  $ cd ..
--- a/tests/test-convert-bzr-ghosts	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/bzr-definitions"
-
-cat > ghostcreator.py <<EOF
-import sys
-from bzrlib import workingtree
-wt = workingtree.WorkingTree.open('.')
-
-message, ghostrev = sys.argv[1:]
-wt.set_parent_ids(wt.get_parent_ids() + [ghostrev])
-wt.commit(message)
-EOF
-
-echo % ghost revisions
-mkdir test-ghost-revisions
-cd test-ghost-revisions
-bzr init -q source
-cd source
-echo content > somefile
-bzr add -q somefile
-bzr commit -q -m 'Initial layout setup'
-echo morecontent >> somefile
-python ../../ghostcreator.py 'Commit with ghost revision' ghostrev
-cd ..
-hg convert source source-hg
-glog -R source-hg
--- a/tests/test-convert-bzr-ghosts.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-% ghost revisions
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial layout setup
-0 Commit with ghost revision
-o  1 "Commit with ghost revision" files: somefile
-|
-o  0 "Initial layout setup" files: somefile
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr-ghosts.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,36 @@
+
+  $ . "$TESTDIR/bzr-definitions"
+  $ cat > ghostcreator.py <<EOF
+  > import sys
+  > from bzrlib import workingtree
+  > wt = workingtree.WorkingTree.open('.')
+  > 
+  > message, ghostrev = sys.argv[1:]
+  > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev])
+  > wt.commit(message)
+  > EOF
+
+ghost revisions
+
+  $ mkdir test-ghost-revisions
+  $ cd test-ghost-revisions
+  $ bzr init -q source
+  $ cd source
+  $ echo content > somefile
+  $ bzr add -q somefile
+  $ bzr commit -q -m 'Initial layout setup'
+  $ echo morecontent >> somefile
+  $ python ../../ghostcreator.py 'Commit with ghost revision' ghostrev
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial layout setup
+  0 Commit with ghost revision
+  $ glog -R source-hg
+  o  1 "Commit with ghost revision" files: somefile
+  |
+  o  0 "Initial layout setup" files: somefile
+  
--- a/tests/test-convert-bzr-merges	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# N.B. bzr 1.13 has a bug that breaks this test.  If you see this
-# test fail, check your bzr version.  Upgrading to bzr 1.13.1
-# should fix it.
-
-. "$TESTDIR/bzr-definitions"
-
-echo % test multiple merges at once
-mkdir test-multimerge
-cd test-multimerge
-bzr init -q source
-cd source
-echo content > file
-bzr add -q file
-bzr commit -q -m 'Initial add'
-cd ..
-bzr branch -q source source-branch1
-cd source-branch1
-echo morecontent >> file
-echo evenmorecontent > file-branch1
-bzr add -q file-branch1
-bzr commit -q -m 'Added branch1 file'
-cd ../source
-sleep 1
-echo content > file-parent
-bzr add -q file-parent
-bzr commit -q -m 'Added parent file'
-cd ..
-bzr branch -q source source-branch2
-cd source-branch2
-echo somecontent > file-branch2
-bzr add -q file-branch2
-bzr commit -q -m 'Added brach2 file'
-sleep 1
-cd ../source
-bzr merge -q ../source-branch1
-bzr merge -q --force ../source-branch2
-bzr commit -q -m 'Merged branches'
-cd ..
-hg convert --datesort source source-hg
-glog -R source-hg
-manifest source-hg tip
--- a/tests/test-convert-bzr-merges.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-% test multiple merges at once
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-4 Initial add
-3 Added branch1 file
-2 Added parent file
-1 Added brach2 file
-0 Merged branches
-o    5 "(octopus merge fixup)" files:
-|\
-| o    4 "Merged branches" files: file-branch2
-| |\
-o---+  3 "Added brach2 file" files: file-branch2
- / /
-| o  2 "Added parent file" files: file-parent
-| |
-o |  1 "Added branch1 file" files: file file-branch1
-|/
-o  0 "Initial add" files: file
-
-% manifest of tip
-644   file
-644   file-branch1
-644   file-branch2
-644   file-parent
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr-merges.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,68 @@
+N.B. bzr 1.13 has a bug that breaks this test.  If you see this
+test fail, check your bzr version.  Upgrading to bzr 1.13.1
+should fix it.
+
+  $ . "$TESTDIR/bzr-definitions"
+
+test multiple merges at once
+
+  $ mkdir test-multimerge
+  $ cd test-multimerge
+  $ bzr init -q source
+  $ cd source
+  $ echo content > file
+  $ bzr add -q file
+  $ bzr commit -q -m 'Initial add'
+  $ cd ..
+  $ bzr branch -q source source-branch1
+  $ cd source-branch1
+  $ echo morecontent >> file
+  $ echo evenmorecontent > file-branch1
+  $ bzr add -q file-branch1
+  $ bzr commit -q -m 'Added branch1 file'
+  $ cd ../source
+  $ sleep 1
+  $ echo content > file-parent
+  $ bzr add -q file-parent
+  $ bzr commit -q -m 'Added parent file'
+  $ cd ..
+  $ bzr branch -q source source-branch2
+  $ cd source-branch2
+  $ echo somecontent > file-branch2
+  $ bzr add -q file-branch2
+  $ bzr commit -q -m 'Added brach2 file'
+  $ sleep 1
+  $ cd ../source
+  $ bzr merge -q ../source-branch1
+  $ bzr merge -q --force ../source-branch2
+  $ bzr commit -q -m 'Merged branches'
+  $ cd ..
+  $ hg convert --datesort source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  4 Initial add
+  3 Added branch1 file
+  2 Added parent file
+  1 Added brach2 file
+  0 Merged branches
+  $ glog -R source-hg
+  o    5 "(octopus merge fixup)" files:
+  |\
+  | o    4 "Merged branches" files: file-branch2
+  | |\
+  o---+  3 "Added brach2 file" files: file-branch2
+   / /
+  | o  2 "Added parent file" files: file-parent
+  | |
+  o |  1 "Added branch1 file" files: file file-branch1
+  |/
+  o  0 "Initial add" files: file
+  
+  $ manifest source-hg tip
+  % manifest of tip
+  644   file
+  644   file-branch1
+  644   file-branch2
+  644   file-parent
--- a/tests/test-convert-bzr-treeroot	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-. "$TESTDIR/bzr-definitions"
-
-cat > treeset.py <<EOF
-import sys
-from bzrlib import workingtree
-wt = workingtree.WorkingTree.open('.')
-
-message, rootid = sys.argv[1:]
-wt.set_root_id('tree_root-%s' % rootid)
-wt.commit(message)
-EOF
-
-echo % change the id of the tree root
-mkdir test-change-treeroot-id
-cd test-change-treeroot-id
-bzr init -q source
-cd source
-echo content > file
-bzr add -q file
-bzr commit -q -m 'Initial add'
-python ../../treeset.py 'Changed root' new
-cd ..
-hg convert source source-hg
-manifest source-hg tip
--- a/tests/test-convert-bzr-treeroot.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-% change the id of the tree root
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial add
-0 Changed root
-% manifest of tip
-644   file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr-treeroot.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,33 @@
+
+  $ . "$TESTDIR/bzr-definitions"
+  $ cat > treeset.py <<EOF
+  > import sys
+  > from bzrlib import workingtree
+  > wt = workingtree.WorkingTree.open('.')
+  > 
+  > message, rootid = sys.argv[1:]
+  > wt.set_root_id('tree_root-%s' % rootid)
+  > wt.commit(message)
+  > EOF
+
+change the id of the tree root
+
+  $ mkdir test-change-treeroot-id
+  $ cd test-change-treeroot-id
+  $ bzr init -q source
+  $ cd source
+  $ echo content > file
+  $ bzr add -q file
+  $ bzr commit -q -m 'Initial add'
+  $ python ../../treeset.py 'Changed root' new
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial add
+  0 Changed root
+  $ manifest source-hg tip
+  % manifest of tip
+  644   file
--- a/tests/test-convert-bzr.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-% create and rename on the same file in the same step
-a => b
-c => d
-e => f
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial add: a, c, e
-0 rename a into b, create a, rename c into d
-o  1 "rename a into b, create a, rename c into d" files: a b c d e f
-|
-o  0 "Initial add: a, c, e" files: a c e
-
-% manifest
-a
-b
-d
-f
-% test --rev option
-initializing destination source-1-hg repository
-scanning source...
-sorting...
-converting...
-0 Initial add: a, c, e
-o  0 "Initial add: a, c, e" files: a c e
-
-% test with filemap
-initializing destination source-filemap-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial add: a, c, e
-0 rename a into b, create a, rename c into d
-b
-d
-f
-% convert from lightweight checkout
-initializing destination source-light-hg repository
-warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
-scanning source...
-sorting...
-converting...
-1 Initial add: a, c, e
-0 rename a into b, create a, rename c into d
-% lightweight manifest
-a
-b
-d
-f
-% compare timestamps
-good: hg timestamps match bzr timestamps
-% merge
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-3 Initial add
-2 Editing a
-1 Editing b
-0 Merged improve branch
-o    3 "Merged improve branch" files:
-|\
-| o  2 "Editing b" files: b
-| |
-o |  1 "Editing a" files: a
-|/
-o  0 "Initial add" files: a b
-
-% symlinks and executable files
-initializing destination source-hg repository
-scanning source...
-sorting...
-converting...
-1 Initial setup
-0 Symlink changed, x bits changed
-% manifest of 0
-644 @ altname
-644   d/a
-755 * program
-644 @ syma
-% manifest of tip
-644 @ altname
-644   d/a
-755 * newprog
-644   program
-644 @ syma
-% test the symlinks can be recreated
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-bzr.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,209 @@
+
+  $ . "$TESTDIR/bzr-definitions"
+
+create and rename on the same file in the same step
+
+  $ mkdir test-createandrename
+  $ cd test-createandrename
+  $ bzr init -q source
+  $ cd source
+  $ echo a > a
+  $ echo c > c
+  $ echo e > e
+  $ bzr add -q a c e
+  $ bzr commit -q -m 'Initial add: a, c, e'
+  $ bzr mv a b
+  a => b
+  $ bzr mv c d
+  c => d
+  $ bzr mv e f
+  e => f
+  $ echo a2 >> a
+  $ mkdir e
+  $ bzr add -q a e
+  $ bzr commit -q -m 'rename a into b, create a, rename c into d'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial add: a, c, e
+  0 rename a into b, create a, rename c into d
+  $ glog -R source-hg
+  o  1 "rename a into b, create a, rename c into d" files: a b c d e f
+  |
+  o  0 "Initial add: a, c, e" files: a c e
+  
+
+manifest
+
+  $ hg manifest -R source-hg -r tip
+  a
+  b
+  d
+  f
+
+test --rev option
+
+  $ hg convert -r 1 source source-1-hg
+  initializing destination source-1-hg repository
+  scanning source...
+  sorting...
+  converting...
+  0 Initial add: a, c, e
+  $ glog -R source-1-hg
+  o  0 "Initial add: a, c, e" files: a c e
+  
+
+test with filemap
+
+  $ cat > filemap <<EOF
+  > exclude a
+  > EOF
+  $ hg convert --filemap filemap source source-filemap-hg
+  initializing destination source-filemap-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial add: a, c, e
+  0 rename a into b, create a, rename c into d
+  $ hg -R source-filemap-hg manifest -r tip
+  b
+  d
+  f
+
+convert from lightweight checkout
+
+  $ bzr checkout --lightweight source source-light
+  $ hg convert source-light source-light-hg
+  initializing destination source-light-hg repository
+  warning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
+  scanning source...
+  sorting...
+  converting...
+  1 Initial add: a, c, e
+  0 rename a into b, create a, rename c into d
+
+lightweight manifest
+
+  $ hg manifest -R source-light-hg -r tip
+  a
+  b
+  d
+  f
+
+extract timestamps that look just like hg's {date|isodate}:
+yyyy-mm-dd HH:MM zzzz (no seconds!)
+compare timestamps
+
+  $ cd source
+  $ bzr log | \
+  >   sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \
+  >   > ../bzr-timestamps
+  $ cd ..
+  $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
+  $ diff -u bzr-timestamps hg-timestamps
+  $ cd ..
+
+merge
+
+  $ mkdir test-merge
+  $ cd test-merge
+  $ cat > helper.py <<EOF
+  > import sys
+  > from bzrlib import workingtree
+  > wt = workingtree.WorkingTree.open('.')
+  > 
+  > message, stamp = sys.argv[1:]
+  > wt.commit(message, timestamp=int(stamp))
+  > EOF
+  $ bzr init -q source
+  $ cd source
+  $ echo content > a
+  $ echo content2 > b
+  $ bzr add -q a b
+  $ bzr commit -q -m 'Initial add'
+  $ cd ..
+  $ bzr branch -q source source-improve
+  $ cd source
+  $ echo more >> a
+  $ python ../helper.py 'Editing a' 100
+  $ cd ../source-improve
+  $ echo content3 >> b
+  $ python ../helper.py 'Editing b' 200
+  $ cd ../source
+  $ bzr merge -q ../source-improve
+  $ bzr commit -q -m 'Merged improve branch'
+  $ cd ..
+  $ hg convert --datesort source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  3 Initial add
+  2 Editing a
+  1 Editing b
+  0 Merged improve branch
+  $ glog -R source-hg
+  o    3 "Merged improve branch" files:
+  |\
+  | o  2 "Editing b" files: b
+  | |
+  o |  1 "Editing a" files: a
+  |/
+  o  0 "Initial add" files: a b
+  
+  $ cd ..
+
+symlinks and executable files
+
+  $ mkdir test-symlinks
+  $ cd test-symlinks
+  $ bzr init -q source
+  $ cd source
+  $ touch program
+  $ chmod +x program
+  $ ln -s program altname
+  $ mkdir d
+  $ echo a > d/a
+  $ ln -s a syma
+  $ bzr add -q altname program syma d/a
+  $ bzr commit -q -m 'Initial setup'
+  $ touch newprog
+  $ chmod +x newprog
+  $ rm altname
+  $ ln -s newprog altname
+  $ chmod -x program
+  $ bzr add -q newprog
+  $ bzr commit -q -m 'Symlink changed, x bits changed'
+  $ cd ..
+  $ hg convert source source-hg
+  initializing destination source-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 Initial setup
+  0 Symlink changed, x bits changed
+  $ manifest source-hg 0
+  % manifest of 0
+  644 @ altname
+  644   d/a
+  755 * program
+  644 @ syma
+  $ manifest source-hg tip
+  % manifest of tip
+  644 @ altname
+  644   d/a
+  755 * newprog
+  644   program
+  644 @ syma
+  $ cd source-hg
+
+test the symlinks can be recreated
+
+  $ hg up
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg cat syma; echo
+  a
+
--- a/tests/test-convert-clonebranches	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "[convert]" >> $HGRCPATH
-echo "hg.tagsbranch=0" >> $HGRCPATH
-
-hg init source
-cd source
-echo a > a
-hg ci -qAm adda
-# Add a merge with one parent in the same branch
-echo a >> a
-hg ci -qAm changea
-hg up -qC 0
-hg branch branch0
-echo b > b
-hg ci -qAm addb
-hg up -qC
-hg merge default
-hg ci -qm mergeab
-hg tag -ql mergeab
-cd ..
-
-# Miss perl... sometimes
-cat > filter.py <<EOF
-import sys, re
-
-r = re.compile(r'^(?:\d+|pulling from)')
-sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
-EOF
-
-echo % convert
-hg convert -v --config convert.hg.clonebranches=1 source dest |
-    python filter.py
-
-# Add a merge with both parents and child in different branches
-cd source
-hg branch branch1
-echo a > file1
-hg ci -qAm c1
-hg up -qC mergeab
-hg branch branch2
-echo a > file2
-hg ci -qAm c2
-hg merge branch1
-hg branch branch3
-hg ci -qAm c3
-cd ..
-
-echo % incremental conversion
-hg convert -v --config convert.hg.clonebranches=1 source dest |
-    python filter.py
-
--- a/tests/test-convert-clonebranches.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-marked working directory as branch branch0
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% convert
-3 adda
-2 changea
-1 addb
-pulling from default into branch0
-1 changesets found
-0 mergeab
-pulling from default into branch0
-1 changesets found
-marked working directory as branch branch1
-marked working directory as branch branch2
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-marked working directory as branch branch3
-% incremental conversion
-2 c1
-pulling from branch0 into branch1
-4 changesets found
-1 c2
-pulling from branch0 into branch2
-4 changesets found
-0 c3
-pulling from branch2 into branch3
-5 changesets found
-pulling from branch1 into branch3
-1 changesets found
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-clonebranches.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,84 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "[convert]" >> $HGRCPATH
+  $ echo "hg.tagsbranch=0" >> $HGRCPATH
+  $ hg init source
+  $ cd source
+  $ echo a > a
+  $ hg ci -qAm adda
+
+Add a merge with one parent in the same branch
+
+  $ echo a >> a
+  $ hg ci -qAm changea
+  $ hg up -qC 0
+  $ hg branch branch0
+  marked working directory as branch branch0
+  $ echo b > b
+  $ hg ci -qAm addb
+  $ hg up -qC
+  $ hg merge default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -qm mergeab
+  $ hg tag -ql mergeab
+  $ cd ..
+
+Miss perl... sometimes
+
+  $ cat > filter.py <<EOF
+  > import sys, re
+  > 
+  > r = re.compile(r'^(?:\d+|pulling from)')
+  > sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
+  > EOF
+
+convert
+
+  $ hg convert -v --config convert.hg.clonebranches=1 source dest |
+  >     python filter.py
+  3 adda
+  2 changea
+  1 addb
+  pulling from default into branch0
+  1 changesets found
+  0 mergeab
+  pulling from default into branch0
+  1 changesets found
+
+Add a merge with both parents and child in different branches
+
+  $ cd source
+  $ hg branch branch1
+  marked working directory as branch branch1
+  $ echo a > file1
+  $ hg ci -qAm c1
+  $ hg up -qC mergeab
+  $ hg branch branch2
+  marked working directory as branch branch2
+  $ echo a > file2
+  $ hg ci -qAm c2
+  $ hg merge branch1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg branch branch3
+  marked working directory as branch branch3
+  $ hg ci -qAm c3
+  $ cd ..
+
+incremental conversion
+
+  $ hg convert -v --config convert.hg.clonebranches=1 source dest |
+  >     python filter.py
+  2 c1
+  pulling from branch0 into branch1
+  4 changesets found
+  1 c2
+  pulling from branch0 into branch2
+  4 changesets found
+  0 c3
+  pulling from branch2 into branch3
+  5 changesets found
+  pulling from branch1 into branch3
+  1 changesets found
--- a/tests/test-convert-cvs	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" cvs || exit 80
-
-cvscall()
-{
-    cvs -f "$@"
-}
-
-hgcat()
-{
-    hg --cwd src-hg cat -r tip "$1"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog = " >> $HGRCPATH
-
-cat > cvshooks.py <<EOF
-def cvslog(ui,repo,hooktype,log):
-    print "%s hook: %d entries"%(hooktype,len(log))
-
-def cvschangesets(ui,repo,hooktype,changesets):
-    print "%s hook: %d changesets"%(hooktype,len(changesets))
-EOF
-hookpath=`pwd`
-
-echo "[hooks]" >> $HGRCPATH
-echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
-echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
-
-echo % create cvs repository
-mkdir cvsrepo
-cd cvsrepo
-CVSROOT=`pwd`
-export CVSROOT
-CVS_OPTIONS=-f
-export CVS_OPTIONS
-cd ..
-
-cvscall -q -d "$CVSROOT" init
-
-echo % create source directory
-mkdir src-temp
-cd src-temp
-echo a > a
-mkdir b
-cd b
-echo c > c
-cd ..
-
-echo % import source directory
-cvscall -q import -m import src INITIAL start
-cd ..
-
-echo % checkout source directory
-cvscall -q checkout src
-
-echo % commit a new revision changing b/c
-cd src
-sleep 1
-echo c >> b/c
-cvscall -q commit -mci0 . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-cd ..
-
-echo % convert fresh repo
-hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat a
-hgcat b/c
-
-echo % convert fresh repo with --filemap
-echo include b/c > filemap
-hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat b/c
-hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
-
-echo % 'convert full repository (issue1649)'
-cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
-ls srcfull
-hg convert srcfull srcfull-hg \
-    | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' \
-    | grep -v 'log entries' | grep -v 'hook:' \
-    | grep -v '^[0-3] .*' # filter instable changeset order
-hg cat -r tip srcfull-hg/src/a
-hg cat -r tip srcfull-hg/src/b/c
-
-echo % commit new file revisions
-cd src
-echo a >> a
-echo c >> b/c
-cvscall -q commit -mci1 . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-cd ..
-
-echo % convert again
-hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat a
-hgcat b/c
-
-echo % convert again with --filemap
-hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat b/c
-hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
-
-echo % commit branch
-cd src
-cvs -q update -r1.1 b/c
-cvs -q tag -b branch
-cvs -q update -r branch > /dev/null
-echo d >> b/c
-cvs -q commit -mci2 . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-cd ..
-
-echo % convert again
-hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat b/c
-
-echo % convert again with --filemap
-hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-hgcat b/c
-hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
-
-echo % commit a new revision with funny log message
-cd src
-sleep 1
-echo e >> a
-cvscall -q commit -m'funny
-----------------------------
-log message' . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-cd ..
-
-echo % commit new file revisions with some fuzz
-cd src
-sleep 1
-echo f >> a
-cvscall -q commit -mfuzzy . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-sleep 4 # the two changes will be split if fuzz < 4
-echo g >> b/c
-cvscall -q commit -mfuzzy . | grep '<--' |\
-    sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-cd ..
-
-echo % convert again
-hg convert --config convert.cvsps.fuzz=2 src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-
-hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
-
-echo % testing debugcvsps
-cd src
-hg debugcvsps --fuzz=2 | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' 
--- a/tests/test-convert-cvs-branch	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-# This is http://mercurial.selenic.com/bts/issue1148
-#     and http://mercurial.selenic.com/bts/issue1447
-
-"$TESTDIR/hghave" cvs || exit 80
-
-cvscall()
-{
-    cvs -f "$@"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog = " >> $HGRCPATH
-echo "[convert]" >> $HGRCPATH
-echo "cvsps.cache=0" >> $HGRCPATH
-
-echo % create cvs repository
-mkdir cvsrepo
-cd cvsrepo
-CVSROOT=`pwd`
-export CVSROOT
-CVS_OPTIONS=-f
-export CVS_OPTIONS
-cd ..
-
-cvscall -q -d "$CVSROOT" init
-
-echo % Create a new project
-
-mkdir src
-cd src
-echo "1" > a
-echo "1" > b
-cvscall import -m "init" src v0 r0 | sort
-cd ..
-cvscall co src
-cd src
-
-echo % Branch the project
-
-cvscall tag -b BRANCH
-cvscall up -r BRANCH > /dev/null
-
-echo % Modify file a, then b, then a 
-
-echo "2" > a
-cvscall ci -m "mod a" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-
-echo "2" > b
-cvscall ci -m "mod b" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-
-echo "3" > a
-cvscall ci -m "mod a again" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
-
-echo % Convert
-
-cd ..
-hg convert src | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
-
-echo % Check the result
-
-hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
-
-echo ""
-
-echo % issue 1447
-cvscall()
-{
-    echo cvs -f "$@"
-    cvs -f "$@"
-    sleep 1
-}
-
-cvsci()
-{
-    echo cvs -f ci "$@"
-    cvs -f ci "$@" >/dev/null 2>&1
-    sleep 1
-}
-
-cvscall -Q -d `pwd`/cvsmaster2 init >/dev/null 2>&1
-cd cvsmaster2
-CVSROOT=`pwd`
-export CVSROOT
-mkdir foo
-cd ..
-cvscall -Q co -d cvswork2 foo
-
-cd cvswork2
-echo foo > a.txt
-echo bar > b.txt
-cvscall -Q add a.txt b.txt
-cvsci -m "Initial commit"
-
-echo foo > b.txt
-cvsci -m "Fix b on HEAD"
-
-echo bar > a.txt
-cvsci -m "Small fix in a on HEAD"
-
-cvscall -Q tag -b BRANCH
-cvscall -Q up -P -rBRANCH
-
-echo baz > b.txt
-cvsci -m "Change on BRANCH in b"
-
-hg debugcvsps -x --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
-
-cd ..
-
--- a/tests/test-convert-cvs-branch.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-% create cvs repository
-% Create a new project
-
-
-N src/a
-N src/b
-No conflicts created by this import
-cvs checkout: Updating src
-U src/a
-U src/b
-% Branch the project
-cvs tag: Tagging .
-T a
-T b
-cvs update: Updating .
-% Modify file a, then b, then a
-cvs commit: Examining .
-checking in src/a,v
-cvs commit: Examining .
-checking in src/b,v
-cvs commit: Examining .
-checking in src/a,v
-% Convert
-assuming destination src-hg
-initializing destination src-hg repository
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-7 log entries
-creating changesets
-5 changeset entries
-sorting...
-converting...
-4 Initial revision
-3 init
-2 mod a
-1 mod b
-0 mod a again
-updating tags
-% Check the result
-o  5 () update tags files: .hgtags
-|
-| o  4 (BRANCH) mod a again files: a
-| |
-| o  3 (BRANCH) mod b files: b
-| |
-| o  2 (BRANCH) mod a files: a
-| |
-| o  1 (v0) init files:
-|/
-o  0 () Initial revision files: a b
-
-
-% issue 1447
-cvs -f -Q co -d cvswork2 foo
-cvs -f -Q add a.txt b.txt
-cvs -f ci -m Initial commit
-cvs -f ci -m Fix b on HEAD
-cvs -f ci -m Small fix in a on HEAD
-cvs -f -Q tag -b BRANCH
-cvs -f -Q up -P -rBRANCH
-cvs -f ci -m Change on BRANCH in b
-collecting CVS rlog
-5 log entries
-creating changesets
-4 changeset entries
----------------------
-PatchSet 1 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Log:
-Initial commit
-
-Members: 
-	a.txt:INITIAL->1.1 
-	b.txt:INITIAL->1.1 
-
----------------------
-PatchSet 2 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: BRANCH 
-Parent: 1
-Log:
-Fix b on HEAD
-
-Members: 
-	b.txt:1.1->1.2 
-
----------------------
-PatchSet 3 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: BRANCH 
-Parent: 2
-Log:
-Small fix in a on HEAD
-
-Members: 
-	a.txt:1.1->1.2 
-
----------------------
-PatchSet 4 
-Date:
-Author:
-Branch: BRANCH
-Tag: (none) 
-Parent: 3
-Log:
-Change on BRANCH in b
-
-Members: 
-	b.txt:1.2->1.2.2.1 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-cvs-branch.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,190 @@
+This is http://mercurial.selenic.com/bts/issue1148
+and http://mercurial.selenic.com/bts/issue1447
+
+  $ "$TESTDIR/hghave" cvs || exit 80
+  $ cvscall()
+  > {
+  >     cvs -f "$@" > /dev/null
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "graphlog = " >> $HGRCPATH
+  $ echo "[convert]" >> $HGRCPATH
+  $ echo "cvsps.cache=0" >> $HGRCPATH
+
+create cvs repository
+
+  $ mkdir cvsrepo
+  $ cd cvsrepo
+  $ CVSROOT=`pwd`
+  $ export CVSROOT
+  $ CVS_OPTIONS=-f
+  $ export CVS_OPTIONS
+  $ cd ..
+  $ cvscall -q -d "$CVSROOT" init
+
+Create a new project
+
+  $ mkdir src
+  $ cd src
+  $ echo "1" > a
+  $ echo "1" > b
+  $ cvscall import -m "init" src v0 r0 | sort
+  $ cd ..
+  $ cvscall co src
+  cvs checkout: Updating src
+  $ cd src
+
+Branch the project
+
+  $ cvscall tag -b BRANCH
+  cvs tag: Tagging .
+  $ cvscall up -r BRANCH > /dev/null
+  cvs update: Updating .
+
+Modify file a, then b, then a 
+
+  $ echo "2" > a
+  $ cvscall ci -m "mod a"
+  cvs commit: Examining .
+  $ echo "2" > b
+  $ cvscall ci -m "mod b"
+  cvs commit: Examining .
+  $ echo "3" > a
+  $ cvscall ci -m "mod a again"
+  cvs commit: Examining .
+
+Convert
+
+  $ cd ..
+  $ hg convert src
+  assuming destination src-hg
+  initializing destination src-hg repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  7 log entries
+  creating changesets
+  5 changeset entries
+  sorting...
+  converting...
+  4 Initial revision
+  3 init
+  2 mod a
+  1 mod b
+  0 mod a again
+  updating tags
+
+Check the result
+
+  $ hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
+  o  5 () update tags files: .hgtags
+  |
+  | o  4 (BRANCH) mod a again files: a
+  | |
+  | o  3 (BRANCH) mod b files: b
+  | |
+  | o  2 (BRANCH) mod a files: a
+  | |
+  | o  1 (v0) init files:
+  |/
+  o  0 () Initial revision files: a b
+  
+
+
+issue 1447
+
+  $ cvscall()
+  > {
+  >     cvs -f "$@" > /dev/null
+  >     sleep 1
+  > }
+  $ cvsci()
+  > {
+  >     cvs -f ci "$@" >/dev/null
+  >     sleep 1
+  > }
+  $ cvscall -Q -d `pwd`/cvsmaster2 init
+  $ cd cvsmaster2
+  $ CVSROOT=`pwd`
+  $ export CVSROOT
+  $ mkdir foo
+  $ cd ..
+  $ cvscall -Q co -d cvswork2 foo
+  $ cd cvswork2
+  $ echo foo > a.txt
+  $ echo bar > b.txt
+  $ cvscall -Q add a.txt b.txt
+  $ cvsci -m "Initial commit"
+  cvs commit: Examining .
+  $ echo foo > b.txt
+  $ cvsci -m "Fix b on HEAD"
+  cvs commit: Examining .
+  $ echo bar > a.txt
+  $ cvsci -m "Small fix in a on HEAD"
+  cvs commit: Examining .
+  $ cvscall -Q tag -b BRANCH
+  $ cvscall -Q up -P -rBRANCH
+  $ echo baz > b.txt
+  $ cvsci -m "Change on BRANCH in b"
+  cvs commit: Examining .
+  $ hg debugcvsps -x --parents foo
+  collecting CVS rlog
+  5 log entries
+  creating changesets
+  4 changeset entries
+  ---------------------
+  PatchSet 1 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Log:
+  Initial commit
+  
+  Members: 
+  	a.txt:INITIAL->1.1 
+  	b.txt:INITIAL->1.1 
+  
+  ---------------------
+  PatchSet 2 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: BRANCH 
+  Parent: 1
+  Log:
+  Fix b on HEAD
+  
+  Members: 
+  	b.txt:1.1->1.2 
+  
+  ---------------------
+  PatchSet 3 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: BRANCH 
+  Parent: 2
+  Log:
+  Small fix in a on HEAD
+  
+  Members: 
+  	a.txt:1.1->1.2 
+  
+  ---------------------
+  PatchSet 4 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: BRANCH
+  Tag: (none) 
+  Parent: 3
+  Log:
+  Change on BRANCH in b
+  
+  Members: 
+  	b.txt:1.2->1.2.2.1 
+  
+
--- a/tests/test-convert-cvs-detectmerge	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-#!/bin/sh
-
-# Test config convert.cvsps.mergefrom config setting.
-# (Should test similar mergeto feature, but I don't understand it yet.)
-# Requires builtin cvsps.
-
-"$TESTDIR/hghave" cvs || exit 80
-
-CVSROOT=`pwd`/cvsrepo
-export CVSROOT
-
-# XXX copied from test-convert-cvs-synthetic
-cvscall()
-{
-    echo cvs -f "$@"
-    cvs -f "$@"
-}
-
-# output of 'cvs ci' varies unpredictably, so just discard it
-# XXX copied from test-convert-cvs-synthetic
-cvsci()
-{
-    echo cvs -f ci "$@"
-    cvs -f ci "$@" >/dev/null 2>&1
-}
-
-# XXX copied from test-convert-cvs-synthetic
-filterpath()
-{
-    eval "$@" | sed "s:$CVSROOT:*REPO*:g"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog = " >> $HGRCPATH
-echo "[convert]" >> $HGRCPATH
-echo "cvsps.cache=0" >> $HGRCPATH
-echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
-
-echo % create cvs repository with one project
-mkdir cvsrepo
-
-filterpath cvscall -q -d "$CVSROOT" init
-mkdir cvsrepo/proj
-
-echo % populate cvs repository
-cvscall -Q co proj
-cd proj
-touch file1
-cvscall -Q add file1
-cvsci -m"add file1 on trunk"
-
-echo % create two release branches
-cvscall -q tag -b v1_0
-cvscall -q tag -b v1_1
-
-echo % modify file1 on branch v1_0
-filterpath cvscall -Q update -rv1_0
-echo "change" >> file1
-cvsci -m"add text"
-
-echo % make unrelated change on v1_1
-cvscall -Q update -rv1_1
-touch unrelated
-cvscall -Q add unrelated
-cvsci -m"unrelated change"
-
-echo % merge file1 to v1_1
-filterpath cvscall -Q update -jv1_0
-cvsci -m"add text [MERGE from v1_0]"
-
-echo % merge change to trunk
-cvscall -Q update -A
-filterpath cvscall -Q update -jv1_1
-cvsci -m"add text [MERGE from v1_1]"
-
-echo % non-merged change on trunk
-echo "foo" > file2
-cvscall -Q add file2
-cvsci -m"add file2 on trunk" file2
-
-# this will create rev 1.3
-echo % change on trunk to backport
-echo "backport me" >> file1
-cvsci -m"add other text" file1
-cvscall log file1 | sed -n '/^date: / d; /^revision /,$ p;'
-
-# XXX how many ways are there to spell "trunk" with CVS?
-echo % backport trunk change to v1_1
-cvscall -Q update -rv1_1
-filterpath cvscall -Q update -j1.2 -j1.3 file1
-cvsci -m"add other text [MERGE from HEAD]" file1
-
-set -e
-echo "% fix bug on v1_1, merge to trunk with error"
-cvscall -Q update -rv1_1
-echo "merge forward" >> file1
-cvscall -Q tag unmerged
-cvsci -m"fix file1"
-cvscall -Q update -A
-filterpath cvscall -Q update -junmerged -jv1_1
-# note the typo in the commit log message
-cvsci -m"fix file1 [MERGE from v1-1]"
-cvs -Q tag -d unmerged
-
-set -e
-echo % convert to hg
-cd ..
-filterpath hg convert proj proj.hg
-
-echo % complete log
-template="{rev}: '{branches}' {desc}\n"
-hg -R proj.hg log --template="$template"
-
-echo % graphical log
-hg -R proj.hg glog --template="$template"
--- a/tests/test-convert-cvs-detectmerge.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-% create cvs repository with one project
-cvs -f -q -d *REPO* init
-% populate cvs repository
-cvs -f -Q co proj
-cvs -f -Q add file1
-cvs -f ci -madd file1 on trunk
-% create two release branches
-cvs -f -q tag -b v1_0
-T file1
-cvs -f -q tag -b v1_1
-T file1
-% modify file1 on branch v1_0
-cvs -f -Q update -rv1_0
-cvs -f ci -madd text
-% make unrelated change on v1_1
-cvs -f -Q update -rv1_1
-cvs -f -Q add unrelated
-cvs -f ci -munrelated change
-% merge file1 to v1_1
-cvs -f -Q update -jv1_0
-RCS file: *REPO*/proj/file1,v
-retrieving revision 1.1
-retrieving revision 1.1.2.1
-Merging differences between 1.1 and 1.1.2.1 into file1
-cvs -f ci -madd text [MERGE from v1_0]
-% merge change to trunk
-cvs -f -Q update -A
-cvs -f -Q update -jv1_1
-RCS file: *REPO*/proj/file1,v
-retrieving revision 1.1
-retrieving revision 1.1.4.1
-Merging differences between 1.1 and 1.1.4.1 into file1
-cvs -f ci -madd text [MERGE from v1_1]
-% non-merged change on trunk
-cvs -f -Q add file2
-cvs -f ci -madd file2 on trunk file2
-% change on trunk to backport
-cvs -f ci -madd other text file1
-revision 1.3
-add other text
-----------------------------
-revision 1.2
-add text [MERGE from v1_1]
-----------------------------
-revision 1.1
-branches:  1.1.2;  1.1.4;
-add file1 on trunk
-----------------------------
-revision 1.1.4.1
-add text [MERGE from v1_0]
-----------------------------
-revision 1.1.2.1
-add text
-=============================================================================
-% backport trunk change to v1_1
-cvs -f -Q update -rv1_1
-cvs -f -Q update -j1.2 -j1.3 file1
-RCS file: *REPO*/proj/file1,v
-retrieving revision 1.2
-retrieving revision 1.3
-Merging differences between 1.2 and 1.3 into file1
-cvs -f ci -madd other text [MERGE from HEAD] file1
-% fix bug on v1_1, merge to trunk with error
-cvs -f -Q update -rv1_1
-cvs -f -Q tag unmerged
-cvs -f ci -mfix file1
-cvs -f -Q update -A
-cvs -f -Q update -junmerged -jv1_1
-RCS file: *REPO*/proj/file1,v
-retrieving revision 1.1.4.2
-retrieving revision 1.1.4.3
-Merging differences between 1.1.4.2 and 1.1.4.3 into file1
-cvs -f ci -mfix file1 [MERGE from v1-1]
-% convert to hg
-warning: CVS commit message references non-existent branch 'v1-1':
-fix file1 [MERGE from v1-1]
-initializing destination proj.hg repository
-connecting to *REPO*
-scanning source...
-collecting CVS rlog
-12 log entries
-creating changesets
-10 changeset entries
-sorting...
-converting...
-9 add file1 on trunk
-8 add text
-7 unrelated change
-6 add text [MERGE from v1_0]
-5 add text [MERGE from v1_1]
-4 add file2 on trunk
-3 add other text
-2 add other text [MERGE from HEAD]
-1 fix file1
-0 fix file1 [MERGE from v1-1]
-% complete log
-9: '' fix file1 [MERGE from v1-1]
-8: 'v1_1' fix file1
-7: 'v1_1' add other text [MERGE from HEAD]
-6: '' add other text
-5: '' add file2 on trunk
-4: '' add text [MERGE from v1_1]
-3: 'v1_1' add text [MERGE from v1_0]
-2: 'v1_1' unrelated change
-1: 'v1_0' add text
-0: '' add file1 on trunk
-% graphical log
-o  9: '' fix file1 [MERGE from v1-1]
-|
-| o  8: 'v1_1' fix file1
-| |
-| o  7: 'v1_1' add other text [MERGE from HEAD]
-|/|
-o |  6: '' add other text
-| |
-o |  5: '' add file2 on trunk
-| |
-o |  4: '' add text [MERGE from v1_1]
-|\|
-| o    3: 'v1_1' add text [MERGE from v1_0]
-| |\
-+---o  2: 'v1_1' unrelated change
-| |
-| o  1: 'v1_0' add text
-|/
-o  0: '' add file1 on trunk
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-cvs-detectmerge.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,231 @@
+Test config convert.cvsps.mergefrom config setting.
+(Should test similar mergeto feature, but I don't understand it yet.)
+Requires builtin cvsps.
+
+  $ "$TESTDIR/hghave" cvs || exit 80
+  $ CVSROOT=`pwd`/cvsrepo
+  $ export CVSROOT
+
+  $ cvscall()
+  > {
+  >     cvs -f "$@"
+  > }
+
+output of 'cvs ci' varies unpredictably, so just discard it
+XXX copied from test-convert-cvs-synthetic
+
+  $ cvsci()
+  > {
+  >     cvs -f ci "$@" > /dev/null
+  > }
+
+XXX copied from test-convert-cvs-synthetic
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "graphlog = " >> $HGRCPATH
+  $ echo "[convert]" >> $HGRCPATH
+  $ echo "cvsps.cache=0" >> $HGRCPATH
+  $ echo "cvsps.mergefrom=\[MERGE from (\S+)\]" >> $HGRCPATH
+
+create cvs repository with one project
+
+  $ mkdir cvsrepo
+  $ cvscall -q -d "$CVSROOT" init
+  $ mkdir cvsrepo/proj
+
+populate cvs repository
+
+  $ cvscall -Q co proj
+  $ cd proj
+  $ touch file1
+  $ cvscall -Q add file1
+  $ cvsci -m"add file1 on trunk"
+  cvs commit: Examining .
+
+create two release branches
+
+  $ cvscall -q tag -b v1_0
+  T file1
+  $ cvscall -q tag -b v1_1
+  T file1
+
+modify file1 on branch v1_0
+
+  $ cvscall -Q update -rv1_0
+  $ echo "change" >> file1
+  $ cvsci -m"add text"
+  cvs commit: Examining .
+
+make unrelated change on v1_1
+
+  $ cvscall -Q update -rv1_1
+  $ touch unrelated
+  $ cvscall -Q add unrelated
+  $ cvsci -m"unrelated change"
+  cvs commit: Examining .
+
+merge file1 to v1_1
+
+  $ cvscall -Q update -jv1_0
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  retrieving revision 1.1
+  retrieving revision 1.1.2.1
+  Merging differences between 1.1 and 1.1.2.1 into file1
+  $ cvsci -m"add text [MERGE from v1_0]"
+  cvs commit: Examining .
+
+merge change to trunk
+
+  $ cvscall -Q update -A
+  $ cvscall -Q update -jv1_1
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  retrieving revision 1.1
+  retrieving revision 1.1.4.1
+  Merging differences between 1.1 and 1.1.4.1 into file1
+  $ cvsci -m"add text [MERGE from v1_1]"
+  cvs commit: Examining .
+
+non-merged change on trunk
+
+  $ echo "foo" > file2
+  $ cvscall -Q add file2
+  $ cvsci -m"add file2 on trunk" file2
+
+this will create rev 1.3
+change on trunk to backport
+
+  $ echo "backport me" >> file1
+  $ cvsci -m"add other text" file1
+  $ cvscall log file1
+  
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  Working file: file1
+  head: 1.3
+  branch:
+  locks: strict
+  access list:
+  symbolic names:
+  	v1_1: 1.1.0.4
+  	v1_0: 1.1.0.2
+  keyword substitution: kv
+  total revisions: 5;	selected revisions: 5
+  description:
+  ----------------------------
+  revision 1.3
+  date: * (glob)
+  add other text
+  ----------------------------
+  revision 1.2
+  date: * (glob)
+  add text [MERGE from v1_1]
+  ----------------------------
+  revision 1.1
+  date: * (glob)
+  branches:  1.1.2;  1.1.4;
+  add file1 on trunk
+  ----------------------------
+  revision 1.1.4.1
+  date: * (glob)
+  add text [MERGE from v1_0]
+  ----------------------------
+  revision 1.1.2.1
+  date: * (glob)
+  add text
+  =============================================================================
+
+XXX how many ways are there to spell "trunk" with CVS?
+backport trunk change to v1_1
+
+  $ cvscall -Q update -rv1_1
+  $ cvscall -Q update -j1.2 -j1.3 file1
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  retrieving revision 1.2
+  retrieving revision 1.3
+  Merging differences between 1.2 and 1.3 into file1
+  $ cvsci -m"add other text [MERGE from HEAD]" file1
+
+fix bug on v1_1, merge to trunk with error
+
+  $ cvscall -Q update -rv1_1
+  $ echo "merge forward" >> file1
+  $ cvscall -Q tag unmerged
+  $ cvsci -m"fix file1"
+  cvs commit: Examining .
+  $ cvscall -Q update -A
+  $ cvscall -Q update -junmerged -jv1_1
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  retrieving revision 1.1.4.2
+  retrieving revision 1.1.4.3
+  Merging differences between 1.1.4.2 and 1.1.4.3 into file1
+
+note the typo in the commit log message
+
+  $ cvsci -m"fix file1 [MERGE from v1-1]"
+  cvs commit: Examining .
+  $ cvs -Q tag -d unmerged
+
+convert to hg
+
+  $ cd ..
+  $ hg convert proj proj.hg
+  initializing destination proj.hg repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  12 log entries
+  creating changesets
+  warning: CVS commit message references non-existent branch 'v1-1':
+  fix file1 [MERGE from v1-1]
+  10 changeset entries
+  sorting...
+  converting...
+  9 add file1 on trunk
+  8 add text
+  7 unrelated change
+  6 add text [MERGE from v1_0]
+  5 add text [MERGE from v1_1]
+  4 add file2 on trunk
+  3 add other text
+  2 add other text [MERGE from HEAD]
+  1 fix file1
+  0 fix file1 [MERGE from v1-1]
+
+complete log
+
+  $ template="{rev}: '{branches}' {desc}\n"
+  $ hg -R proj.hg log --template="$template"
+  9: '' fix file1 [MERGE from v1-1]
+  8: 'v1_1' fix file1
+  7: 'v1_1' add other text [MERGE from HEAD]
+  6: '' add other text
+  5: '' add file2 on trunk
+  4: '' add text [MERGE from v1_1]
+  3: 'v1_1' add text [MERGE from v1_0]
+  2: 'v1_1' unrelated change
+  1: 'v1_0' add text
+  0: '' add file1 on trunk
+
+graphical log
+
+  $ hg -R proj.hg glog --template="$template"
+  o  9: '' fix file1 [MERGE from v1-1]
+  |
+  | o  8: 'v1_1' fix file1
+  | |
+  | o  7: 'v1_1' add other text [MERGE from HEAD]
+  |/|
+  o |  6: '' add other text
+  | |
+  o |  5: '' add file2 on trunk
+  | |
+  o |  4: '' add text [MERGE from v1_1]
+  |\|
+  | o    3: 'v1_1' add text [MERGE from v1_0]
+  | |\
+  +---o  2: 'v1_1' unrelated change
+  | |
+  | o  1: 'v1_0' add text
+  |/
+  o  0: '' add file1 on trunk
+  
--- a/tests/test-convert-cvs-synthetic	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
-#!/bin/sh
-
-# This feature requires use of builtin cvsps!
-"$TESTDIR/hghave" cvs || exit 80
-
-set -e
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog = " >> $HGRCPATH
-
-echo % create cvs repository with one project
-mkdir cvsrepo
-cd cvsrepo
-CVSROOT=`pwd`
-export CVSROOT
-CVS_OPTIONS=-f
-export CVS_OPTIONS
-cd ..
-
-filterpath()
-{
-    eval "$@" | sed "s:$CVSROOT:*REPO*:g"
-}
-
-cvscall()
-{
-    echo cvs -f "$@"
-    cvs -f "$@" 2>&1
-}
-
-# output of 'cvs ci' varies unpredictably, so just discard it
-cvsci()
-{
-    echo cvs -f ci "$@"
-    cvs -f ci "$@" >/dev/null 2>&1
-}
-
-filterpath cvscall -d "$CVSROOT" init
-mkdir cvsrepo/proj
-
-cvscall -q co proj
-
-echo % create file1 on the trunk
-cd proj
-touch file1
-cvscall -Q add file1
-cvsci -m"add file1 on trunk" file1
-
-echo % create two branches
-cvscall -q tag -b v1_0
-cvscall -q tag -b v1_1
-
-echo % create file2 on branch v1_0
-cvscall -Q up -rv1_0
-touch file2
-cvscall -Q add file2
-cvsci -m"add file2" file2
-
-echo % create file3, file4 on branch v1_1
-cvscall -Q up -rv1_1
-touch file3
-touch file4
-cvscall -Q add file3 file4
-cvsci -m"add file3, file4 on branch v1_1" file3 file4
-
-echo % merge file2 from v1_0 to v1_1
-cvscall -Q up -jv1_0
-cvsci -m"MERGE from v1_0: add file2"
-
-# Step things up a notch: now we make the history really hairy, with
-# changes bouncing back and forth between trunk and v1_2 and merges
-# going both ways.  (I.e., try to model the real world.)
-
-echo "% create branch v1_2"
-cvscall -Q up -A
-cvscall -q tag -b v1_2
-
-echo "% create file5 on branch v1_2"
-cvscall -Q up -rv1_2
-touch file5
-cvs -Q add file5
-cvsci -m"add file5 on v1_2"
-
-echo "% create file6 on trunk post-v1_2"
-cvscall -Q up -A
-touch file6
-cvscall -Q add file6
-cvsci -m"add file6 on trunk post-v1_2"
-
-echo "% merge file5 from v1_2 to trunk"
-cvscall -Q up -A
-cvscall -Q up -jv1_2 file5
-cvsci -m"MERGE from v1_2: add file5"
-
-echo "% merge file6 from trunk to v1_2"
-cvscall -Q up -rv1_2
-cvscall up -jHEAD file6
-cvsci -m"MERGE from HEAD: add file6"
-
-echo % cvs rlog output
-filterpath cvscall -q rlog proj | egrep '^(RCS file|revision)'
-
-echo "% convert to hg (#1)"
-cd ..
-filterpath hg convert --datesort proj proj.hg
-
-echo "% hg glog output (#1)"
-hg -R proj.hg glog --template "{rev} {desc}\n"
-
-echo "% convert to hg (#2: with merge detection)"
-filterpath hg convert \
-  --config convert.cvsps.mergefrom='"^MERGE from (\S+):"' \
-  --datesort \
-  proj proj.hg2
-
-echo "% hg glog output (#2)"
-hg -R proj.hg2 glog --template "{rev} {desc}\n"
--- a/tests/test-convert-cvs-synthetic.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-% create cvs repository with one project
-cvs -f -d *REPO* init
-cvs -f -q co proj
-% create file1 on the trunk
-cvs -f -Q add file1
-cvs -f ci -madd file1 on trunk file1
-% create two branches
-cvs -f -q tag -b v1_0
-T file1
-cvs -f -q tag -b v1_1
-T file1
-% create file2 on branch v1_0
-cvs -f -Q up -rv1_0
-cvs -f -Q add file2
-cvs -f ci -madd file2 file2
-% create file3, file4 on branch v1_1
-cvs -f -Q up -rv1_1
-cvs -f -Q add file3 file4
-cvs -f ci -madd file3, file4 on branch v1_1 file3 file4
-% merge file2 from v1_0 to v1_1
-cvs -f -Q up -jv1_0
-cvs -f ci -mMERGE from v1_0: add file2
-% create branch v1_2
-cvs -f -Q up -A
-cvs -f -q tag -b v1_2
-T file1
-% create file5 on branch v1_2
-cvs -f -Q up -rv1_2
-cvs -f ci -madd file5 on v1_2
-% create file6 on trunk post-v1_2
-cvs -f -Q up -A
-cvs -f -Q add file6
-cvs -f ci -madd file6 on trunk post-v1_2
-% merge file5 from v1_2 to trunk
-cvs -f -Q up -A
-cvs -f -Q up -jv1_2 file5
-cvs -f ci -mMERGE from v1_2: add file5
-% merge file6 from trunk to v1_2
-cvs -f -Q up -rv1_2
-cvs -f up -jHEAD file6
-U file6
-cvs -f ci -mMERGE from HEAD: add file6
-% cvs rlog output
-RCS file: *REPO*/proj/file1,v
-revision 1.1
-RCS file: *REPO*/proj/Attic/file2,v
-revision 1.1
-revision 1.1.4.2
-revision 1.1.4.1
-revision 1.1.2.1
-RCS file: *REPO*/proj/Attic/file3,v
-revision 1.1
-revision 1.1.2.1
-RCS file: *REPO*/proj/Attic/file4,v
-revision 1.1
-revision 1.1.2.1
-RCS file: *REPO*/proj/file5,v
-revision 1.2
-revision 1.1
-revision 1.1.2.1
-RCS file: *REPO*/proj/file6,v
-revision 1.1
-revision 1.1.2.2
-revision 1.1.2.1
-% convert to hg (#1)
-initializing destination proj.hg repository
-connecting to *REPO*
-scanning source...
-collecting CVS rlog
-15 log entries
-creating changesets
-8 changeset entries
-sorting...
-converting...
-7 add file1 on trunk
-6 add file2
-5 add file3, file4 on branch v1_1
-4 MERGE from v1_0: add file2
-3 add file5 on v1_2
-2 add file6 on trunk post-v1_2
-1 MERGE from v1_2: add file5
-0 MERGE from HEAD: add file6
-% hg glog output (#1)
-o  7 MERGE from HEAD: add file6
-|
-| o  6 MERGE from v1_2: add file5
-| |
-| o  5 add file6 on trunk post-v1_2
-| |
-o |  4 add file5 on v1_2
-|/
-| o  3 MERGE from v1_0: add file2
-| |
-| o  2 add file3, file4 on branch v1_1
-|/
-| o  1 add file2
-|/
-o  0 add file1 on trunk
-
-% convert to hg (#2: with merge detection)
-initializing destination proj.hg2 repository
-connecting to *REPO*
-scanning source...
-collecting CVS rlog
-15 log entries
-creating changesets
-8 changeset entries
-sorting...
-converting...
-7 add file1 on trunk
-6 add file2
-5 add file3, file4 on branch v1_1
-4 MERGE from v1_0: add file2
-3 add file5 on v1_2
-2 add file6 on trunk post-v1_2
-1 MERGE from v1_2: add file5
-0 MERGE from HEAD: add file6
-% hg glog output (#2)
-o    7 MERGE from HEAD: add file6
-|\
-| o  6 MERGE from v1_2: add file5
-| |
-| o  5 add file6 on trunk post-v1_2
-| |
-o |  4 add file5 on v1_2
-|/
-| o    3 MERGE from v1_0: add file2
-| |\
-+---o  2 add file3, file4 on branch v1_1
-| |
-| o  1 add file2
-|/
-o  0 add file1 on trunk
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-cvs-synthetic.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,216 @@
+This feature requires use of builtin cvsps!
+
+  $ "$TESTDIR/hghave" cvs || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "graphlog = " >> $HGRCPATH
+
+create cvs repository with one project
+
+  $ mkdir cvsrepo
+  $ cd cvsrepo
+  $ CVSROOT=`pwd`
+  $ export CVSROOT
+  $ CVS_OPTIONS=-f
+  $ export CVS_OPTIONS
+  $ cd ..
+  $ cvscall()
+  > {
+  >     cvs -f "$@"
+  > }
+
+output of 'cvs ci' varies unpredictably, so just discard it
+
+  $ cvsci()
+  > {
+  >     cvs -f ci "$@" >/dev/null
+  > }
+  $ cvscall -d "$CVSROOT" init
+  $ mkdir cvsrepo/proj
+  $ cvscall -q co proj
+
+create file1 on the trunk
+
+  $ cd proj
+  $ touch file1
+  $ cvscall -Q add file1
+  $ cvsci -m"add file1 on trunk" file1
+
+create two branches
+
+  $ cvscall -q tag -b v1_0
+  T file1
+  $ cvscall -q tag -b v1_1
+  T file1
+
+create file2 on branch v1_0
+
+  $ cvscall -Q up -rv1_0
+  $ touch file2
+  $ cvscall -Q add file2
+  $ cvsci -m"add file2" file2
+
+create file3, file4 on branch v1_1
+
+  $ cvscall -Q up -rv1_1
+  $ touch file3
+  $ touch file4
+  $ cvscall -Q add file3 file4
+  $ cvsci -m"add file3, file4 on branch v1_1" file3 file4
+
+merge file2 from v1_0 to v1_1
+
+  $ cvscall -Q up -jv1_0
+  $ cvsci -m"MERGE from v1_0: add file2"
+  cvs commit: Examining .
+
+Step things up a notch: now we make the history really hairy, with
+changes bouncing back and forth between trunk and v1_2 and merges
+going both ways.  (I.e., try to model the real world.)
+create branch v1_2
+
+  $ cvscall -Q up -A
+  $ cvscall -q tag -b v1_2
+  T file1
+
+create file5 on branch v1_2
+
+  $ cvscall -Q up -rv1_2
+  $ touch file5
+  $ cvs -Q add file5
+  $ cvsci -m"add file5 on v1_2"
+  cvs commit: Examining .
+
+create file6 on trunk post-v1_2
+
+  $ cvscall -Q up -A
+  $ touch file6
+  $ cvscall -Q add file6
+  $ cvsci -m"add file6 on trunk post-v1_2"
+  cvs commit: Examining .
+
+merge file5 from v1_2 to trunk
+
+  $ cvscall -Q up -A
+  $ cvscall -Q up -jv1_2 file5
+  $ cvsci -m"MERGE from v1_2: add file5"
+  cvs commit: Examining .
+
+merge file6 from trunk to v1_2
+
+  $ cvscall -Q up -rv1_2
+  $ cvscall up -jHEAD file6
+  U file6
+  $ cvsci -m"MERGE from HEAD: add file6"
+  cvs commit: Examining .
+
+cvs rlog output
+
+  $ cvscall -q rlog proj | egrep '^(RCS file|revision)'
+  RCS file: */cvsrepo/proj/file1,v (glob)
+  revision 1.1
+  RCS file: */cvsrepo/proj/Attic/file2,v (glob)
+  revision 1.1
+  revision 1.1.4.2
+  revision 1.1.4.1
+  revision 1.1.2.1
+  RCS file: */cvsrepo/proj/Attic/file3,v (glob)
+  revision 1.1
+  revision 1.1.2.1
+  RCS file: */cvsrepo/proj/Attic/file4,v (glob)
+  revision 1.1
+  revision 1.1.2.1
+  RCS file: */cvsrepo/proj/file5,v (glob)
+  revision 1.2
+  revision 1.1
+  revision 1.1.2.1
+  RCS file: */cvsrepo/proj/file6,v (glob)
+  revision 1.1
+  revision 1.1.2.2
+  revision 1.1.2.1
+
+convert to hg (#1)
+
+  $ cd ..
+  $ hg convert --datesort proj proj.hg
+  initializing destination proj.hg repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  15 log entries
+  creating changesets
+  8 changeset entries
+  sorting...
+  converting...
+  7 add file1 on trunk
+  6 add file2
+  5 add file3, file4 on branch v1_1
+  4 MERGE from v1_0: add file2
+  3 add file5 on v1_2
+  2 add file6 on trunk post-v1_2
+  1 MERGE from v1_2: add file5
+  0 MERGE from HEAD: add file6
+
+hg glog output (#1)
+
+  $ hg -R proj.hg glog --template "{rev} {desc}\n"
+  o  7 MERGE from HEAD: add file6
+  |
+  | o  6 MERGE from v1_2: add file5
+  | |
+  | o  5 add file6 on trunk post-v1_2
+  | |
+  o |  4 add file5 on v1_2
+  |/
+  | o  3 MERGE from v1_0: add file2
+  | |
+  | o  2 add file3, file4 on branch v1_1
+  |/
+  | o  1 add file2
+  |/
+  o  0 add file1 on trunk
+  
+
+convert to hg (#2: with merge detection)
+
+  $ hg convert \
+  >   --config convert.cvsps.mergefrom='"^MERGE from (\S+):"' \
+  >   --datesort \
+  >   proj proj.hg2
+  initializing destination proj.hg2 repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  15 log entries
+  creating changesets
+  8 changeset entries
+  sorting...
+  converting...
+  7 add file1 on trunk
+  6 add file2
+  5 add file3, file4 on branch v1_1
+  4 MERGE from v1_0: add file2
+  3 add file5 on v1_2
+  2 add file6 on trunk post-v1_2
+  1 MERGE from v1_2: add file5
+  0 MERGE from HEAD: add file6
+
+hg glog output (#2)
+
+  $ hg -R proj.hg2 glog --template "{rev} {desc}\n"
+  o  7 MERGE from HEAD: add file6
+  |
+  | o  6 MERGE from v1_2: add file5
+  | |
+  | o  5 add file6 on trunk post-v1_2
+  | |
+  o |  4 add file5 on v1_2
+  |/
+  | o  3 MERGE from v1_0: add file2
+  | |
+  | o  2 add file3, file4 on branch v1_1
+  |/
+  | o  1 add file2
+  |/
+  o  0 add file1 on trunk
+  
--- a/tests/test-convert-cvs.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-% create cvs repository
-% create source directory
-% import source directory
-N src/a
-N src/b/c
-
-No conflicts created by this import
-
-% checkout source directory
-U src/a
-U src/b/c
-% commit a new revision changing b/c
-checking in src/b/c,v
-% convert fresh repo
-initializing destination src-hg repository
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-5 log entries
-cvslog hook: 5 entries
-creating changesets
-3 changeset entries
-cvschangesets hook: 3 changesets
-sorting...
-converting...
-2 Initial revision
-1 import
-0 ci0
-updating tags
-a
-c
-c
-% convert fresh repo with --filemap
-initializing destination src-filemap repository
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-5 log entries
-cvslog hook: 5 entries
-creating changesets
-3 changeset entries
-cvschangesets hook: 3 changesets
-sorting...
-converting...
-2 Initial revision
-1 import
-filtering out empty revision
-rolling back to revision 0 (undo commit)
-0 ci0
-updating tags
-c
-c
-2 update tags files: .hgtags
-1 ci0 files: b/c
-0 Initial revision files: b/c
-% convert full repository (issue1649)
-U srcfull/src/a
-U srcfull/src/b/c
-CVS
-CVSROOT
-src
-initializing destination srcfull-hg repository
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-creating changesets
-4 changeset entries
-sorting...
-converting...
-updating tags
-a
-c
-c
-% commit new file revisions
-checking in src/a,v
-checking in src/b/c,v
-% convert again
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-7 log entries
-cvslog hook: 7 entries
-creating changesets
-4 changeset entries
-cvschangesets hook: 4 changesets
-sorting...
-converting...
-0 ci1
-a
-a
-c
-c
-c
-% convert again with --filemap
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-7 log entries
-cvslog hook: 7 entries
-creating changesets
-4 changeset entries
-cvschangesets hook: 4 changesets
-sorting...
-converting...
-0 ci1
-c
-c
-c
-3 ci1 files: b/c
-2 update tags files: .hgtags
-1 ci0 files: b/c
-0 Initial revision files: b/c
-% commit branch
-U b/c
-T a
-T b/c
-checking in src/b/c,v
-% convert again
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-8 log entries
-cvslog hook: 8 entries
-creating changesets
-5 changeset entries
-cvschangesets hook: 5 changesets
-sorting...
-converting...
-0 ci2
-c
-d
-% convert again with --filemap
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-8 log entries
-cvslog hook: 8 entries
-creating changesets
-5 changeset entries
-cvschangesets hook: 5 changesets
-sorting...
-converting...
-0 ci2
-c
-d
-4 ci2 files: b/c
-3 ci1 files: b/c
-2 update tags files: .hgtags
-1 ci0 files: b/c
-0 Initial revision files: b/c
-% commit a new revision with funny log message
-checking in src/a,v
-% commit new file revisions with some fuzz
-checking in src/a,v
-checking in src/b/c,v
-% convert again
-connecting to cvsrepo
-scanning source...
-collecting CVS rlog
-11 log entries
-cvslog hook: 11 entries
-creating changesets
-8 changeset entries
-cvschangesets hook: 8 changesets
-sorting...
-converting...
-2 funny
-1 fuzzy
-0 fuzzy
-o  8 (branch) fuzzy files: b/c
-|
-o  7 (branch) fuzzy files: a
-|
-o  6 (branch) funny
-|  ----------------------------
-|  log message files: a
-o  5 (branch) ci2 files: b/c
-
-o  4 () ci1 files: a b/c
-|
-o  3 () update tags files: .hgtags
-|
-o  2 () ci0 files: b/c
-|
-| o  1 (INITIAL) import files:
-|/
-o  0 () Initial revision files: a b/c
-
-% testing debugcvsps
-collecting CVS rlog
-11 log entries
-cvslog hook: 11 entries
-creating changesets
-10 changeset entries
-cvschangesets hook: 10 changesets
----------------------
-PatchSet 1 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: INITIAL 
-Log:
-Initial revision
-
-Members: 
-	a:INITIAL->1.1 
-
----------------------
-PatchSet 2 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: INITIAL, branch 
-Log:
-Initial revision
-
-Members: 
-	b/c:INITIAL->1.1 
-
----------------------
-PatchSet 3 
-Date:
-Author:
-Branch: INITIAL
-Tag: start 
-Log:
-import
-
-Members: 
-	a:1.1->1.1.1.1 
-	b/c:1.1->1.1.1.1 
-
----------------------
-PatchSet 4 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Log:
-ci0
-
-Members: 
-	b/c:1.1->1.2 
-
----------------------
-PatchSet 5 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: branch 
-Log:
-ci1
-
-Members: 
-	a:1.1->1.2 
-
----------------------
-PatchSet 6 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Log:
-ci1
-
-Members: 
-	b/c:1.2->1.3 
-
----------------------
-PatchSet 7 
-Date:
-Author:
-Branch: branch
-Tag: (none) 
-Log:
-ci2
-
-Members: 
-	b/c:1.1->1.1.2.1 
-
----------------------
-PatchSet 8 
-Date:
-Author:
-Branch: branch
-Tag: (none) 
-Log:
-funny
-----------------------------
-log message
-
-Members: 
-	a:1.2->1.2.2.1 
-
----------------------
-PatchSet 9 
-Date:
-Author:
-Branch: branch
-Tag: (none) 
-Log:
-fuzzy
-
-Members: 
-	a:1.2.2.1->1.2.2.2 
-
----------------------
-PatchSet 10 
-Date:
-Author:
-Branch: branch
-Tag: (none) 
-Log:
-fuzzy
-
-Members: 
-	b/c:1.1.2.1->1.1.2.2 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-cvs.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,460 @@
+
+  $ "$TESTDIR/hghave" cvs || exit 80
+  $ cvscall()
+  > {
+  >     cvs -f "$@"
+  > }
+  $ hgcat()
+  > {
+  >     hg --cwd src-hg cat -r tip "$1"
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "graphlog = " >> $HGRCPATH
+  $ cat > cvshooks.py <<EOF
+  > def cvslog(ui,repo,hooktype,log):
+  >     print "%s hook: %d entries"%(hooktype,len(log))
+  > 
+  > def cvschangesets(ui,repo,hooktype,changesets):
+  >     print "%s hook: %d changesets"%(hooktype,len(changesets))
+  > EOF
+  $ hookpath=`pwd`
+  $ echo "[hooks]" >> $HGRCPATH
+  $ echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
+  $ echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
+
+create cvs repository
+
+  $ mkdir cvsrepo
+  $ cd cvsrepo
+  $ CVSROOT=`pwd`
+  $ export CVSROOT
+  $ CVS_OPTIONS=-f
+  $ export CVS_OPTIONS
+  $ cd ..
+  $ cvscall -q -d "$CVSROOT" init
+
+create source directory
+
+  $ mkdir src-temp
+  $ cd src-temp
+  $ echo a > a
+  $ mkdir b
+  $ cd b
+  $ echo c > c
+  $ cd ..
+
+import source directory
+
+  $ cvscall -q import -m import src INITIAL start
+  N src/a
+  N src/b/c
+  
+  No conflicts created by this import
+  
+  $ cd ..
+
+checkout source directory
+
+  $ cvscall -q checkout src
+  U src/a
+  U src/b/c
+
+commit a new revision changing b/c
+
+  $ cd src
+  $ sleep 1
+  $ echo c >> b/c
+  $ cvscall -q commit -mci0 . | grep '<--'
+  */cvsrepo/src/b/c,v  <--  *c (glob)
+  $ cd ..
+
+convert fresh repo
+
+  $ hg convert src src-hg
+  initializing destination src-hg repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  5 log entries
+  cvslog hook: 5 entries
+  creating changesets
+  3 changeset entries
+  cvschangesets hook: 3 changesets
+  sorting...
+  converting...
+  2 Initial revision
+  1 import
+  0 ci0
+  updating tags
+  $ hgcat a
+  a
+  $ hgcat b/c
+  c
+  c
+
+convert fresh repo with --filemap
+
+  $ echo include b/c > filemap
+  $ hg convert --filemap filemap src src-filemap
+  initializing destination src-filemap repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  5 log entries
+  cvslog hook: 5 entries
+  creating changesets
+  3 changeset entries
+  cvschangesets hook: 3 changesets
+  sorting...
+  converting...
+  2 Initial revision
+  1 import
+  filtering out empty revision
+  rolling back to revision 0 (undo commit)
+  0 ci0
+  updating tags
+  $ hgcat b/c
+  c
+  c
+  $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
+  2 update tags files: .hgtags
+  1 ci0 files: b/c
+  0 Initial revision files: b/c
+
+convert full repository (issue1649)
+
+  $ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
+  U srcfull/src/a
+  U srcfull/src/b/c
+  $ ls srcfull
+  CVS
+  CVSROOT
+  src
+  $ hg convert srcfull srcfull-hg \
+  >     | grep -v 'log entries' | grep -v 'hook:' \
+  >     | grep -v '^[0-3] .*' # filter instable changeset order
+  initializing destination srcfull-hg repository
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  creating changesets
+  4 changeset entries
+  sorting...
+  converting...
+  updating tags
+  $ hg cat -r tip srcfull-hg/src/a
+  a
+  $ hg cat -r tip srcfull-hg/src/b/c
+  c
+  c
+
+commit new file revisions
+
+  $ cd src
+  $ echo a >> a
+  $ echo c >> b/c
+  $ cvscall -q commit -mci1 . | grep '<--'
+  */cvsrepo/src/a,v  <--  a (glob)
+  */cvsrepo/src/b/c,v  <--  *c (glob)
+  $ cd ..
+
+convert again
+
+  $ hg convert src src-hg
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  7 log entries
+  cvslog hook: 7 entries
+  creating changesets
+  4 changeset entries
+  cvschangesets hook: 4 changesets
+  sorting...
+  converting...
+  0 ci1
+  $ hgcat a
+  a
+  a
+  $ hgcat b/c
+  c
+  c
+  c
+
+convert again with --filemap
+
+  $ hg convert --filemap filemap src src-filemap
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  7 log entries
+  cvslog hook: 7 entries
+  creating changesets
+  4 changeset entries
+  cvschangesets hook: 4 changesets
+  sorting...
+  converting...
+  0 ci1
+  $ hgcat b/c
+  c
+  c
+  c
+  $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
+  3 ci1 files: b/c
+  2 update tags files: .hgtags
+  1 ci0 files: b/c
+  0 Initial revision files: b/c
+
+commit branch
+
+  $ cd src
+  $ cvs -q update -r1.1 b/c
+  U b/c
+  $ cvs -q tag -b branch
+  T a
+  T b/c
+  $ cvs -q update -r branch > /dev/null
+  $ echo d >> b/c
+  $ cvs -q commit -mci2 . | grep '<--'
+  */cvsrepo/src/b/c,v  <--  *c (glob)
+  $ cd ..
+
+convert again
+
+  $ hg convert src src-hg
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  8 log entries
+  cvslog hook: 8 entries
+  creating changesets
+  5 changeset entries
+  cvschangesets hook: 5 changesets
+  sorting...
+  converting...
+  0 ci2
+  $ hgcat b/c
+  c
+  d
+
+convert again with --filemap
+
+  $ hg convert --filemap filemap src src-filemap
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  8 log entries
+  cvslog hook: 8 entries
+  creating changesets
+  5 changeset entries
+  cvschangesets hook: 5 changesets
+  sorting...
+  converting...
+  0 ci2
+  $ hgcat b/c
+  c
+  d
+  $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
+  4 ci2 files: b/c
+  3 ci1 files: b/c
+  2 update tags files: .hgtags
+  1 ci0 files: b/c
+  0 Initial revision files: b/c
+
+commit a new revision with funny log message
+
+  $ cd src
+  $ sleep 1
+  $ echo e >> a
+  $ cvscall -q commit -m'funny
+  > ----------------------------
+  > log message' . | grep '<--' |\
+  >  sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
+  checking in src/a,v
+
+commit new file revisions with some fuzz
+
+  $ sleep 1
+  $ echo f >> a
+  $ cvscall -q commit -mfuzzy . | grep '<--'
+  */cvsrepo/src/a,v  <--  a (glob)
+  $ sleep 4 # the two changes will be split if fuzz < 4
+  $ echo g >> b/c
+  $ cvscall -q commit -mfuzzy . | grep '<--'
+  */cvsrepo/src/b/c,v  <--  *c (glob)
+  $ cd ..
+
+convert again
+
+  $ hg convert --config convert.cvsps.fuzz=2 src src-hg
+  connecting to */cvsrepo (glob)
+  scanning source...
+  collecting CVS rlog
+  11 log entries
+  cvslog hook: 11 entries
+  creating changesets
+  8 changeset entries
+  cvschangesets hook: 8 changesets
+  sorting...
+  converting...
+  2 funny
+  1 fuzzy
+  0 fuzzy
+  $ hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
+  o  8 (branch) fuzzy files: b/c
+  |
+  o  7 (branch) fuzzy files: a
+  |
+  o  6 (branch) funny
+  |  ----------------------------
+  |  log message files: a
+  o  5 (branch) ci2 files: b/c
+  
+  o  4 () ci1 files: a b/c
+  |
+  o  3 () update tags files: .hgtags
+  |
+  o  2 () ci0 files: b/c
+  |
+  | o  1 (INITIAL) import files:
+  |/
+  o  0 () Initial revision files: a b/c
+  
+
+testing debugcvsps
+
+  $ cd src
+  $ hg debugcvsps --fuzz=2
+  collecting CVS rlog
+  11 log entries
+  cvslog hook: 11 entries
+  creating changesets
+  10 changeset entries
+  cvschangesets hook: 10 changesets
+  ---------------------
+  PatchSet 1 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: INITIAL 
+  Log:
+  Initial revision
+  
+  Members: 
+  	a:INITIAL->1.1 
+  
+  ---------------------
+  PatchSet 2 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: INITIAL, branch 
+  Log:
+  Initial revision
+  
+  Members: 
+  	b/c:INITIAL->1.1 
+  
+  ---------------------
+  PatchSet 3 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: INITIAL
+  Tag: start 
+  Log:
+  import
+  
+  Members: 
+  	a:1.1->1.1.1.1 
+  	b/c:1.1->1.1.1.1 
+  
+  ---------------------
+  PatchSet 4 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Log:
+  ci0
+  
+  Members: 
+  	b/c:1.1->1.2 
+  
+  ---------------------
+  PatchSet 5 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: branch 
+  Log:
+  ci1
+  
+  Members: 
+  	a:1.1->1.2 
+  
+  ---------------------
+  PatchSet 6 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: HEAD
+  Tag: (none) 
+  Log:
+  ci1
+  
+  Members: 
+  	b/c:1.2->1.3 
+  
+  ---------------------
+  PatchSet 7 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: branch
+  Tag: (none) 
+  Log:
+  ci2
+  
+  Members: 
+  	b/c:1.1->1.1.2.1 
+  
+  ---------------------
+  PatchSet 8 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: branch
+  Tag: (none) 
+  Log:
+  funny
+  ----------------------------
+  log message
+  
+  Members: 
+  	a:1.2->1.2.2.1 
+  
+  ---------------------
+  PatchSet 9 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: branch
+  Tag: (none) 
+  Log:
+  fuzzy
+  
+  Members: 
+  	a:1.2.2.1->1.2.2.2 
+  
+  ---------------------
+  PatchSet 10 
+  Date: * (glob)
+  Author: * (glob)
+  Branch: branch
+  Tag: (none) 
+  Log:
+  fuzzy
+  
+  Members: 
+  	b/c:1.1.2.1->1.1.2.2 
+  
+
--- a/tests/test-convert-cvsnt-mergepoints	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" cvs || exit 80
-
-filterpath()
-{
-    eval "$@" | sed "s:$CVSROOT:*REPO*:g"
-}
-
-cvscall()
-{
-    echo cvs -f "$@"
-    cvs -f "$@"
-}
-
-# output of 'cvs ci' varies unpredictably, so discard most of it
-# -- just keep the part that matters
-cvsci()
-{
-    echo cvs -f ci -f "$@"
-    cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:"
-}
-
-hgcat()
-{
-    hg --cwd src-hg cat -r tip "$1"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "graphlog = " >> $HGRCPATH
-
-echo "% create cvs repository"
-mkdir cvsmaster
-cd cvsmaster
-CVSROOT=`pwd`
-export CVSROOT
-CVS_OPTIONS=-f
-export CVS_OPTIONS
-cd ..
-filterpath cvscall -Q -d "$CVSROOT" init
-
-echo "% checkout #1: add foo.txt"
-cvscall -Q checkout -d cvsworktmp .
-cd cvsworktmp
-mkdir foo
-cvscall -Q add foo
-cd foo
-echo foo > foo.txt
-cvscall -Q add foo.txt 
-cvsci -m "add foo.txt" foo.txt
- 
-cd ../..
-rm -rf cvsworktmp
-
-echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it"
-cvscall -Q checkout -d cvswork foo
-
-cd cvswork
-
-cvscall -q rtag -b -R MYBRANCH1 foo
-cvscall -Q update -P -r MYBRANCH1
-echo bar > foo.txt
-cvsci -m "bar" foo.txt
-echo baz > foo.txt
-cvsci -m "baz" foo.txt
-
-echo "% create MYBRANCH1_2 and modify foo.txt some more"
-cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
-cvscall -Q update -P -r MYBRANCH1_2
-
-echo bazzie > foo.txt
-cvsci -m "bazzie" foo.txt
-
-echo "% create MYBRANCH1_1 and modify foo.txt yet again"
-cvscall -q rtag -b -R MYBRANCH1_1 foo
-cvscall -Q update -P -r MYBRANCH1_1
-
-echo quux > foo.txt
-cvsci -m "quux" foo.txt
-
-echo "% merge MYBRANCH1 to MYBRANCH1_1"
-filterpath cvscall -Q update -P -jMYBRANCH1
-# carefully placed sleep to dodge cvs bug (optimization?) where it
-# sometimes ignores a "commit" command if it comes too fast (the -f
-# option in cvsci seems to work for all the other commits in this
-# script)
-sleep 1
-echo xyzzy > foo.txt
-cvsci -m "merge1+clobber" foo.txt
-
-echo "% return to trunk and merge MYBRANCH1_2"
-cvscall -Q update -P -A
-filterpath cvscall -Q update -P -jMYBRANCH1_2
-cvsci -m "merge2" foo.txt
-
-REALCVS=`which cvs`
-echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
-chmod +x ../cvs
-PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
-
-cd ..
--- a/tests/test-convert-cvsnt-mergepoints.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-% create cvs repository
-cvs -f -Q -d *REPO* init
-% checkout #1: add foo.txt
-cvs -f -Q checkout -d cvsworktmp .
-cvs -f -Q add foo
-cvs -f -Q add foo.txt
-cvs -f ci -f -m add foo.txt foo.txt
-initial revision: 1.1
-% checkout #2: create MYBRANCH1 and modify foo.txt on it
-cvs -f -Q checkout -d cvswork foo
-cvs -f -q rtag -b -R MYBRANCH1 foo
-cvs -f -Q update -P -r MYBRANCH1
-cvs -f ci -f -m bar foo.txt
-new revision: 1.1.2.1; previous revision: 1.1
-cvs -f ci -f -m baz foo.txt
-new revision: 1.1.2.2; previous revision: 1.1.2.1
-% create MYBRANCH1_2 and modify foo.txt some more
-cvs -f -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
-cvs -f -Q update -P -r MYBRANCH1_2
-cvs -f ci -f -m bazzie foo.txt
-new revision: 1.1.2.2.2.1; previous revision: 1.1.2.2
-% create MYBRANCH1_1 and modify foo.txt yet again
-cvs -f -q rtag -b -R MYBRANCH1_1 foo
-cvs -f -Q update -P -r MYBRANCH1_1
-cvs -f ci -f -m quux foo.txt
-new revision: 1.1.4.1; previous revision: 1.1
-% merge MYBRANCH1 to MYBRANCH1_1
-rcsmerge: warning: conflicts during merge
-cvs -f -Q update -P -jMYBRANCH1
-RCS file: *REPO*/foo/foo.txt,v
-retrieving revision 1.1
-retrieving revision 1.1.2.2
-Merging differences between 1.1 and 1.1.2.2 into foo.txt
-cvs -f ci -f -m merge1+clobber foo.txt
-new revision: 1.1.4.2; previous revision: 1.1.4.1
-% return to trunk and merge MYBRANCH1_2
-cvs -f -Q update -P -A
-cvs -f -Q update -P -jMYBRANCH1_2
-RCS file: *REPO*/foo/foo.txt,v
-retrieving revision 1.1
-retrieving revision 1.1.2.2.2.1
-Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt
-cvs -f ci -f -m merge2 foo.txt
-new revision: 1.2; previous revision: 1.1
-collecting CVS rlog
-7 log entries
-creating changesets
-7 changeset entries
----------------------
-PatchSet 1 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Branchpoints: MYBRANCH1_1, MYBRANCH1 
-Log:
-foo.txt
-
-Members: 
-	foo.txt:INITIAL->1.1 
-
----------------------
-PatchSet 2 
-Date:
-Author:
-Branch: MYBRANCH1
-Tag: (none) 
-Parent: 1
-Log:
-bar
-
-Members: 
-	foo.txt:1.1->1.1.2.1 
-
----------------------
-PatchSet 3 
-Date:
-Author:
-Branch: MYBRANCH1
-Tag: (none) 
-Branchpoints: MYBRANCH1_2 
-Parent: 2
-Log:
-baz
-
-Members: 
-	foo.txt:1.1.2.1->1.1.2.2 
-
----------------------
-PatchSet 4 
-Date:
-Author:
-Branch: MYBRANCH1_1
-Tag: (none) 
-Parent: 1
-Log:
-quux
-
-Members: 
-	foo.txt:1.1->1.1.4.1 
-
----------------------
-PatchSet 5 
-Date:
-Author:
-Branch: MYBRANCH1_2
-Tag: (none) 
-Parent: 3
-Log:
-bazzie
-
-Members: 
-	foo.txt:1.1.2.2->1.1.2.2.2.1 
-
----------------------
-PatchSet 6 
-Date:
-Author:
-Branch: HEAD
-Tag: (none) 
-Parents: 1,5
-Log:
-merge
-
-Members: 
-	foo.txt:1.1->1.2 
-
----------------------
-PatchSet 7 
-Date:
-Author:
-Branch: MYBRANCH1_1
-Tag: (none) 
-Parents: 4,3
-Log:
-merge
-
-Members: 
-	foo.txt:1.1.4.1->1.1.4.2 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-cvsnt-mergepoints.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,202 @@
+
+  $ "$TESTDIR/hghave" cvs || exit 80
+  $ filterpath()
+  > {
+  >     eval "$@" | sed "s:$CVSROOT:*REPO*:g"
+  > }
+  $ cvscall()
+  > {
+  >     cvs -f "$@"
+  > }
+
+output of 'cvs ci' varies unpredictably, so discard most of it
+-- just keep the part that matters
+
+  $ cvsci()
+  > {
+  >     cvs -f ci -f "$@" > /dev/null
+  > }
+  $ hgcat()
+  > {
+  >     hg --cwd src-hg cat -r tip "$1"
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "graphlog = " >> $HGRCPATH
+
+create cvs repository
+
+  $ mkdir cvsmaster
+  $ cd cvsmaster
+  $ CVSROOT=`pwd`
+  $ export CVSROOT
+  $ CVS_OPTIONS=-f
+  $ export CVS_OPTIONS
+  $ cd ..
+  $ filterpath cvscall -Q -d "$CVSROOT" init
+
+checkout #1: add foo.txt
+
+  $ cvscall -Q checkout -d cvsworktmp .
+  $ cd cvsworktmp
+  $ mkdir foo
+  $ cvscall -Q add foo
+  $ cd foo
+  $ echo foo > foo.txt
+  $ cvscall -Q add foo.txt 
+  $ cvsci -m "add foo.txt" foo.txt
+  $ cd ../..
+  $ rm -rf cvsworktmp
+
+checkout #2: create MYBRANCH1 and modify foo.txt on it
+
+  $ cvscall -Q checkout -d cvswork foo
+  $ cd cvswork
+  $ cvscall -q rtag -b -R MYBRANCH1 foo
+  $ cvscall -Q update -P -r MYBRANCH1
+  $ echo bar > foo.txt
+  $ cvsci -m "bar" foo.txt
+  $ echo baz > foo.txt
+  $ cvsci -m "baz" foo.txt
+
+create MYBRANCH1_2 and modify foo.txt some more
+
+  $ cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
+  $ cvscall -Q update -P -r MYBRANCH1_2
+  $ echo bazzie > foo.txt
+  $ cvsci -m "bazzie" foo.txt
+
+create MYBRANCH1_1 and modify foo.txt yet again
+
+  $ cvscall -q rtag -b -R MYBRANCH1_1 foo
+  $ cvscall -Q update -P -r MYBRANCH1_1
+  $ echo quux > foo.txt
+  $ cvsci -m "quux" foo.txt
+
+merge MYBRANCH1 to MYBRANCH1_1
+
+  $ filterpath cvscall -Q update -P -jMYBRANCH1
+  rcsmerge: warning: conflicts during merge
+  RCS file: *REPO*/foo/foo.txt,v
+  retrieving revision 1.1
+  retrieving revision 1.1.2.2
+  Merging differences between 1.1 and 1.1.2.2 into foo.txt
+
+carefully placed sleep to dodge cvs bug (optimization?) where it
+sometimes ignores a "commit" command if it comes too fast (the -f
+option in cvsci seems to work for all the other commits in this
+script)
+
+  $ sleep 1
+  $ echo xyzzy > foo.txt
+  $ cvsci -m "merge1+clobber" foo.txt
+
+return to trunk and merge MYBRANCH1_2
+
+  $ cvscall -Q update -P -A
+  $ filterpath cvscall -Q update -P -jMYBRANCH1_2
+  RCS file: *REPO*/foo/foo.txt,v
+  retrieving revision 1.1
+  retrieving revision 1.1.2.2.2.1
+  Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt
+  $ cvsci -m "merge2" foo.txt
+  $ REALCVS=`which cvs`
+  $ echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
+  $ chmod +x ../cvs
+  $ PATH=..:${PATH} hg debugcvsps --parents foo
+  collecting CVS rlog
+  7 log entries
+  creating changesets
+  7 changeset entries
+  ---------------------
+  PatchSet 1 
+  Date: * (glob)
+  Author: user
+  Branch: HEAD
+  Tag: (none) 
+  Branchpoints: MYBRANCH1_1, MYBRANCH1 
+  Log:
+  foo.txt
+  
+  Members: 
+  	foo.txt:INITIAL->1.1 
+  
+  ---------------------
+  PatchSet 2 
+  Date: * (glob)
+  Author: user
+  Branch: MYBRANCH1
+  Tag: (none) 
+  Parent: 1
+  Log:
+  bar
+  
+  Members: 
+  	foo.txt:1.1->1.1.2.1 
+  
+  ---------------------
+  PatchSet 3 
+  Date: * (glob)
+  Author: user
+  Branch: MYBRANCH1
+  Tag: (none) 
+  Branchpoints: MYBRANCH1_2 
+  Parent: 2
+  Log:
+  baz
+  
+  Members: 
+  	foo.txt:1.1.2.1->1.1.2.2 
+  
+  ---------------------
+  PatchSet 4 
+  Date: * (glob)
+  Author: user
+  Branch: MYBRANCH1_1
+  Tag: (none) 
+  Parent: 1
+  Log:
+  quux
+  
+  Members: 
+  	foo.txt:1.1->1.1.4.1 
+  
+  ---------------------
+  PatchSet 5 
+  Date: * (glob)
+  Author: user
+  Branch: MYBRANCH1_2
+  Tag: (none) 
+  Parent: 3
+  Log:
+  bazzie
+  
+  Members: 
+  	foo.txt:1.1.2.2->1.1.2.2.2.1 
+  
+  ---------------------
+  PatchSet 6 
+  Date: * (glob)
+  Author: user
+  Branch: HEAD
+  Tag: (none) 
+  Parents: 1,5
+  Log:
+  merge
+  
+  Members: 
+  	foo.txt:1.1->1.2 
+  
+  ---------------------
+  PatchSet 7 
+  Date: * (glob)
+  Author: user
+  Branch: MYBRANCH1_1
+  Tag: (none) 
+  Parents: 4,3
+  Log:
+  merge
+  
+  Members: 
+  	foo.txt:1.1.4.1->1.1.4.2 
+  
--- a/tests/test-convert-darcs	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" darcs || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-
-DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
-HOME=`pwd`/do_not_use_HOME_darcs; export HOME
-
-# skip if we can't import elementtree
-mkdir dummy
-mkdir dummy/_darcs
-if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
-    echo 'skipped: missing feature: elementtree module'
-    exit 80
-fi
-
-echo '% try converting darcs1 repository'
-hg convert -s darcs "$TESTDIR/darcs/darcs1" 2>&1 | grep darcs-1.0
-
-echo % initialize darcs repo
-mkdir darcs-repo
-cd darcs-repo
-darcs init
-echo a > a
-darcs record -a -l -m p0
-cd ..
-
-echo % branch and update
-darcs get darcs-repo darcs-clone >/dev/null
-cd darcs-clone
-echo c >> a
-echo c > c
-darcs record -a -l -m p1.1
-cd ..
-
-echo % update source
-cd darcs-repo
-echo b >> a
-echo b > b
-darcs record -a -l -m p1.2
-
-echo % merge branch
-darcs pull -a ../darcs-clone
-sleep 1
-echo e > a
-echo f > f
-mkdir dir
-echo d > dir/d
-echo d > dir/d2
-darcs record -a -l -m p2
-
-echo % test file and directory move
-darcs mv f ff
-# Test remove + move
-darcs remove dir/d2
-rm dir/d2
-darcs mv dir dir2
-darcs record -a -l -m p3
-
-echo % test utf-8 commit message and author
-echo g > g
-# darcs is encoding agnostic, so it takes whatever bytes it's given
-darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
-
-glog()
-{
-    HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
-}
-
-cd ..
-hg convert darcs-repo darcs-repo-hg
-# The converter does not currently handle patch conflicts very well.
-# When they occur, it reverts *all* changes and moves forward,
-# letting the conflict resolving patch fix collisions.
-# Unfortunately, non-conflicting changes, like the addition of the
-# "c" file in p1.1 patch are reverted too.
-# Just to say that manifest not listing "c" here is a bug.
-glog -R darcs-repo-hg
-hg up -q -R darcs-repo-hg
-hg -R darcs-repo-hg manifest --debug
--- a/tests/test-convert-darcs.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-% try converting darcs1 repository
-darcs-1.0 repository format is unsupported, please upgrade
-% initialize darcs repo
-Finished recording patch 'p0'
-% branch and update
-Finished recording patch 'p1.1'
-% update source
-Finished recording patch 'p1.2'
-% merge branch
-Backing up ./a(-darcs-backup0)
-We have conflicts in the following files:
-./a
-Finished pulling and applying.
-Finished recording patch 'p2'
-% test file and directory move
-Finished recording patch 'p3'
-% test utf-8 commit message and author
-Finished recording patch 'p4: desc ñ'
-initializing destination darcs-repo-hg repository
-scanning source...
-sorting...
-converting...
-5 p0
-4 p1.2
-3 p1.1
-2 p2
-1 p3
-0 p4: desc ?
-o  5 "p4: desc ñ" (author ñ) files: g
-|
-o  4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
-|
-o  3 "p2" (test@example.org) files: a dir/d dir/d2 f
-|
-o  2 "p1.1" (test@example.org) files:
-|
-o  1 "p1.2" (test@example.org) files: a b
-|
-o  0 "p0" (test@example.org) files: a
-
-7225b30cdf38257d5cc7780772c051b6f33e6d6b 644   a
-1e88685f5ddec574a34c70af492f95b6debc8741 644   b
-37406831adc447ec2385014019599dfec953c806 644   dir2/d
-b783a337463792a5c7d548ad85a7d3253c16ba8c 644   ff
-0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644   g
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-darcs.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,131 @@
+
+  $ "$TESTDIR/hghave" darcs || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'graphlog =' >> $HGRCPATH
+  $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
+  $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
+
+skip if we can't import elementtree
+
+  $ mkdir dummy
+  $ mkdir dummy/_darcs
+  $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
+  >     echo 'skipped: missing feature: elementtree module'
+  >     exit 80
+  > fi
+
+try converting darcs1 repository
+
+  $ hg clone -q "$TESTDIR/darcs1.hg" darcs
+  $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
+  darcs-1.0 repository format is unsupported, please upgrade
+
+initialize darcs repo
+
+  $ mkdir darcs-repo
+  $ cd darcs-repo
+  $ darcs init
+  $ echo a > a
+  $ darcs record -a -l -m p0
+  Finished recording patch 'p0'
+  $ cd ..
+
+branch and update
+
+  $ darcs get darcs-repo darcs-clone >/dev/null
+  $ cd darcs-clone
+  $ echo c >> a
+  $ echo c > c
+  $ darcs record -a -l -m p1.1
+  Finished recording patch 'p1.1'
+  $ cd ..
+
+update source
+
+  $ cd darcs-repo
+  $ echo b >> a
+  $ echo b > b
+  $ darcs record -a -l -m p1.2
+  Finished recording patch 'p1.2'
+
+merge branch
+
+  $ darcs pull -a ../darcs-clone
+  Backing up ./a(-darcs-backup0)
+  We have conflicts in the following files:
+  ./a
+  Finished pulling and applying.
+  $ sleep 1
+  $ echo e > a
+  $ echo f > f
+  $ mkdir dir
+  $ echo d > dir/d
+  $ echo d > dir/d2
+  $ darcs record -a -l -m p2
+  Finished recording patch 'p2'
+
+test file and directory move
+
+  $ darcs mv f ff
+
+Test remove + move
+
+  $ darcs remove dir/d2
+  $ rm dir/d2
+  $ darcs mv dir dir2
+  $ darcs record -a -l -m p3
+  Finished recording patch 'p3'
+
+test utf-8 commit message and author
+
+  $ echo g > g
+
+darcs is encoding agnostic, so it takes whatever bytes it's given
+
+  $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
+  Finished recording patch 'p4: desc ñ'
+  $ glog()
+  > {
+  >     HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
+  > }
+  $ cd ..
+  $ hg convert darcs-repo darcs-repo-hg
+  initializing destination darcs-repo-hg repository
+  scanning source...
+  sorting...
+  converting...
+  5 p0
+  4 p1.2
+  3 p1.1
+  2 p2
+  1 p3
+  0 p4: desc ?
+
+The converter does not currently handle patch conflicts very well.
+When they occur, it reverts *all* changes and moves forward,
+letting the conflict resolving patch fix collisions.
+Unfortunately, non-conflicting changes, like the addition of the
+"c" file in p1.1 patch are reverted too.
+Just to say that manifest not listing "c" here is a bug.
+
+  $ glog -R darcs-repo-hg
+  o  5 "p4: desc ñ" (author ñ) files: g
+  |
+  o  4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
+  |
+  o  3 "p2" (test@example.org) files: a dir/d dir/d2 f
+  |
+  o  2 "p1.1" (test@example.org) files:
+  |
+  o  1 "p1.2" (test@example.org) files: a b
+  |
+  o  0 "p0" (test@example.org) files: a
+  
+  $ hg up -q -R darcs-repo-hg
+  $ hg -R darcs-repo-hg manifest --debug
+  7225b30cdf38257d5cc7780772c051b6f33e6d6b 644   a
+  1e88685f5ddec574a34c70af492f95b6debc8741 644   b
+  37406831adc447ec2385014019599dfec953c806 644   dir2/d
+  b783a337463792a5c7d548ad85a7d3253c16ba8c 644   ff
+  0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644   g
--- a/tests/test-convert-datesort	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-convert=
-graphlog=
-EOF
-
-hg init t
-cd t
-echo a >> a
-hg ci -Am a0 -d '1 0'
-hg branch brancha
-echo a >> a
-hg ci -m a1 -d '2 0'
-echo a >> a
-hg ci -m a2 -d '3 0'
-echo a >> a
-hg ci -m a3 -d '4 0'
-hg up -C 0
-hg branch branchb
-echo b >> b
-hg ci -Am b0 -d '6 0'
-hg up -C brancha
-echo a >> a
-hg ci -m a4 -d '5 0'
-echo a >> a
-hg ci -m a5 -d '7 0'
-echo a >> a
-hg ci -m a6 -d '8 0'
-hg up -C branchb
-echo b >> b
-hg ci -m b1 -d '9 0'
-cd ..
-
-echo % convert with datesort
-hg convert --datesort t t-datesort
-echo % graph converted repo
-hg -R t-datesort glog --template '{rev} "{desc}"\n'
-
-echo '% convert with datesort (default mode)'
-hg convert t t-sourcesort
-echo % graph converted repo
-hg -R t-sourcesort glog --template '{rev} "{desc}"\n'
-
--- a/tests/test-convert-datesort.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-adding a
-marked working directory as branch brancha
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch branchb
-adding b
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% convert with datesort
-initializing destination t-datesort repository
-scanning source...
-sorting...
-converting...
-8 a0
-7 a1
-6 a2
-5 a3
-4 a4
-3 b0
-2 a5
-1 a6
-0 b1
-% graph converted repo
-o  8 "b1"
-|
-| o  7 "a6"
-| |
-| o  6 "a5"
-| |
-o |  5 "b0"
-| |
-| o  4 "a4"
-| |
-| o  3 "a3"
-| |
-| o  2 "a2"
-| |
-| o  1 "a1"
-|/
-o  0 "a0"
-
-% convert with datesort (default mode)
-initializing destination t-sourcesort repository
-scanning source...
-sorting...
-converting...
-8 a0
-7 a1
-6 a2
-5 a3
-4 b0
-3 a4
-2 a5
-1 a6
-0 b1
-% graph converted repo
-o  8 "b1"
-|
-| o  7 "a6"
-| |
-| o  6 "a5"
-| |
-| o  5 "a4"
-| |
-o |  4 "b0"
-| |
-| o  3 "a3"
-| |
-| o  2 "a2"
-| |
-| o  1 "a1"
-|/
-o  0 "a0"
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-datesort.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,117 @@
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > convert=
+  > graphlog=
+  > EOF
+  $ hg init t
+  $ cd t
+  $ echo a >> a
+  $ hg ci -Am a0 -d '1 0'
+  adding a
+  $ hg branch brancha
+  marked working directory as branch brancha
+  $ echo a >> a
+  $ hg ci -m a1 -d '2 0'
+  $ echo a >> a
+  $ hg ci -m a2 -d '3 0'
+  $ echo a >> a
+  $ hg ci -m a3 -d '4 0'
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg branch branchb
+  marked working directory as branch branchb
+  $ echo b >> b
+  $ hg ci -Am b0 -d '6 0'
+  adding b
+  $ hg up -C brancha
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a >> a
+  $ hg ci -m a4 -d '5 0'
+  $ echo a >> a
+  $ hg ci -m a5 -d '7 0'
+  $ echo a >> a
+  $ hg ci -m a6 -d '8 0'
+  $ hg up -C branchb
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b >> b
+  $ hg ci -m b1 -d '9 0'
+  $ cd ..
+
+convert with datesort
+
+  $ hg convert --datesort t t-datesort
+  initializing destination t-datesort repository
+  scanning source...
+  sorting...
+  converting...
+  8 a0
+  7 a1
+  6 a2
+  5 a3
+  4 a4
+  3 b0
+  2 a5
+  1 a6
+  0 b1
+
+graph converted repo
+
+  $ hg -R t-datesort glog --template '{rev} "{desc}"\n'
+  o  8 "b1"
+  |
+  | o  7 "a6"
+  | |
+  | o  6 "a5"
+  | |
+  o |  5 "b0"
+  | |
+  | o  4 "a4"
+  | |
+  | o  3 "a3"
+  | |
+  | o  2 "a2"
+  | |
+  | o  1 "a1"
+  |/
+  o  0 "a0"
+  
+
+convert with datesort (default mode)
+
+  $ hg convert t t-sourcesort
+  initializing destination t-sourcesort repository
+  scanning source...
+  sorting...
+  converting...
+  8 a0
+  7 a1
+  6 a2
+  5 a3
+  4 b0
+  3 a4
+  2 a5
+  1 a6
+  0 b1
+
+graph converted repo
+
+  $ hg -R t-sourcesort glog --template '{rev} "{desc}"\n'
+  o  8 "b1"
+  |
+  | o  7 "a6"
+  | |
+  | o  6 "a5"
+  | |
+  | o  5 "a4"
+  | |
+  o |  4 "b0"
+  | |
+  | o  3 "a3"
+  | |
+  | o  2 "a2"
+  | |
+  | o  1 "a1"
+  |/
+  o  0 "a0"
+  
--- a/tests/test-convert-filemap	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-#!/bin/sh
-
-HGMERGE=true; export HGMERGE
-
-echo '[extensions]' >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-echo 'convert =' >> $HGRCPATH
-
-glog()
-{
-    hg glog --template '{rev} "{desc}" files: {files}\n' "$@"
-}
-
-hg init source
-cd source
-
-echo foo > foo
-echo baz > baz
-mkdir -p dir/subdir
-echo dir/file >> dir/file
-echo dir/file2 >> dir/file2
-echo dir/subdir/file3 >> dir/subdir/file3
-echo dir/subdir/file4 >> dir/subdir/file4
-hg ci -d '0 0' -qAm '0: add foo baz dir/'
-
-echo bar > bar
-echo quux > quux
-hg copy foo copied
-hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
-
-echo >> foo
-hg ci -d '2 0' -m '2: change foo'
-
-hg up -qC 1
-echo >> bar
-echo >> quux
-hg ci -d '3 0' -m '3: change bar quux'
-
-hg up -qC 2
-hg merge -qr 3
-echo >> bar
-echo >> baz
-hg ci -d '4 0' -m '4: first merge; change bar baz'
-
-echo >> bar
-echo 1 >> baz
-echo >> quux
-hg ci -d '5 0' -m '5: change bar baz quux'
-
-hg up -qC 4
-echo >> foo
-echo 2 >> baz
-hg ci -d '6 0' -m '6: change foo baz'
-
-hg up -qC 5
-hg merge -qr 6
-echo >> bar
-hg ci -d '7 0' -m '7: second merge; change bar'
-
-echo >> foo
-hg ci -m '8: change foo'
-
-glog
-
-echo '% final file versions in this repo:'
-hg manifest --debug
-hg debugrename copied
-echo
-
-cd ..
-
-splitrepo()
-{
-    msg="$1"
-    files="$2"
-    opts=$3
-    echo "% $files: $msg"
-    prefix=`echo "$files" | sed -e 's/ /-/g'`
-    fmap="$prefix.fmap"
-    repo="$prefix.repo"
-    for i in $files; do
-	echo "include $i" >> "$fmap"
-    done
-    hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
-    hg up -q -R "$repo"
-    glog -R "$repo"
-    hg -R "$repo" manifest --debug
-}
-
-splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
-
-splitrepo 'merges are not merges anymore' bar
-
-splitrepo '1st merge is not a merge anymore; 2nd still is' baz
-
-splitrepo 'we add additional merges when they are interesting' 'foo quux'
-
-splitrepo 'partial conversion' 'bar quux' '-r 3'
-splitrepo 'complete the partial conversion' 'bar quux'
-
-rm -r foo.repo
-splitrepo 'partial conversion' 'foo' '-r 3'
-splitrepo 'complete the partial conversion' 'foo'
-
-splitrepo 'copied file; source not included in new repo' copied
-hg --cwd copied.repo debugrename copied
-
-splitrepo 'copied file; source included in new repo' 'foo copied'
-hg --cwd foo-copied.repo debugrename copied
-
-cat > renames.fmap <<EOF
-include dir
-exclude dir/file2
-rename dir dir2
-include foo
-include copied
-rename foo foo2
-rename copied copied2
-exclude dir/subdir
-include dir/subdir/file3
-EOF
-hg -q convert --filemap renames.fmap --datesort source renames.repo
-hg up -q -R renames.repo
-glog -R renames.repo
-hg -R renames.repo manifest --debug
-hg --cwd renames.repo debugrename copied2
-echo 'copied:'
-hg --cwd source cat copied
-echo 'copied2:'
-hg --cwd renames.repo cat copied2
-
-echo % filemap errors
-cat > errors.fmap <<EOF
-include dir/ # beware that comments changes error line numbers!
-exclude /dir
-rename dir//dir /dir//dir/ "out of sync"
-include
-EOF
-hg -q convert --filemap errors.fmap source errors.repo
-
-true # happy ending
--- a/tests/test-convert-filemap.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-created new head
-created new head
-@  8 "8: change foo" files: foo
-|
-o    7 "7: second merge; change bar" files: bar baz
-|\
-| o  6 "6: change foo baz" files: baz foo
-| |
-o |  5 "5: change bar baz quux" files: bar baz quux
-|/
-o    4 "4: first merge; change bar baz" files: bar baz
-|\
-| o  3 "3: change bar quux" files: bar quux
-| |
-o |  2 "2: change foo" files: foo
-|/
-o  1 "1: add bar quux; copy foo to copied" files: bar copied quux
-|
-o  0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/subdir/file3 dir/subdir/file4 foo
-
-% final file versions in this repo:
-9463f52fe115e377cf2878d4fc548117211063f2 644   bar
-94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644   baz
-7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644   copied
-3e20847584beff41d7cd16136b7331ab3d754be0 644   dir/file
-75e6d3f8328f5f6ace6bf10b98df793416a09dca 644   dir/file2
-5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir/subdir/file3
-57a1c1511590f3de52874adfa04effe8a77d64af 644   dir/subdir/file4
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
-copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
-
-% foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
-@  3 "8: change foo" files: foo
-|
-o  2 "6: change foo baz" files: foo
-|
-o  1 "2: change foo" files: foo
-|
-o  0 "0: add foo baz dir/" files: foo
-
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
-% bar: merges are not merges anymore
-@  4 "7: second merge; change bar" files: bar
-|
-o  3 "5: change bar baz quux" files: bar
-|
-o  2 "4: first merge; change bar baz" files: bar
-|
-o  1 "3: change bar quux" files: bar
-|
-o  0 "1: add bar quux; copy foo to copied" files: bar
-
-9463f52fe115e377cf2878d4fc548117211063f2 644   bar
-% baz: 1st merge is not a merge anymore; 2nd still is
-@    4 "7: second merge; change bar" files: baz
-|\
-| o  3 "6: change foo baz" files: baz
-| |
-o |  2 "5: change bar baz quux" files: baz
-|/
-o  1 "4: first merge; change bar baz" files: baz
-|
-o  0 "0: add foo baz dir/" files: baz
-
-94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644   baz
-% foo quux: we add additional merges when they are interesting
-@  8 "8: change foo" files: foo
-|
-o    7 "7: second merge; change bar" files:
-|\
-| o  6 "6: change foo baz" files: foo
-| |
-o |  5 "5: change bar baz quux" files: quux
-|/
-o    4 "4: first merge; change bar baz" files:
-|\
-| o  3 "3: change bar quux" files: quux
-| |
-o |  2 "2: change foo" files: foo
-|/
-o  1 "1: add bar quux; copy foo to copied" files: quux
-|
-o  0 "0: add foo baz dir/" files: foo
-
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
-% bar quux: partial conversion
-@  1 "3: change bar quux" files: bar quux
-|
-o  0 "1: add bar quux; copy foo to copied" files: bar quux
-
-b79105bedc55102f394e90a789c9c380117c1b4a 644   bar
-db0421cc6b685a458c8d86c7d5c004f94429ea23 644   quux
-% bar quux: complete the partial conversion
-@  4 "7: second merge; change bar" files: bar
-|
-o  3 "5: change bar baz quux" files: bar quux
-|
-o  2 "4: first merge; change bar baz" files: bar
-|
-o  1 "3: change bar quux" files: bar quux
-|
-o  0 "1: add bar quux; copy foo to copied" files: bar quux
-
-9463f52fe115e377cf2878d4fc548117211063f2 644   bar
-bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
-% foo: partial conversion
-@  0 "0: add foo baz dir/" files: foo
-
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-% foo: complete the partial conversion
-@  3 "8: change foo" files: foo
-|
-o  2 "6: change foo baz" files: foo
-|
-o  1 "2: change foo" files: foo
-|
-o  0 "0: add foo baz dir/" files: foo
-
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
-% copied: copied file; source not included in new repo
-@  0 "1: add bar quux; copy foo to copied" files: copied
-
-2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   copied
-copied not renamed
-% foo copied: copied file; source included in new repo
-@  4 "8: change foo" files: foo
-|
-o  3 "6: change foo baz" files: foo
-|
-o  2 "2: change foo" files: foo
-|
-o  1 "1: add bar quux; copy foo to copied" files: copied
-|
-o  0 "0: add foo baz dir/" files: foo
-
-7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644   copied
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
-copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
-@  4 "8: change foo" files: foo2
-|
-o  3 "6: change foo baz" files: foo2
-|
-o  2 "2: change foo" files: foo2
-|
-o  1 "1: add bar quux; copy foo to copied" files: copied2
-|
-o  0 "0: add foo baz dir/" files: dir2/file dir2/subdir/file3 foo2
-
-d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644   copied2
-3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/file
-5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/subdir/file3
-9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
-copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
-copied:
-foo
-copied2:
-foo
-% filemap errors
-errors.fmap:1: superfluous / in exclude 'dir/'
-errors.fmap:3: superfluous / in include '/dir'
-errors.fmap:3: superfluous / in rename '/dir'
-errors.fmap:3: superfluous / in exclude 'dir//dir'
-errors.fmap:4: unknown directive 'out of sync'
-errors.fmap:5: path to exclude is missing
-abort: errors in filemap
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-filemap.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,284 @@
+
+  $ HGMERGE=true; export HGMERGE
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'graphlog =' >> $HGRCPATH
+  $ echo 'convert =' >> $HGRCPATH
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc}" files: {files}\n' "$@"
+  > }
+  $ hg init source
+  $ cd source
+  $ echo foo > foo
+  $ echo baz > baz
+  $ mkdir -p dir/subdir
+  $ echo dir/file >> dir/file
+  $ echo dir/file2 >> dir/file2
+  $ echo dir/subdir/file3 >> dir/subdir/file3
+  $ echo dir/subdir/file4 >> dir/subdir/file4
+  $ hg ci -d '0 0' -qAm '0: add foo baz dir/'
+  $ echo bar > bar
+  $ echo quux > quux
+  $ hg copy foo copied
+  $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
+  $ echo >> foo
+  $ hg ci -d '2 0' -m '2: change foo'
+  $ hg up -qC 1
+  $ echo >> bar
+  $ echo >> quux
+  $ hg ci -d '3 0' -m '3: change bar quux'
+  created new head
+  $ hg up -qC 2
+  $ hg merge -qr 3
+  $ echo >> bar
+  $ echo >> baz
+  $ hg ci -d '4 0' -m '4: first merge; change bar baz'
+  $ echo >> bar
+  $ echo 1 >> baz
+  $ echo >> quux
+  $ hg ci -d '5 0' -m '5: change bar baz quux'
+  $ hg up -qC 4
+  $ echo >> foo
+  $ echo 2 >> baz
+  $ hg ci -d '6 0' -m '6: change foo baz'
+  created new head
+  $ hg up -qC 5
+  $ hg merge -qr 6
+  $ echo >> bar
+  $ hg ci -d '7 0' -m '7: second merge; change bar'
+  $ echo >> foo
+  $ hg ci -m '8: change foo'
+  $ glog
+  @  8 "8: change foo" files: foo
+  |
+  o    7 "7: second merge; change bar" files: bar baz
+  |\
+  | o  6 "6: change foo baz" files: baz foo
+  | |
+  o |  5 "5: change bar baz quux" files: bar baz quux
+  |/
+  o    4 "4: first merge; change bar baz" files: bar baz
+  |\
+  | o  3 "3: change bar quux" files: bar quux
+  | |
+  o |  2 "2: change foo" files: foo
+  |/
+  o  1 "1: add bar quux; copy foo to copied" files: bar copied quux
+  |
+  o  0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/subdir/file3 dir/subdir/file4 foo
+  
+
+final file versions in this repo:
+
+  $ hg manifest --debug
+  9463f52fe115e377cf2878d4fc548117211063f2 644   bar
+  94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644   baz
+  7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644   copied
+  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir/file
+  75e6d3f8328f5f6ace6bf10b98df793416a09dca 644   dir/file2
+  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir/subdir/file3
+  57a1c1511590f3de52874adfa04effe8a77d64af 644   dir/subdir/file4
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
+  bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
+  $ hg debugrename copied
+  copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
+  $ echo
+  
+  $ cd ..
+  $ splitrepo()
+  > {
+  >     msg="$1"
+  >     files="$2"
+  >     opts=$3
+  >     echo "% $files: $msg"
+  >     prefix=`echo "$files" | sed -e 's/ /-/g'`
+  >     fmap="$prefix.fmap"
+  >     repo="$prefix.repo"
+  >     for i in $files; do
+  > 	echo "include $i" >> "$fmap"
+  >     done
+  >     hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
+  >     hg up -q -R "$repo"
+  >     glog -R "$repo"
+  >     hg -R "$repo" manifest --debug
+  > }
+  $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
+  % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
+  @  3 "8: change foo" files: foo
+  |
+  o  2 "6: change foo baz" files: foo
+  |
+  o  1 "2: change foo" files: foo
+  |
+  o  0 "0: add foo baz dir/" files: foo
+  
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
+  $ splitrepo 'merges are not merges anymore' bar
+  % bar: merges are not merges anymore
+  @  4 "7: second merge; change bar" files: bar
+  |
+  o  3 "5: change bar baz quux" files: bar
+  |
+  o  2 "4: first merge; change bar baz" files: bar
+  |
+  o  1 "3: change bar quux" files: bar
+  |
+  o  0 "1: add bar quux; copy foo to copied" files: bar
+  
+  9463f52fe115e377cf2878d4fc548117211063f2 644   bar
+  $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz
+  % baz: 1st merge is not a merge anymore; 2nd still is
+  @    4 "7: second merge; change bar" files: baz
+  |\
+  | o  3 "6: change foo baz" files: baz
+  | |
+  o |  2 "5: change bar baz quux" files: baz
+  |/
+  o  1 "4: first merge; change bar baz" files: baz
+  |
+  o  0 "0: add foo baz dir/" files: baz
+  
+  94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644   baz
+  $ splitrepo 'we add additional merges when they are interesting' 'foo quux'
+  % foo quux: we add additional merges when they are interesting
+  @  8 "8: change foo" files: foo
+  |
+  o    7 "7: second merge; change bar" files:
+  |\
+  | o  6 "6: change foo baz" files: foo
+  | |
+  o |  5 "5: change bar baz quux" files: quux
+  |/
+  o    4 "4: first merge; change bar baz" files:
+  |\
+  | o  3 "3: change bar quux" files: quux
+  | |
+  o |  2 "2: change foo" files: foo
+  |/
+  o  1 "1: add bar quux; copy foo to copied" files: quux
+  |
+  o  0 "0: add foo baz dir/" files: foo
+  
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
+  bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
+  $ splitrepo 'partial conversion' 'bar quux' '-r 3'
+  % bar quux: partial conversion
+  @  1 "3: change bar quux" files: bar quux
+  |
+  o  0 "1: add bar quux; copy foo to copied" files: bar quux
+  
+  b79105bedc55102f394e90a789c9c380117c1b4a 644   bar
+  db0421cc6b685a458c8d86c7d5c004f94429ea23 644   quux
+  $ splitrepo 'complete the partial conversion' 'bar quux'
+  % bar quux: complete the partial conversion
+  @  4 "7: second merge; change bar" files: bar
+  |
+  o  3 "5: change bar baz quux" files: bar quux
+  |
+  o  2 "4: first merge; change bar baz" files: bar
+  |
+  o  1 "3: change bar quux" files: bar quux
+  |
+  o  0 "1: add bar quux; copy foo to copied" files: bar quux
+  
+  9463f52fe115e377cf2878d4fc548117211063f2 644   bar
+  bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644   quux
+  $ rm -r foo.repo
+  $ splitrepo 'partial conversion' 'foo' '-r 3'
+  % foo: partial conversion
+  @  0 "0: add foo baz dir/" files: foo
+  
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
+  $ splitrepo 'complete the partial conversion' 'foo'
+  % foo: complete the partial conversion
+  @  3 "8: change foo" files: foo
+  |
+  o  2 "6: change foo baz" files: foo
+  |
+  o  1 "2: change foo" files: foo
+  |
+  o  0 "0: add foo baz dir/" files: foo
+  
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
+  $ splitrepo 'copied file; source not included in new repo' copied
+  % copied: copied file; source not included in new repo
+  @  0 "1: add bar quux; copy foo to copied" files: copied
+  
+  2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   copied
+  $ hg --cwd copied.repo debugrename copied
+  copied not renamed
+  $ splitrepo 'copied file; source included in new repo' 'foo copied'
+  % foo copied: copied file; source included in new repo
+  @  4 "8: change foo" files: foo
+  |
+  o  3 "6: change foo baz" files: foo
+  |
+  o  2 "2: change foo" files: foo
+  |
+  o  1 "1: add bar quux; copy foo to copied" files: copied
+  |
+  o  0 "0: add foo baz dir/" files: foo
+  
+  7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644   copied
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo
+  $ hg --cwd foo-copied.repo debugrename copied
+  copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
+  $ cat > renames.fmap <<EOF
+  > include dir
+  > exclude dir/file2
+  > rename dir dir2
+  > include foo
+  > include copied
+  > rename foo foo2
+  > rename copied copied2
+  > exclude dir/subdir
+  > include dir/subdir/file3
+  > EOF
+  $ hg -q convert --filemap renames.fmap --datesort source renames.repo
+  $ hg up -q -R renames.repo
+  $ glog -R renames.repo
+  @  4 "8: change foo" files: foo2
+  |
+  o  3 "6: change foo baz" files: foo2
+  |
+  o  2 "2: change foo" files: foo2
+  |
+  o  1 "1: add bar quux; copy foo to copied" files: copied2
+  |
+  o  0 "0: add foo baz dir/" files: dir2/file dir2/subdir/file3 foo2
+  
+  $ hg -R renames.repo manifest --debug
+  d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644   copied2
+  3e20847584beff41d7cd16136b7331ab3d754be0 644   dir2/file
+  5fe139720576e18e34bcc9f79174db8897c8afe9 644   dir2/subdir/file3
+  9a7b52012991e4873687192c3e17e61ba3e837a3 644   foo2
+  $ hg --cwd renames.repo debugrename copied2
+  copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
+
+copied:
+
+  $ hg --cwd source cat copied
+  foo
+
+copied2:
+
+  $ hg --cwd renames.repo cat copied2
+  foo
+
+filemap errors
+
+  $ cat > errors.fmap <<EOF
+  > include dir/ # beware that comments changes error line numbers!
+  > exclude /dir
+  > rename dir//dir /dir//dir/ "out of sync"
+  > include
+  > EOF
+  $ hg -q convert --filemap errors.fmap source errors.repo
+  errors.fmap:1: superfluous / in exclude 'dir/'
+  errors.fmap:3: superfluous / in include '/dir'
+  errors.fmap:3: superfluous / in rename '/dir'
+  errors.fmap:3: superfluous / in exclude 'dir//dir'
+  errors.fmap:4: unknown directive 'out of sync'
+  errors.fmap:5: path to exclude is missing
+  abort: errors in filemap
+  [255]
--- a/tests/test-convert-git	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" git || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'hgext.graphlog =' >> $HGRCPATH
-
-GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
-GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
-GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
-GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
-GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
-GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
-
-count=10
-commit()
-{
-    GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
-    GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
-    git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
-    count=`expr $count + 1`
-}
-
-mkdir git-repo
-cd git-repo
-git init-db >/dev/null 2>/dev/null
-echo a > a
-mkdir d
-echo b > d/b
-git add a d
-commit -a -m t1
-
-# Remove the directory, then try to replace it with a file
-# (issue 754)
-git rm -f d/b
-commit -m t2
-echo d > d
-git add d
-commit -m t3
-
-echo b >> a
-commit -a -m t4.1
-
-git checkout -b other HEAD~ >/dev/null 2>/dev/null
-echo c > a
-echo a >> a
-commit -a -m t4.2
-
-git checkout master >/dev/null 2>/dev/null
-git pull --no-commit . other > /dev/null 2>/dev/null
-commit -m 'Merge branch other'
-cd ..
-
-hg convert --datesort git-repo
-hg up -q -R git-repo-hg
-hg -R git-repo-hg tip -v
-
-count=10
-mkdir git-repo2
-cd git-repo2
-git init-db >/dev/null 2>/dev/null
-
-echo foo > foo
-git add foo
-commit -a -m 'add foo'
-
-echo >> foo
-commit -a -m 'change foo'
-
-git checkout -b Bar HEAD~ >/dev/null 2>/dev/null
-echo quux >> quux
-git add quux
-commit -a -m 'add quux'
-
-echo bar > bar
-git add bar
-commit -a -m 'add bar'
-
-git checkout -b Baz HEAD~ >/dev/null 2>/dev/null
-echo baz > baz
-git add baz
-commit -a -m 'add baz'
-
-git checkout master >/dev/null 2>/dev/null
-git pull --no-commit . Bar Baz > /dev/null 2>/dev/null
-commit -m 'Octopus merge'
-
-echo bar >> bar
-commit -a -m 'change bar'
-
-git checkout -b Foo HEAD~ >/dev/null 2>/dev/null
-echo >> foo
-commit -a -m 'change foo'
-
-git checkout master >/dev/null 2>/dev/null
-git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null
-commit -m 'Discard change to foo'
-
-cd ..
-
-glog()
-{
-    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
-}
-
-splitrepo()
-{
-    msg="$1"
-    files="$2"
-    opts=$3
-    echo "% $files: $msg"
-    prefix=`echo "$files" | sed -e 's/ /-/g'`
-    fmap="$prefix.fmap"
-    repo="$prefix.repo"
-    for i in $files; do
-	echo "include $i" >> "$fmap"
-    done
-    hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo"
-    hg up -q -R "$repo"
-    glog -R "$repo"
-    hg -R "$repo" manifest --debug
-}
-
-echo '% full conversion'
-hg -q convert --datesort git-repo2 fullrepo
-hg up -q -R fullrepo
-glog -R fullrepo
-hg -R fullrepo manifest --debug
-
-splitrepo 'octopus merge' 'foo bar baz'
-
-splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux'
-
-echo
-echo '% test binary conversion (issue 1359)'
-mkdir git-repo3
-cd git-repo3
-git init-db >/dev/null 2>/dev/null
-python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
-git add b
-commit -a -m addbinary
-cd ..
-
-echo '% convert binary file'
-hg convert git-repo3 git-repo3-hg
-
-cd git-repo3-hg
-hg up -C
-python -c 'print len(file("b", "rb").read())'
-cd ..
-
-echo
-echo '% test author vs committer'
-mkdir git-repo4
-cd git-repo4
-git init-db >/dev/null 2>/dev/null
-echo >> foo
-git add foo
-commit -a -m addfoo
-echo >> foo
-GIT_AUTHOR_NAME="nottest"
-commit -a -m addfoo2
-cd ..
-
-echo '% convert author committer'
-hg convert git-repo4 git-repo4-hg
-hg -R git-repo4-hg log -v
-
-echo '% --sourceorder should fail'
-hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
-
-echo '% damage git repository and convert again'
-cat > damage.py <<EOF
-import os
-for root, dirs, files in os.walk('git-repo4/.git/objects'):
-    if files:
-        path = os.path.join(root, files[0])
-        os.remove(path)
-        break
-EOF
-python damage.py
-hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
-    grep 'abort:' | sed 's/abort:.*/abort:/g'
-
-true
--- a/tests/test-convert-git.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-rm 'd/b'
-assuming destination git-repo-hg
-initializing destination git-repo-hg repository
-scanning source...
-sorting...
-converting...
-5 t1
-4 t2
-3 t3
-2 t4.1
-1 t4.2
-0 Merge branch other
-changeset:   5:c78094926be2
-tag:         tip
-parent:      3:f5f5cb45432b
-parent:      4:4e174f80c67c
-user:        test <test@example.org>
-date:        Mon Jan 01 00:00:15 2007 +0000
-files:       a
-description:
-Merge branch other
-
-
-% full conversion
-@    9 "Discard change to foo" files: foo
-|\
-| o  8 "change foo" files: foo
-| |
-o |  7 "change bar" files: bar
-|/
-o    6 "(octopus merge fixup)" files:
-|\
-| o    5 "Octopus merge" files: baz
-| |\
-o | |  4 "add baz" files: baz
-| | |
-+---o  3 "add bar" files: bar
-| |
-o |  2 "add quux" files: quux
-| |
-| o  1 "change foo" files: foo
-|/
-o  0 "add foo" files: foo
-
-245a3b8bc653999c2b22cdabd517ccb47aecafdf 644   bar
-354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
-9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
-88dfeab657e8cf2cef3dec67b914f49791ae76b1 644   quux
-% foo bar baz: octopus merge
-@    8 "Discard change to foo" files: foo
-|\
-| o  7 "change foo" files: foo
-| |
-o |  6 "change bar" files: bar
-|/
-o    5 "(octopus merge fixup)" files:
-|\
-| o    4 "Octopus merge" files: baz
-| |\
-o | |  3 "add baz" files: baz
-| | |
-+---o  2 "add bar" files: bar
-| |
-| o  1 "change foo" files: foo
-|/
-o  0 "add foo" files: foo
-
-245a3b8bc653999c2b22cdabd517ccb47aecafdf 644   bar
-354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
-9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
-% foo baz quux: only some parents of an octopus merge; "discard" a head
-@  6 "Discard change to foo" files: foo
-|
-o  5 "change foo" files: foo
-|
-o    4 "Octopus merge" files:
-|\
-| o  3 "add baz" files: baz
-| |
-| o  2 "add quux" files: quux
-| |
-o |  1 "change foo" files: foo
-|/
-o  0 "add foo" files: foo
-
-354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
-9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
-88dfeab657e8cf2cef3dec67b914f49791ae76b1 644   quux
-
-% test binary conversion (issue 1359)
-% convert binary file
-initializing destination git-repo3-hg repository
-scanning source...
-sorting...
-converting...
-0 addbinary
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-4096
-
-% test author vs committer
-% convert author committer
-initializing destination git-repo4-hg repository
-scanning source...
-sorting...
-converting...
-1 addfoo
-0 addfoo2
-changeset:   1:d63e967f93da
-tag:         tip
-user:        nottest <test@example.org>
-date:        Mon Jan 01 00:00:21 2007 +0000
-files:       foo
-description:
-addfoo2
-
-committer: test <test@example.org>
-
-
-changeset:   0:0735477b0224
-user:        test <test@example.org>
-date:        Mon Jan 01 00:00:20 2007 +0000
-files:       foo
-description:
-addfoo
-
-
-% --sourceorder should fail
-initializing destination git-repo4-sourcesort-hg repository
-abort: --sourcesort is not supported by this data source
-% damage git repository and convert again
-abort:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-git.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,292 @@
+
+  $ "$TESTDIR/hghave" git || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'hgext.graphlog =' >> $HGRCPATH
+  $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+  $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+  $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+  $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
+  $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
+  $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
+  $ count=10
+  $ commit()
+  > {
+  >     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
+  >     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+  >     git commit "$@" >/dev/null 2>/dev/null || echo "git commit error"
+  >     count=`expr $count + 1`
+  > }
+  $ mkdir git-repo
+  $ cd git-repo
+  $ git init-db >/dev/null 2>/dev/null
+  $ echo a > a
+  $ mkdir d
+  $ echo b > d/b
+  $ git add a d
+  $ commit -a -m t1
+
+Remove the directory, then try to replace it with a file
+(issue 754)
+
+  $ git rm -f d/b
+  rm 'd/b'
+  $ commit -m t2
+  $ echo d > d
+  $ git add d
+  $ commit -m t3
+  $ echo b >> a
+  $ commit -a -m t4.1
+  $ git checkout -b other HEAD~ >/dev/null 2>/dev/null
+  $ echo c > a
+  $ echo a >> a
+  $ commit -a -m t4.2
+  $ git checkout master >/dev/null 2>/dev/null
+  $ git pull --no-commit . other > /dev/null 2>/dev/null
+  $ commit -m 'Merge branch other'
+  $ cd ..
+  $ hg convert --datesort git-repo
+  assuming destination git-repo-hg
+  initializing destination git-repo-hg repository
+  scanning source...
+  sorting...
+  converting...
+  5 t1
+  4 t2
+  3 t3
+  2 t4.1
+  1 t4.2
+  0 Merge branch other
+  $ hg up -q -R git-repo-hg
+  $ hg -R git-repo-hg tip -v
+  changeset:   5:c78094926be2
+  tag:         tip
+  parent:      3:f5f5cb45432b
+  parent:      4:4e174f80c67c
+  user:        test <test@example.org>
+  date:        Mon Jan 01 00:00:15 2007 +0000
+  files:       a
+  description:
+  Merge branch other
+  
+  
+  $ count=10
+  $ mkdir git-repo2
+  $ cd git-repo2
+  $ git init-db >/dev/null 2>/dev/null
+  $ echo foo > foo
+  $ git add foo
+  $ commit -a -m 'add foo'
+  $ echo >> foo
+  $ commit -a -m 'change foo'
+  $ git checkout -b Bar HEAD~ >/dev/null 2>/dev/null
+  $ echo quux >> quux
+  $ git add quux
+  $ commit -a -m 'add quux'
+  $ echo bar > bar
+  $ git add bar
+  $ commit -a -m 'add bar'
+  $ git checkout -b Baz HEAD~ >/dev/null 2>/dev/null
+  $ echo baz > baz
+  $ git add baz
+  $ commit -a -m 'add baz'
+  $ git checkout master >/dev/null 2>/dev/null
+  $ git pull --no-commit . Bar Baz > /dev/null 2>/dev/null
+  $ commit -m 'Octopus merge'
+  $ echo bar >> bar
+  $ commit -a -m 'change bar'
+  $ git checkout -b Foo HEAD~ >/dev/null 2>/dev/null
+  $ echo >> foo
+  $ commit -a -m 'change foo'
+  $ git checkout master >/dev/null 2>/dev/null
+  $ git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null
+  $ commit -m 'Discard change to foo'
+  $ cd ..
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
+  > }
+  $ splitrepo()
+  > {
+  >     msg="$1"
+  >     files="$2"
+  >     opts=$3
+  >     echo "% $files: $msg"
+  >     prefix=`echo "$files" | sed -e 's/ /-/g'`
+  >     fmap="$prefix.fmap"
+  >     repo="$prefix.repo"
+  >     for i in $files; do
+  > 	echo "include $i" >> "$fmap"
+  >     done
+  >     hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo"
+  >     hg up -q -R "$repo"
+  >     glog -R "$repo"
+  >     hg -R "$repo" manifest --debug
+  > }
+
+full conversion
+
+  $ hg -q convert --datesort git-repo2 fullrepo
+  $ hg up -q -R fullrepo
+  $ glog -R fullrepo
+  @    9 "Discard change to foo" files: foo
+  |\
+  | o  8 "change foo" files: foo
+  | |
+  o |  7 "change bar" files: bar
+  |/
+  o    6 "(octopus merge fixup)" files:
+  |\
+  | o    5 "Octopus merge" files: baz
+  | |\
+  o | |  4 "add baz" files: baz
+  | | |
+  +---o  3 "add bar" files: bar
+  | |
+  o |  2 "add quux" files: quux
+  | |
+  | o  1 "change foo" files: foo
+  |/
+  o  0 "add foo" files: foo
+  
+  $ hg -R fullrepo manifest --debug
+  245a3b8bc653999c2b22cdabd517ccb47aecafdf 644   bar
+  354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
+  9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
+  88dfeab657e8cf2cef3dec67b914f49791ae76b1 644   quux
+  $ splitrepo 'octopus merge' 'foo bar baz'
+  % foo bar baz: octopus merge
+  @    8 "Discard change to foo" files: foo
+  |\
+  | o  7 "change foo" files: foo
+  | |
+  o |  6 "change bar" files: bar
+  |/
+  o    5 "(octopus merge fixup)" files:
+  |\
+  | o    4 "Octopus merge" files: baz
+  | |\
+  o | |  3 "add baz" files: baz
+  | | |
+  +---o  2 "add bar" files: bar
+  | |
+  | o  1 "change foo" files: foo
+  |/
+  o  0 "add foo" files: foo
+  
+  245a3b8bc653999c2b22cdabd517ccb47aecafdf 644   bar
+  354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
+  9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
+  $ splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux'
+  % foo baz quux: only some parents of an octopus merge; "discard" a head
+  @  6 "Discard change to foo" files: foo
+  |
+  o  5 "change foo" files: foo
+  |
+  o    4 "Octopus merge" files:
+  |\
+  | o  3 "add baz" files: baz
+  | |
+  | o  2 "add quux" files: quux
+  | |
+  o |  1 "change foo" files: foo
+  |/
+  o  0 "add foo" files: foo
+  
+  354ae8da6e890359ef49ade27b68bbc361f3ca88 644   baz
+  9277c9cc8dd4576fc01a17939b4351e5ada93466 644   foo
+  88dfeab657e8cf2cef3dec67b914f49791ae76b1 644   quux
+  $ echo
+  
+
+test binary conversion (issue 1359)
+
+  $ mkdir git-repo3
+  $ cd git-repo3
+  $ git init-db >/dev/null 2>/dev/null
+  $ python -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
+  $ git add b
+  $ commit -a -m addbinary
+  $ cd ..
+
+convert binary file
+
+  $ hg convert git-repo3 git-repo3-hg
+  initializing destination git-repo3-hg repository
+  scanning source...
+  sorting...
+  converting...
+  0 addbinary
+  $ cd git-repo3-hg
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ python -c 'print len(file("b", "rb").read())'
+  4096
+  $ cd ..
+  $ echo
+  
+
+test author vs committer
+
+  $ mkdir git-repo4
+  $ cd git-repo4
+  $ git init-db >/dev/null 2>/dev/null
+  $ echo >> foo
+  $ git add foo
+  $ commit -a -m addfoo
+  $ echo >> foo
+  $ GIT_AUTHOR_NAME="nottest"
+  $ commit -a -m addfoo2
+  $ cd ..
+
+convert author committer
+
+  $ hg convert git-repo4 git-repo4-hg
+  initializing destination git-repo4-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 addfoo
+  0 addfoo2
+  $ hg -R git-repo4-hg log -v
+  changeset:   1:d63e967f93da
+  tag:         tip
+  user:        nottest <test@example.org>
+  date:        Mon Jan 01 00:00:21 2007 +0000
+  files:       foo
+  description:
+  addfoo2
+  
+  committer: test <test@example.org>
+  
+  
+  changeset:   0:0735477b0224
+  user:        test <test@example.org>
+  date:        Mon Jan 01 00:00:20 2007 +0000
+  files:       foo
+  description:
+  addfoo
+  
+  
+
+--sourceorder should fail
+
+  $ hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
+  initializing destination git-repo4-sourcesort-hg repository
+  abort: --sourcesort is not supported by this data source
+  [255]
+
+damage git repository and convert again
+
+  $ cat > damage.py <<EOF
+  > import os
+  > for root, dirs, files in os.walk('git-repo4/.git/objects'):
+  >     if files:
+  >         path = os.path.join(root, files[0])
+  >         os.remove(path)
+  >         break
+  > EOF
+  $ python damage.py
+  $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
+  >     grep 'abort:' | sed 's/abort:.*/abort:/g'
+  abort:
--- a/tests/test-convert-hg-sink	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-convert=
-[convert]
-hg.saverev=False
-EOF
-
-hg init orig
-cd orig
-echo foo > foo
-echo bar > bar
-hg ci -qAm 'add foo and bar'
-
-hg rm foo
-hg ci -m 'remove foo'
-
-mkdir foo
-echo file > foo/file
-hg ci -qAm 'add foo/file'
-
-hg tag some-tag
-
-hg log
-cd ..
-
-hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
-cd new
-hg out ../orig
-
-echo '% dirstate should be empty:'
-hg debugstate
-hg parents -q
-
-hg up -C
-hg copy bar baz
-echo '% put something in the dirstate:'
-hg debugstate > debugstate
-grep baz debugstate
-
-echo '% add a new revision in the original repo'
-cd ../orig
-echo baz > baz
-hg ci -qAm 'add baz'
-
-cd ..
-hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
-cd new
-hg out ../orig
-echo '% dirstate should be the same (no output below):'
-hg debugstate > new-debugstate
-diff debugstate new-debugstate
-
-echo '% no copies'
-hg up -C
-hg debugrename baz
-cd ..
-
-echo '% test tag rewriting'
-cat > filemap <<EOF
-exclude foo
-EOF
-hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
-cd new-filemap
-hg tags
-cd ..
--- a/tests/test-convert-hg-sink.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-changeset:   3:593cbf6fb2b4
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag some-tag for changeset ad681a868e44
-
-changeset:   2:ad681a868e44
-tag:         some-tag
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo/file
-
-changeset:   1:cbba8ecc03b7
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     remove foo
-
-changeset:   0:327daa9251fa
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo and bar
-
-initializing destination new repository
-scanning source...
-sorting...
-converting...
-3 add foo and bar
-2 remove foo
-1 add foo/file
-0 Added tag some-tag for changeset ad681a868e44
-comparing with ../orig
-searching for changes
-no changes found
-% dirstate should be empty:
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% put something in the dirstate:
-a   0         -1 unset               baz
-copy: bar -> baz
-% add a new revision in the original repo
-scanning source...
-sorting...
-converting...
-0 add baz
-comparing with ../orig
-searching for changes
-no changes found
-% dirstate should be the same (no output below):
-% no copies
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-baz not renamed
-% test tag rewriting
-initializing destination new-filemap repository
-scanning source...
-sorting...
-converting...
-4 add foo and bar
-3 remove foo
-2 add foo/file
-1 Added tag some-tag for changeset ad681a868e44
-0 add baz
-tip                                2:6f4fd1df87fb
-some-tag                           0:ba8636729451
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-hg-sink.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,124 @@
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > convert=
+  > [convert]
+  > hg.saverev=False
+  > EOF
+  $ hg init orig
+  $ cd orig
+  $ echo foo > foo
+  $ echo bar > bar
+  $ hg ci -qAm 'add foo and bar'
+  $ hg rm foo
+  $ hg ci -m 'remove foo'
+  $ mkdir foo
+  $ echo file > foo/file
+  $ hg ci -qAm 'add foo/file'
+  $ hg tag some-tag
+  $ hg log
+  changeset:   3:593cbf6fb2b4
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag some-tag for changeset ad681a868e44
+  
+  changeset:   2:ad681a868e44
+  tag:         some-tag
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo/file
+  
+  changeset:   1:cbba8ecc03b7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     remove foo
+  
+  changeset:   0:327daa9251fa
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo and bar
+  
+  $ cd ..
+  $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  initializing destination new repository
+  scanning source...
+  sorting...
+  converting...
+  3 add foo and bar
+  2 remove foo
+  1 add foo/file
+  0 Added tag some-tag for changeset ad681a868e44
+  $ cd new
+  $ hg out ../orig
+  comparing with ../orig
+  searching for changes
+  no changes found
+  [1]
+
+dirstate should be empty:
+
+  $ hg debugstate
+  $ hg parents -q
+  $ hg up -C
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg copy bar baz
+
+put something in the dirstate:
+
+  $ hg debugstate > debugstate
+  $ grep baz debugstate
+  a   0         -1 unset               baz
+  copy: bar -> baz
+
+add a new revision in the original repo
+
+  $ cd ../orig
+  $ echo baz > baz
+  $ hg ci -qAm 'add baz'
+  $ cd ..
+  $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  scanning source...
+  sorting...
+  converting...
+  0 add baz
+  $ cd new
+  $ hg out ../orig
+  comparing with ../orig
+  searching for changes
+  no changes found
+  [1]
+
+dirstate should be the same (no output below):
+
+  $ hg debugstate > new-debugstate
+  $ diff debugstate new-debugstate
+
+no copies
+
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugrename baz
+  baz not renamed
+  $ cd ..
+
+test tag rewriting
+
+  $ cat > filemap <<EOF
+  > exclude foo
+  > EOF
+  $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  initializing destination new-filemap repository
+  scanning source...
+  sorting...
+  converting...
+  4 add foo and bar
+  3 remove foo
+  2 add foo/file
+  1 Added tag some-tag for changeset ad681a868e44
+  0 add baz
+  $ cd new-filemap
+  $ hg tags
+  tip                                2:6f4fd1df87fb
+  some-tag                           0:ba8636729451
+  $ cd ..
--- a/tests/test-convert-hg-source	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-convert=
-[convert]
-hg.saverev=False
-EOF
-
-hg init orig
-cd orig
-
-echo foo > foo
-echo bar > bar
-hg ci -qAm 'add foo bar' -d '0 0'
-
-echo >> foo
-hg ci -m 'change foo' -d '1 0'
-
-hg up -qC 0
-hg copy --after --force foo bar
-hg copy foo baz
-hg ci -m 'make bar and baz copies of foo' -d '2 0'
-
-hg merge
-hg ci -m 'merge local copy' -d '3 0'
-
-hg up -C 1
-hg merge 2
-hg ci -m 'merge remote copy' -d '4 0'
-
-chmod +x baz
-hg ci -m 'mark baz executable' -d '5 0'
-
-hg branch foo
-hg ci -m 'branch foo' -d '6 0'
-hg ci --close-branch -m 'close' -d '7 0'
-
-cd ..
-hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
-cd new
-hg out ../orig
-cd ..
-
-echo '% check shamap LF and CRLF handling'
-cat > rewrite.py <<EOF
-import sys
-# Interlace LF and CRLF
-lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
-         for i, l in enumerate(file(sys.argv[1]))]
-file(sys.argv[1], 'wb').write(''.join(lines))
-EOF
-python rewrite.py new/.hg/shamap
-cd orig
-hg up -qC 1
-echo foo >> foo
-hg ci -qm 'change foo again'
-hg up -qC 2
-echo foo >> foo
-hg ci -qm 'change foo again again'
-cd ..
-hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
-
-echo % init broken repository
-hg init broken
-cd broken
-echo a >> a
-echo b >> b
-hg ci -qAm init
-echo a >> a
-echo b >> b
-hg copy b c
-hg ci -qAm changeall
-hg up -qC 0
-echo bc >> b
-hg ci -m changebagain
-HGMERGE=internal:local hg -q merge
-hg ci -m merge
-hg mv b d
-hg ci -m moveb
-echo % break it
-rm .hg/store/data/b.*
-cd ..
-
-hg --config convert.hg.ignoreerrors=True convert broken fixed
-hg -R fixed verify
-echo '% manifest -r 0'
-hg -R fixed manifest -r 0
-echo '% manifest -r tip'
-hg -R fixed manifest -r tip
-
-true
--- a/tests/test-convert-hg-source.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-created new head
-merging baz and foo to baz
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging foo and baz to baz
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-created new head
-marked working directory as branch foo
-initializing destination new repository
-scanning source...
-sorting...
-converting...
-7 add foo bar
-6 change foo
-5 make bar and baz copies of foo
-4 merge local copy
-3 merge remote copy
-2 mark baz executable
-1 branch foo
-0 close
-comparing with ../orig
-searching for changes
-no changes found
-% check shamap LF and CRLF handling
-scanning source...
-sorting...
-converting...
-1 change foo again again
-0 change foo again
-% init broken repository
-created new head
-% break it
-initializing destination fixed repository
-scanning source...
-sorting...
-converting...
-4 init
-ignoring: data/b.i@1e88685f5dde: no match found
-3 changeall
-2 changebagain
-1 merge
-0 moveb
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 5 total revisions
-% manifest -r 0
-a
-% manifest -r tip
-a
-c
-d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-hg-source.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,138 @@
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > convert=
+  > [convert]
+  > hg.saverev=False
+  > EOF
+  $ hg init orig
+  $ cd orig
+  $ echo foo > foo
+  $ echo bar > bar
+  $ hg ci -qAm 'add foo bar' -d '0 0'
+  $ echo >> foo
+  $ hg ci -m 'change foo' -d '1 0'
+  $ hg up -qC 0
+  $ hg copy --after --force foo bar
+  $ hg copy foo baz
+  $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
+  created new head
+  $ hg merge
+  merging baz and foo to baz
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'merge local copy' -d '3 0'
+  $ hg up -C 1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg merge 2
+  merging foo and baz to baz
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'merge remote copy' -d '4 0'
+  created new head
+  $ chmod +x baz
+  $ hg ci -m 'mark baz executable' -d '5 0'
+  $ hg branch foo
+  marked working directory as branch foo
+  $ hg ci -m 'branch foo' -d '6 0'
+  $ hg ci --close-branch -m 'close' -d '7 0'
+  $ cd ..
+  $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  initializing destination new repository
+  scanning source...
+  sorting...
+  converting...
+  7 add foo bar
+  6 change foo
+  5 make bar and baz copies of foo
+  4 merge local copy
+  3 merge remote copy
+  2 mark baz executable
+  1 branch foo
+  0 close
+  $ cd new
+  $ hg out ../orig
+  comparing with ../orig
+  searching for changes
+  no changes found
+  [1]
+  $ cd ..
+
+check shamap LF and CRLF handling
+
+  $ cat > rewrite.py <<EOF
+  > import sys
+  > # Interlace LF and CRLF
+  > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
+  >          for i, l in enumerate(file(sys.argv[1]))]
+  > file(sys.argv[1], 'wb').write(''.join(lines))
+  > EOF
+  $ python rewrite.py new/.hg/shamap
+  $ cd orig
+  $ hg up -qC 1
+  $ echo foo >> foo
+  $ hg ci -qm 'change foo again'
+  $ hg up -qC 2
+  $ echo foo >> foo
+  $ hg ci -qm 'change foo again again'
+  $ cd ..
+  $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  scanning source...
+  sorting...
+  converting...
+  1 change foo again again
+  0 change foo again
+
+init broken repository
+
+  $ hg init broken
+  $ cd broken
+  $ echo a >> a
+  $ echo b >> b
+  $ hg ci -qAm init
+  $ echo a >> a
+  $ echo b >> b
+  $ hg copy b c
+  $ hg ci -qAm changeall
+  $ hg up -qC 0
+  $ echo bc >> b
+  $ hg ci -m changebagain
+  created new head
+  $ HGMERGE=internal:local hg -q merge
+  $ hg ci -m merge
+  $ hg mv b d
+  $ hg ci -m moveb
+
+break it
+
+  $ rm .hg/store/data/b.*
+  $ cd ..
+  $ hg --config convert.hg.ignoreerrors=True convert broken fixed
+  initializing destination fixed repository
+  scanning source...
+  sorting...
+  converting...
+  4 init
+  ignoring: data/b.i@1e88685f5dde: no match found
+  3 changeall
+  2 changebagain
+  1 merge
+  0 moveb
+  $ hg -R fixed verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 5 total revisions
+
+manifest -r 0
+
+  $ hg -R fixed manifest -r 0
+  a
+
+manifest -r tip
+
+  $ hg -R fixed manifest -r tip
+  a
+  c
+  d
--- a/tests/test-convert-hg-svn	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" svn svn-bindings || exit 80
-
-fix_path()
-{
-    tr '\\' /
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert = " >> $HGRCPATH
-echo "mq = " >> $HGRCPATH
-
-svnpath=`pwd | fix_path`/svn-repo
-svnadmin create "$svnpath"
-
-cat > "$svnpath"/hooks/pre-revprop-change <<'EOF'
-#!/bin/sh
-
-REPOS="$1"
-REV="$2"
-USER="$3"
-PROPNAME="$4"
-ACTION="$5"
-
-if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
-if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
-if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
-
-echo "Changing prohibited revision property" >&2
-exit 1
-EOF
-chmod +x "$svnpath"/hooks/pre-revprop-change
-
-# SVN wants all paths to start with a slash. Unfortunately,
-# Windows ones don't. Handle that.
-svnurl="$svnpath"
-expr "$svnurl" : "\/" > /dev/null
-if [ $? -ne 0 ]; then
-    svnurl="/$svnurl"
-fi
-svnurl="file://$svnurl"
-svn co "$svnurl" "$svnpath"-wc
-
-cd "$svnpath"-wc
-echo a > a
-svn add a
-svn ci -m'added a' a
-
-cd ..
-
-echo % initial roundtrip
-hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing
-hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
-
-echo % second roundtrip should do nothing
-hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
-hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
-
-echo % new hg rev
-
-hg clone "$svnpath"-hg "$svnpath"-work
-cd "$svnpath"-work
-echo b > b
-hg add b
-hg ci -mb
-echo '% adding an empty revision'
-hg qnew -m emtpy empty
-hg qfinish -a
-cd ..
-
-echo % echo hg to svn
-hg --cwd "$svnpath"-hg pull -q "$svnpath"-work
-hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
-
-echo % svn back to hg should do nothing
-hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
-echo % hg back to svn should do nothing
-hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
--- a/tests/test-convert-hg-svn.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-Checked out revision 0.
-A         a
-Adding         a
-Transmitting file data .
-Committed revision 1.
-% initial roundtrip
-scanning source...
-sorting...
-converting...
-0 added a
-scanning source...
-sorting...
-converting...
-% second roundtrip should do nothing
-scanning source...
-sorting...
-converting...
-scanning source...
-sorting...
-converting...
-% new hg rev
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% adding an empty revision
-% echo hg to svn
-scanning source...
-sorting...
-converting...
-1 b
-0 emtpy
-% svn back to hg should do nothing
-scanning source...
-sorting...
-converting...
-% hg back to svn should do nothing
-scanning source...
-sorting...
-converting...
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-hg-svn.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,108 @@
+
+  $ "$TESTDIR/hghave" svn svn-bindings || exit 80
+  $ fix_path()
+  > {
+  >     tr '\\' /
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert = " >> $HGRCPATH
+  $ echo "mq = " >> $HGRCPATH
+  $ svnpath=`pwd | fix_path`/svn-repo
+  $ svnadmin create "$svnpath"
+  $ cat > "$svnpath"/hooks/pre-revprop-change <<EOF
+  > #!/bin/sh
+  > 
+  > REPOS="$1"
+  > REV="$2"
+  > USER="$3"
+  > PROPNAME="$4"
+  > ACTION="$5"
+  > 
+  > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
+  > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi
+  > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi
+  > 
+  > echo "Changing prohibited revision property" >&2
+  > exit 1
+  > EOF
+  $ chmod +x "$svnpath"/hooks/pre-revprop-change
+  $ 
+  $ # SVN wants all paths to start with a slash. Unfortunately,
+  $ # Windows ones don't. Handle that.
+  $ svnurl="$svnpath"
+  $ expr "$svnurl" : "\/" > /dev/null || svnurl="/$svnurl"
+  $ svnurl="file://$svnurl"
+  $ svn co "$svnurl" "$svnpath"-wc
+  Checked out revision 0.
+  $ cd "$svnpath"-wc
+  $ echo a > a
+  $ svn add a
+  A         a
+  $ svn ci -m'added a' a
+  Adding         a
+  Transmitting file data .
+  Committed revision 1.
+  $ cd ..
+
+initial roundtrip
+
+  $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing
+  scanning source...
+  sorting...
+  converting...
+  0 added a
+  $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
+  scanning source...
+  sorting...
+  converting...
+
+second roundtrip should do nothing
+
+  $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
+  scanning source...
+  sorting...
+  converting...
+  $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
+  scanning source...
+  sorting...
+  converting...
+
+new hg rev
+
+  $ hg clone "$svnpath"-hg "$svnpath"-work
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd "$svnpath"-work
+  $ echo b > b
+  $ hg add b
+  $ hg ci -mb
+
+adding an empty revision
+
+  $ hg qnew -m emtpy empty
+  $ hg qfinish -a
+  $ cd ..
+
+echo hg to svn
+
+  $ hg --cwd "$svnpath"-hg pull -q "$svnpath"-work
+  $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
+  scanning source...
+  sorting...
+  converting...
+  1 b
+  0 emtpy
+
+svn back to hg should do nothing
+
+  $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg
+  scanning source...
+  sorting...
+  converting...
+
+hg back to svn should do nothing
+
+  $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc
+  scanning source...
+  sorting...
+  converting...
--- a/tests/test-convert-mtn	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" mtn || exit 80
-
-# Monotone directory is called .monotone on *nix and monotone
-# on Windows. Having a variable here ease test patching.
-mtndir=.monotone
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-
-HOME=`pwd`/do_not_use_HOME_mtn; export HOME
-# Windows version of monotone home
-APPDATA=$HOME; export APPDATA
-
-echo % tedious monotone keys configuration
-# The /dev/null redirection is necessary under Windows, or
-# it complains about home directory permissions
-mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
-passphrase
-passphrase
-EOF
-cat >> $HOME/$mtndir/monotonerc <<EOF
-function get_passphrase(keypair_id)
-    return "passphrase"
-end
-EOF
-
-echo % create monotone repository
-mtn db init --db=repo.mtn
-mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
-cd workingdir
-echo a > a
-mkdir dir
-echo b > dir/b
-echo d > dir/d
-python -c 'file("bin", "wb").write("a\\x00b")'
-echo c > c
-mtn add a dir/b dir/d c bin
-mtn ci -m initialize
-echo % update monotone working directory
-mtn mv a dir/a
-echo a >> dir/a
-echo b >> dir/b
-mtn drop c
-python -c 'file("bin", "wb").write("b\\x00c")'
-mtn ci -m update1
-cd ..
-
-echo % convert once
-hg convert -s mtn repo.mtn
-
-cd workingdir
-echo e > e
-mtn add e
-mtn drop dir/b
-mtn mv bin bin2
-mtn ci -m 'update2 "with" quotes'
-echo '% test directory move'
-mkdir -p dir1/subdir1
-mkdir -p dir1/subdir2_other
-echo file1 > dir1/subdir1/file1
-echo file2 > dir1/subdir2_other/file1
-mtn add dir1/subdir1/file1 dir1/subdir2_other/file1
-mtn ci -m createdir1
-mtn rename dir1/subdir1 dir1/subdir2
-mtn ci -m movedir1
-echo '% test subdirectory move'
-mtn mv dir dir2
-echo newfile > dir2/newfile
-mtn drop dir2/d
-mtn add dir2/newfile
-mtn ci -m movedir
-# Test directory removal with empty directory
-mkdir dir2/dir
-mkdir dir2/dir/subdir
-echo f > dir2/dir/subdir/f
-mkdir dir2/dir/emptydir
-mtn add --quiet -R dir2/dir
-mtn ci -m emptydir
-mtn drop -R dir2/dir
-mtn ci -m dropdirectory
-echo '% test directory and file move'
-mkdir -p dir3/d1
-echo a > dir3/a
-mtn add dir3/a dir3/d1
-mtn ci -m dirfilemove
-mtn mv dir3/a dir3/d1/a
-mtn mv dir3/d1 dir3/d2
-mtn ci -m dirfilemove2
-echo '% test directory move into another directory move'
-mkdir dir4
-mkdir dir5
-echo a > dir4/a
-mtn add dir4/a dir5
-mtn ci -m dirdirmove
-mtn mv dir5 dir6
-mtn mv dir4 dir6/dir4
-mtn ci -m dirdirmove2
-echo '% test diverging directory moves'
-mkdir -p dir7/dir9/dir8
-echo a > dir7/dir9/dir8/a
-echo b > dir7/dir9/b
-echo c > dir7/c
-mtn add -R dir7
-mtn ci -m divergentdirmove
-mtn mv dir7 dir7-2
-mtn mv dir7-2/dir9 dir9-2
-mtn mv dir9-2/dir8 dir8-2
-mtn ci -m divergentdirmove2
-cd ..
-
-echo % convert incrementally
-hg convert -s mtn repo.mtn
-
-glog()
-{
-    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
-}
-
-cd repo.mtn-hg
-hg up -C
-glog
-echo % manifest
-hg manifest
-echo % contents
-cat dir2/a
-test -d dir2/dir && echo 'removed dir2/dir is still there!'
-
-echo % file move
-hg log -v -C -r 1 | grep copies
-echo % check directory move
-hg manifest -r 4
-test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!'
-test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!'
-hg log -v -C -r 4 | grep copies
-echo % check file remove with directory move
-hg manifest -r 5
-echo % check file move with directory move
-hg manifest -r 9
-echo % check file directory directory move
-hg manifest -r 11
-echo % check divergent directory moves
-hg manifest -r 13
-exit 0
-
--- a/tests/test-convert-mtn.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-% tedious monotone keys configuration
-% create monotone repository
-mtn: adding a to workspace manifest
-mtn: adding bin to workspace manifest
-mtn: adding c to workspace manifest
-mtn: adding dir to workspace manifest
-mtn: adding dir/b to workspace manifest
-mtn: adding dir/d to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 0f6e5e4f2e7d2a8ef312408f57618abf026afd90
-% update monotone working directory
-mtn: skipping dir, already accounted for in workspace
-mtn: renaming a to dir/a in workspace manifest
-mtn: dropping c from workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 51d0a982464573a2a2cf5ee2c9219c652aaebeff
-% convert once
-assuming destination repo.mtn-hg
-initializing destination repo.mtn-hg repository
-scanning source...
-sorting...
-converting...
-1 initialize
-0 update1
-mtn: adding e to workspace manifest
-mtn: dropping dir/b from workspace manifest
-mtn: renaming bin to bin2 in workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision ebe58335d85d8cb176b6d0a12be04f5314b998da
-% test directory move
-mtn: adding dir1 to workspace manifest
-mtn: adding dir1/subdir1 to workspace manifest
-mtn: adding dir1/subdir1/file1 to workspace manifest
-mtn: adding dir1/subdir2_other to workspace manifest
-mtn: adding dir1/subdir2_other/file1 to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision a8d62bc04fee4d2936d28e98bbcc81686dd74306
-mtn: skipping dir1, already accounted for in workspace
-mtn: renaming dir1/subdir1 to dir1/subdir2 in workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 2c3d241bbbfe538b1b51d910f5676407e3f4d3a6
-% test subdirectory move
-mtn: renaming dir to dir2 in workspace manifest
-mtn: dropping dir2/d from workspace manifest
-mtn: adding dir2/newfile to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision fdb5a02dae8bfce3a79b3393680af471016e1b4c
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 8bbf76d717001d24964e4604739fdcd0f539fc88
-mtn: dropping dir2/dir/subdir/f from workspace manifest
-mtn: dropping dir2/dir/subdir from workspace manifest
-mtn: dropping dir2/dir/emptydir from workspace manifest
-mtn: dropping dir2/dir from workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 2323d4bc324e6c82628dc04d47a9fd32ad24e322
-% test directory and file move
-mtn: adding dir3 to workspace manifest
-mtn: adding dir3/a to workspace manifest
-mtn: adding dir3/d1 to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 47b192f720faa622f48c68d1eb075b26d405aa8b
-mtn: skipping dir3/d1, already accounted for in workspace
-mtn: renaming dir3/a to dir3/d1/a in workspace manifest
-mtn: skipping dir3, already accounted for in workspace
-mtn: renaming dir3/d1 to dir3/d2 in workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 8b543a400d3ee7f6d4bb1835b9b9e3747c8cb632
-% test directory move into another directory move
-mtn: adding dir4 to workspace manifest
-mtn: adding dir4/a to workspace manifest
-mtn: adding dir5 to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 466e0b2afc7a55aa2b4ab2f57cb240bb6cd66fc7
-mtn: renaming dir5 to dir6 in workspace manifest
-mtn: skipping dir6, already accounted for in workspace
-mtn: renaming dir4 to dir6/dir4 in workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 3d1f77ebad0c23a5d14911be3b670f990991b749
-% test diverging directory moves
-mtn: adding dir7 to workspace manifest
-mtn: adding dir7/c to workspace manifest
-mtn: adding dir7/dir9 to workspace manifest
-mtn: adding dir7/dir9/b to workspace manifest
-mtn: adding dir7/dir9/dir8 to workspace manifest
-mtn: adding dir7/dir9/dir8/a to workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 08a08511f18b428d840199b062de90d0396bc2ed
-mtn: renaming dir7 to dir7-2 in workspace manifest
-mtn: renaming dir7-2/dir9 to dir9-2 in workspace manifest
-mtn: renaming dir9-2/dir8 to dir8-2 in workspace manifest
-mtn: beginning commit on branch 'com.selenic.test'
-mtn: committed revision 4a736634505795f17786fffdf2c9cbf5b11df6f6
-% convert incrementally
-assuming destination repo.mtn-hg
-scanning source...
-sorting...
-converting...
-11 update2 "with" quotes
-10 createdir1
-9 movedir1
-8 movedir
-7 emptydir
-6 dropdirectory
-5 dirfilemove
-4 dirfilemove2
-3 dirdirmove
-2 dirdirmove2
-1 divergentdirmove
-0 divergentdirmove2
-11 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  13 "divergentdirmove2" files: dir7-2/c dir7/c dir7/dir9/b dir7/dir9/dir8/a dir8-2/a dir9-2/b
-|
-o  12 "divergentdirmove" files: dir7/c dir7/dir9/b dir7/dir9/dir8/a
-|
-o  11 "dirdirmove2" files: dir4/a dir6/dir4/a
-|
-o  10 "dirdirmove" files: dir4/a
-|
-o  9 "dirfilemove2" files: dir3/a dir3/d2/a
-|
-o  8 "dirfilemove" files: dir3/a
-|
-o  7 "dropdirectory" files: dir2/dir/subdir/f
-|
-o  6 "emptydir" files: dir2/dir/subdir/f
-|
-o  5 "movedir" files: dir/a dir/d dir2/a dir2/newfile
-|
-o  4 "movedir1" files: dir1/subdir1/file1 dir1/subdir2/file1
-|
-o  3 "createdir1" files: dir1/subdir1/file1 dir1/subdir2_other/file1
-|
-o  2 "update2 "with" quotes" files: bin bin2 dir/b e
-|
-o  1 "update1" files: a bin c dir/a dir/b
-|
-o  0 "initialize" files: a bin c dir/b dir/d
-
-% manifest
-bin2
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-dir2/a
-dir2/newfile
-dir3/d2/a
-dir6/dir4/a
-dir7-2/c
-dir8-2/a
-dir9-2/b
-e
-% contents
-a
-a
-% file move
-copies:      dir/a (a)
-% check directory move
-bin2
-dir/a
-dir/d
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-e
-copies:      dir1/subdir2/file1 (dir1/subdir1/file1)
-% check file remove with directory move
-bin2
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-dir2/a
-dir2/newfile
-e
-% check file move with directory move
-bin2
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-dir2/a
-dir2/newfile
-dir3/d2/a
-e
-% check file directory directory move
-bin2
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-dir2/a
-dir2/newfile
-dir3/d2/a
-dir6/dir4/a
-e
-% check divergent directory moves
-bin2
-dir1/subdir2/file1
-dir1/subdir2_other/file1
-dir2/a
-dir2/newfile
-dir3/d2/a
-dir6/dir4/a
-dir7-2/c
-dir8-2/a
-dir9-2/b
-e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-mtn.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,358 @@
+
+  $ "$TESTDIR/hghave" mtn || exit 80
+
+Monotone directory is called .monotone on *nix and monotone
+on Windows. Having a variable here ease test patching.
+
+  $ mtndir=.monotone
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'graphlog =' >> $HGRCPATH
+  $ HOME=`pwd`/do_not_use_HOME_mtn; export HOME
+
+Windows version of monotone home
+
+  $ APPDATA=$HOME; export APPDATA
+
+tedious monotone keys configuration
+The /dev/null redirection is necessary under Windows, or
+it complains about home directory permissions
+
+  $ mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
+  > passphrase
+  > passphrase
+  > EOF
+  $ cat >> $HOME/$mtndir/monotonerc <<EOF
+  > function get_passphrase(keypair_id)
+  >     return "passphrase"
+  > end
+  > EOF
+
+create monotone repository
+
+  $ mtn db init --db=repo.mtn
+  $ mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
+  $ cd workingdir
+  $ echo a > a
+  $ mkdir dir
+  $ echo b > dir/b
+  $ echo d > dir/d
+  $ python -c 'file("bin", "wb").write("a\\x00b")'
+  $ echo c > c
+  $ mtn add a dir/b dir/d c bin
+  mtn: adding a to workspace manifest
+  mtn: adding bin to workspace manifest
+  mtn: adding c to workspace manifest
+  mtn: adding dir to workspace manifest
+  mtn: adding dir/b to workspace manifest
+  mtn: adding dir/d to workspace manifest
+  $ mtn ci -m initialize
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 0f6e5e4f2e7d2a8ef312408f57618abf026afd90
+
+update monotone working directory
+
+  $ mtn mv a dir/a
+  mtn: skipping dir, already accounted for in workspace
+  mtn: renaming a to dir/a in workspace manifest
+  $ echo a >> dir/a
+  $ echo b >> dir/b
+  $ mtn drop c
+  mtn: dropping c from workspace manifest
+  $ python -c 'file("bin", "wb").write("b\\x00c")'
+  $ mtn ci -m update1
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 51d0a982464573a2a2cf5ee2c9219c652aaebeff
+  $ cd ..
+
+convert once
+
+  $ hg convert -s mtn repo.mtn
+  assuming destination repo.mtn-hg
+  initializing destination repo.mtn-hg repository
+  scanning source...
+  sorting...
+  converting...
+  1 initialize
+  0 update1
+  $ cd workingdir
+  $ echo e > e
+  $ mtn add e
+  mtn: adding e to workspace manifest
+  $ mtn drop dir/b
+  mtn: dropping dir/b from workspace manifest
+  $ mtn mv bin bin2
+  mtn: renaming bin to bin2 in workspace manifest
+  $ mtn ci -m 'update2 "with" quotes'
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision ebe58335d85d8cb176b6d0a12be04f5314b998da
+
+test directory move
+
+  $ mkdir -p dir1/subdir1
+  $ mkdir -p dir1/subdir2_other
+  $ echo file1 > dir1/subdir1/file1
+  $ echo file2 > dir1/subdir2_other/file1
+  $ mtn add dir1/subdir1/file1 dir1/subdir2_other/file1
+  mtn: adding dir1 to workspace manifest
+  mtn: adding dir1/subdir1 to workspace manifest
+  mtn: adding dir1/subdir1/file1 to workspace manifest
+  mtn: adding dir1/subdir2_other to workspace manifest
+  mtn: adding dir1/subdir2_other/file1 to workspace manifest
+  $ mtn ci -m createdir1
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision a8d62bc04fee4d2936d28e98bbcc81686dd74306
+  $ mtn rename dir1/subdir1 dir1/subdir2
+  mtn: skipping dir1, already accounted for in workspace
+  mtn: renaming dir1/subdir1 to dir1/subdir2 in workspace manifest
+  $ mtn ci -m movedir1
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 2c3d241bbbfe538b1b51d910f5676407e3f4d3a6
+
+test subdirectory move
+
+  $ mtn mv dir dir2
+  mtn: renaming dir to dir2 in workspace manifest
+  $ echo newfile > dir2/newfile
+  $ mtn drop dir2/d
+  mtn: dropping dir2/d from workspace manifest
+  $ mtn add dir2/newfile
+  mtn: adding dir2/newfile to workspace manifest
+  $ mtn ci -m movedir
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision fdb5a02dae8bfce3a79b3393680af471016e1b4c
+
+Test directory removal with empty directory
+
+  $ mkdir dir2/dir
+  $ mkdir dir2/dir/subdir
+  $ echo f > dir2/dir/subdir/f
+  $ mkdir dir2/dir/emptydir
+  $ mtn add --quiet -R dir2/dir
+  $ mtn ci -m emptydir
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 8bbf76d717001d24964e4604739fdcd0f539fc88
+  $ mtn drop -R dir2/dir
+  mtn: dropping dir2/dir/subdir/f from workspace manifest
+  mtn: dropping dir2/dir/subdir from workspace manifest
+  mtn: dropping dir2/dir/emptydir from workspace manifest
+  mtn: dropping dir2/dir from workspace manifest
+  $ mtn ci -m dropdirectory
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 2323d4bc324e6c82628dc04d47a9fd32ad24e322
+
+test directory and file move
+
+  $ mkdir -p dir3/d1
+  $ echo a > dir3/a
+  $ mtn add dir3/a dir3/d1
+  mtn: adding dir3 to workspace manifest
+  mtn: adding dir3/a to workspace manifest
+  mtn: adding dir3/d1 to workspace manifest
+  $ mtn ci -m dirfilemove
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 47b192f720faa622f48c68d1eb075b26d405aa8b
+  $ mtn mv dir3/a dir3/d1/a
+  mtn: skipping dir3/d1, already accounted for in workspace
+  mtn: renaming dir3/a to dir3/d1/a in workspace manifest
+  $ mtn mv dir3/d1 dir3/d2
+  mtn: skipping dir3, already accounted for in workspace
+  mtn: renaming dir3/d1 to dir3/d2 in workspace manifest
+  $ mtn ci -m dirfilemove2
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 8b543a400d3ee7f6d4bb1835b9b9e3747c8cb632
+
+test directory move into another directory move
+
+  $ mkdir dir4
+  $ mkdir dir5
+  $ echo a > dir4/a
+  $ mtn add dir4/a dir5
+  mtn: adding dir4 to workspace manifest
+  mtn: adding dir4/a to workspace manifest
+  mtn: adding dir5 to workspace manifest
+  $ mtn ci -m dirdirmove
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 466e0b2afc7a55aa2b4ab2f57cb240bb6cd66fc7
+  $ mtn mv dir5 dir6
+  mtn: renaming dir5 to dir6 in workspace manifest
+  $ mtn mv dir4 dir6/dir4
+  mtn: skipping dir6, already accounted for in workspace
+  mtn: renaming dir4 to dir6/dir4 in workspace manifest
+  $ mtn ci -m dirdirmove2
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 3d1f77ebad0c23a5d14911be3b670f990991b749
+
+test diverging directory moves
+
+  $ mkdir -p dir7/dir9/dir8
+  $ echo a > dir7/dir9/dir8/a
+  $ echo b > dir7/dir9/b
+  $ echo c > dir7/c
+  $ mtn add -R dir7
+  mtn: adding dir7 to workspace manifest
+  mtn: adding dir7/c to workspace manifest
+  mtn: adding dir7/dir9 to workspace manifest
+  mtn: adding dir7/dir9/b to workspace manifest
+  mtn: adding dir7/dir9/dir8 to workspace manifest
+  mtn: adding dir7/dir9/dir8/a to workspace manifest
+  $ mtn ci -m divergentdirmove
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 08a08511f18b428d840199b062de90d0396bc2ed
+  $ mtn mv dir7 dir7-2
+  mtn: renaming dir7 to dir7-2 in workspace manifest
+  $ mtn mv dir7-2/dir9 dir9-2
+  mtn: renaming dir7-2/dir9 to dir9-2 in workspace manifest
+  $ mtn mv dir9-2/dir8 dir8-2
+  mtn: renaming dir9-2/dir8 to dir8-2 in workspace manifest
+  $ mtn ci -m divergentdirmove2
+  mtn: beginning commit on branch 'com.selenic.test'
+  mtn: committed revision 4a736634505795f17786fffdf2c9cbf5b11df6f6
+  $ cd ..
+
+convert incrementally
+
+  $ hg convert -s mtn repo.mtn
+  assuming destination repo.mtn-hg
+  scanning source...
+  sorting...
+  converting...
+  11 update2 "with" quotes
+  10 createdir1
+  9 movedir1
+  8 movedir
+  7 emptydir
+  6 dropdirectory
+  5 dirfilemove
+  4 dirfilemove2
+  3 dirdirmove
+  2 dirdirmove2
+  1 divergentdirmove
+  0 divergentdirmove2
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
+  > }
+  $ cd repo.mtn-hg
+  $ hg up -C
+  11 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ glog
+  @  13 "divergentdirmove2" files: dir7-2/c dir7/c dir7/dir9/b dir7/dir9/dir8/a dir8-2/a dir9-2/b
+  |
+  o  12 "divergentdirmove" files: dir7/c dir7/dir9/b dir7/dir9/dir8/a
+  |
+  o  11 "dirdirmove2" files: dir4/a dir6/dir4/a
+  |
+  o  10 "dirdirmove" files: dir4/a
+  |
+  o  9 "dirfilemove2" files: dir3/a dir3/d2/a
+  |
+  o  8 "dirfilemove" files: dir3/a
+  |
+  o  7 "dropdirectory" files: dir2/dir/subdir/f
+  |
+  o  6 "emptydir" files: dir2/dir/subdir/f
+  |
+  o  5 "movedir" files: dir/a dir/d dir2/a dir2/newfile
+  |
+  o  4 "movedir1" files: dir1/subdir1/file1 dir1/subdir2/file1
+  |
+  o  3 "createdir1" files: dir1/subdir1/file1 dir1/subdir2_other/file1
+  |
+  o  2 "update2 "with" quotes" files: bin bin2 dir/b e
+  |
+  o  1 "update1" files: a bin c dir/a dir/b
+  |
+  o  0 "initialize" files: a bin c dir/b dir/d
+  
+
+manifest
+
+  $ hg manifest
+  bin2
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  dir2/a
+  dir2/newfile
+  dir3/d2/a
+  dir6/dir4/a
+  dir7-2/c
+  dir8-2/a
+  dir9-2/b
+  e
+
+contents
+
+  $ cat dir2/a
+  a
+  a
+  $ test -d dir2/dir && echo 'removed dir2/dir is still there!'
+  [1]
+
+file move
+
+  $ hg log -v -C -r 1 | grep copies
+  copies:      dir/a (a)
+
+check directory move
+
+  $ hg manifest -r 4
+  bin2
+  dir/a
+  dir/d
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  e
+  $ test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!'
+  $ test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!'
+  [1]
+  $ hg log -v -C -r 4 | grep copies
+  copies:      dir1/subdir2/file1 (dir1/subdir1/file1)
+
+check file remove with directory move
+
+  $ hg manifest -r 5
+  bin2
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  dir2/a
+  dir2/newfile
+  e
+
+check file move with directory move
+
+  $ hg manifest -r 9
+  bin2
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  dir2/a
+  dir2/newfile
+  dir3/d2/a
+  e
+
+check file directory directory move
+
+  $ hg manifest -r 11
+  bin2
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  dir2/a
+  dir2/newfile
+  dir3/d2/a
+  dir6/dir4/a
+  e
+
+check divergent directory moves
+
+  $ hg manifest -r 13
+  bin2
+  dir1/subdir2/file1
+  dir1/subdir2_other/file1
+  dir2/a
+  dir2/newfile
+  dir3/d2/a
+  dir6/dir4/a
+  dir7-2/c
+  dir8-2/a
+  dir9-2/b
+  e
--- a/tests/test-convert-splicemap	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-
-glog()
-{
-    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
-}
-
-hg init repo1
-cd repo1
-echo a > a
-hg ci -Am adda
-echo b > b
-echo a >> a
-hg ci -Am addb
-PARENTID1=`hg id --debug -i`
-echo c > c
-hg ci -Am addc
-PARENTID2=`hg id --debug -i`
-cd ..
-
-hg init repo2
-cd repo2
-echo b > a
-echo d > d
-hg ci -Am addaandd
-CHILDID1=`hg id --debug -i`
-echo d >> d
-hg ci -Am changed
-CHILDID2=`hg id --debug -i`
-echo e > e
-hg ci -Am adde
-cd ..
-
-echo '% test invalid splicemap'
-cat > splicemap <<EOF
-$CHILDID2
-EOF
-hg convert --splicemap splicemap repo2 repo1
-
-echo '% splice repo2 on repo1'
-cat > splicemap <<EOF
-$CHILDID1 $PARENTID1
-$CHILDID2 $PARENTID2,$CHILDID1
-EOF
-hg clone repo1 target1
-hg convert --splicemap splicemap repo2 target1
-glog -R target1
--- a/tests/test-convert-splicemap.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-adding a
-adding b
-adding c
-adding a
-adding d
-adding e
-% test invalid splicemap
-abort: syntax error in splicemap(1): key/value pair expected
-% splice repo2 on repo1
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-scanning source...
-sorting...
-converting...
-2 addaandd
-spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db
-1 changed
-spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b
-0 adde
-o  5 "adde" files: e
-|
-o    4 "changed" files: d
-|\
-| o  3 "addaandd" files: a d
-| |
-@ |  2 "addc" files: c
-|/
-o  1 "addb" files: a b
-|
-o  0 "adda" files: a
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-splicemap.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,79 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'graphlog =' >> $HGRCPATH
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
+  > }
+  $ hg init repo1
+  $ cd repo1
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ echo b > b
+  $ echo a >> a
+  $ hg ci -Am addb
+  adding b
+  $ PARENTID1=`hg id --debug -i`
+  $ echo c > c
+  $ hg ci -Am addc
+  adding c
+  $ PARENTID2=`hg id --debug -i`
+  $ cd ..
+  $ hg init repo2
+  $ cd repo2
+  $ echo b > a
+  $ echo d > d
+  $ hg ci -Am addaandd
+  adding a
+  adding d
+  $ CHILDID1=`hg id --debug -i`
+  $ echo d >> d
+  $ hg ci -Am changed
+  $ CHILDID2=`hg id --debug -i`
+  $ echo e > e
+  $ hg ci -Am adde
+  adding e
+  $ cd ..
+
+test invalid splicemap
+
+  $ cat > splicemap <<EOF
+  > $CHILDID2
+  > EOF
+  $ hg convert --splicemap splicemap repo2 repo1
+  abort: syntax error in splicemap(1): key/value pair expected
+  [255]
+
+splice repo2 on repo1
+
+  $ cat > splicemap <<EOF
+  > $CHILDID1 $PARENTID1
+  > $CHILDID2 $PARENTID2,$CHILDID1
+  > EOF
+  $ hg clone repo1 target1
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg convert --splicemap splicemap repo2 target1
+  scanning source...
+  sorting...
+  converting...
+  2 addaandd
+  spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db
+  1 changed
+  spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b
+  0 adde
+  $ glog -R target1
+  o  5 "adde" files: e
+  |
+  o    4 "changed" files: d
+  |\
+  | o  3 "addaandd" files: a d
+  | |
+  @ |  2 "addc" files: c
+  |/
+  o  1 "addb" files: a b
+  |
+  o  0 "adda" files: a
+  
--- a/tests/test-convert-tagsbranch-topology	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" git || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'hgext.graphlog =' >> $HGRCPATH
-echo '[convert]' >> $HGRCPATH
-echo 'hg.usebranchnames = True' >> $HGRCPATH
-echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
-
-GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
-GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
-GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
-GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
-GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
-GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
-
-count=10
-action()
-{
-    GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
-    GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
-    git "$@" >/dev/null 2>/dev/null || echo "git command error"
-    count=`expr $count + 1`
-}
-
-glog()
-{
-    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
-}
-
-convertrepo()
-{
-    hg convert --datesort git-repo hg-repo
-}
-
-# Build a GIT repo with at least 1 tag
-mkdir git-repo
-cd git-repo
-git init >/dev/null 2>&1
-echo a > a
-git add a
-action commit -m "rev1"
-action tag -m "tag1" tag1
-cd ..
-
-# Do a first conversion
-convertrepo
-
-# Simulate upstream  updates after first conversion
-cd git-repo
-echo b > a
-git add a
-action commit -m "rev2"
-action tag -m "tag2" tag2
-cd ..
-
-# Perform an incremental conversion
-convertrepo
-
-# Print the log
-cd hg-repo
-glog
--- a/tests/test-convert-tagsbranch-topology.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-initializing destination hg-repo repository
-scanning source...
-sorting...
-converting...
-0 rev1
-updating tags
-scanning source...
-sorting...
-converting...
-0 rev2
-updating tags
-o  3 "update tags" files: .hgtags
-|
-| o  2 "rev2" files: a
-| |
-o |  1 "update tags" files: .hgtags
- /
-o  0 "rev1" files: a
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-tagsbranch-topology.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,82 @@
+
+  $ "$TESTDIR/hghave" git || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'hgext.graphlog =' >> $HGRCPATH
+  $ echo '[convert]' >> $HGRCPATH
+  $ echo 'hg.usebranchnames = True' >> $HGRCPATH
+  $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
+  $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
+  $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
+  $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
+  $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
+  $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
+  $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
+  $ count=10
+  $ action()
+  > {
+  >     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
+  >     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+  >     git "$@" >/dev/null 2>/dev/null || echo "git command error"
+  >     count=`expr $count + 1`
+  > }
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
+  > }
+  $ convertrepo()
+  > {
+  >     hg convert --datesort git-repo hg-repo
+  > }
+
+Build a GIT repo with at least 1 tag
+
+  $ mkdir git-repo
+  $ cd git-repo
+  $ git init >/dev/null 2>&1
+  $ echo a > a
+  $ git add a
+  $ action commit -m "rev1"
+  $ action tag -m "tag1" tag1
+  $ cd ..
+
+Do a first conversion
+
+  $ convertrepo
+  initializing destination hg-repo repository
+  scanning source...
+  sorting...
+  converting...
+  0 rev1
+  updating tags
+
+Simulate upstream  updates after first conversion
+
+  $ cd git-repo
+  $ echo b > a
+  $ git add a
+  $ action commit -m "rev2"
+  $ action tag -m "tag2" tag2
+  $ cd ..
+
+Perform an incremental conversion
+
+  $ convertrepo
+  scanning source...
+  sorting...
+  converting...
+  0 rev2
+  updating tags
+
+Print the log
+
+  $ cd hg-repo
+  $ glog
+  o  3 "update tags" files: .hgtags
+  |
+  | o  2 "rev2" files: a
+  | |
+  o |  1 "update tags" files: .hgtags
+   /
+  o  0 "rev1" files: a
+  
--- a/tests/test-convert-tla	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" tla || exit 80
-
-mkdir do_not_use_HOME_tla
-cd do_not_use_HOME_tla
-HOME=`pwd`; export HOME
-cd ..
-tla my-id "mercurial <mercurial@selenic.com>"
-
-echo "[extensions]" >> $HGRCPATH
-echo "convert=" >> $HGRCPATH
-echo 'graphlog =' >> $HGRCPATH
-
-echo % create tla archive
-tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
-
-echo % initialize tla repo
-mkdir tla-repo
-cd tla-repo/
-tla init-tree tla@mercurial--convert/tla--test--0
-tla import
-
-echo % create initial files
-echo 'this is a file' > a
-tla add a
-mkdir src
-tla add src
-cd src
-dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
-tla add b
-tla commit -s "added a file, src and src/b (binary)"
-
-echo % create link file and modify a
-ln -s ../a a-link
-tla add a-link
-echo 'this a modification to a' >> ../a
-tla commit -s "added link to a and modify a"
-
-echo % create second link and modify b
-ln -s ../a a-link-2
-tla add a-link-2
-dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
-tla commit -s "added second link and modify b"
-
-echo % b file to link and a-link-2 to regular file
-rm -f a-link-2
-echo 'this is now a regular file' > a-link-2
-ln -sf ../a b
-tla commit -s "file to link and link to file test"
-
-echo % move a-link-2 file and src directory
-cd ..
-tla mv src/a-link-2 c
-tla mv src test
-tla commit -s "move and rename a-link-2 file and src directory"
-
-cd ..
-
-echo % converting tla repo to Mercurial
-hg convert tla-repo tla-repo-hg
-
-tla register-archive -d tla@mercurial--convert
-
-glog()
-{
-    hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
-}
-
-echo % show graph log
-glog -R tla-repo-hg
-hg up -q -R tla-repo-hg
-hg -R tla-repo-hg manifest --debug
--- a/tests/test-convert-tla.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-% create tla archive
-% initialize tla repo
-* creating version tla@mercurial--convert/tla--test--0
-* imported tla@mercurial--convert/tla--test--0
-% create initial files
-A/ .arch-ids
-A/ src
-A/ src/.arch-ids
-A  .arch-ids/a.id
-A  a
-A  src/.arch-ids/=id
-A  src/.arch-ids/b.id
-A  src/b
-* update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1)
-* committed tla@mercurial--convert/tla--test--0--patch-1
-% create link file and modify a
-A  src/.arch-ids/a-link.id
-A  src/a-link
-M  a
-* update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2)
-* committed tla@mercurial--convert/tla--test--0--patch-2
-% create second link and modify b
-A  src/.arch-ids/a-link-2.id
-A  src/a-link-2
-Mb src/b
-* update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3)
-* committed tla@mercurial--convert/tla--test--0--patch-3
-% b file to link and a-link-2 to regular file
-fl src/b
-lf src/a-link-2
-* update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4)
-* committed tla@mercurial--convert/tla--test--0--patch-4
-% move a-link-2 file and src directory
-D/ src/.arch-ids
-A/ test/.arch-ids
-/> src	test
-=> src/.arch-ids/a-link-2.id	.arch-ids/c.id
-=> src/a-link-2	c
-=> src/.arch-ids/=id	test/.arch-ids/=id
-=> src/.arch-ids/a-link.id	test/.arch-ids/a-link.id
-=> src/.arch-ids/b.id	test/.arch-ids/b.id
-* update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5)
-* committed tla@mercurial--convert/tla--test--0--patch-5
-% converting tla repo to Mercurial
-initializing destination tla-repo-hg repository
-analyzing tree version tla@mercurial--convert/tla--test--0...
-scanning source...
-sorting...
-converting...
-5 initial import
-4 added a file, src and src/b (binary)
-3 added link to a and modify a
-2 added second link and modify b
-1 file to link and link to file test
-0 move and rename a-link-2 file and src directory
-% show graph log
-o  5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
-|
-o  4 "file to link and link to file test" files: src/a-link-2 src/b
-|
-o  3 "added second link and modify b" files: src/a-link-2 src/b
-|
-o  2 "added link to a and modify a" files: a src/a-link
-|
-o  1 "added a file, src and src/b (binary)" files: a src/b
-|
-o  0 "initial import" files:
-
-c4072c4b72e1cabace081888efa148ee80ca3cbb 644   a
-0201ac32a3a8e86e303dff60366382a54b48a72e 644   c
-c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link
-375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert-tla.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,139 @@
+
+  $ "$TESTDIR/hghave" tla || exit 80
+  $ mkdir do_not_use_HOME_tla
+  $ cd do_not_use_HOME_tla
+  $ HOME=`pwd`; export HOME
+  $ cd ..
+  $ tla my-id "mercurial <mercurial@selenic.com>"
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "convert=" >> $HGRCPATH
+  $ echo 'graphlog =' >> $HGRCPATH
+
+create tla archive
+
+  $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
+
+initialize tla repo
+
+  $ mkdir tla-repo
+  $ cd tla-repo/
+  $ tla init-tree tla@mercurial--convert/tla--test--0
+  $ tla import
+  * creating version tla@mercurial--convert/tla--test--0
+  * imported tla@mercurial--convert/tla--test--0
+
+create initial files
+
+  $ echo 'this is a file' > a
+  $ tla add a
+  $ mkdir src
+  $ tla add src
+  $ cd src
+  $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
+  $ tla add b
+  $ tla commit -s "added a file, src and src/b (binary)"
+  A/ .arch-ids
+  A/ src
+  A/ src/.arch-ids
+  A  .arch-ids/a.id
+  A  a
+  A  src/.arch-ids/=id
+  A  src/.arch-ids/b.id
+  A  src/b
+  * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1)
+  * committed tla@mercurial--convert/tla--test--0--patch-1
+
+create link file and modify a
+
+  $ ln -s ../a a-link
+  $ tla add a-link
+  $ echo 'this a modification to a' >> ../a
+  $ tla commit -s "added link to a and modify a"
+  A  src/.arch-ids/a-link.id
+  A  src/a-link
+  M  a
+  * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2)
+  * committed tla@mercurial--convert/tla--test--0--patch-2
+
+create second link and modify b
+
+  $ ln -s ../a a-link-2
+  $ tla add a-link-2
+  $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
+  $ tla commit -s "added second link and modify b"
+  A  src/.arch-ids/a-link-2.id
+  A  src/a-link-2
+  Mb src/b
+  * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3)
+  * committed tla@mercurial--convert/tla--test--0--patch-3
+
+b file to link and a-link-2 to regular file
+
+  $ rm -f a-link-2
+  $ echo 'this is now a regular file' > a-link-2
+  $ ln -sf ../a b
+  $ tla commit -s "file to link and link to file test"
+  fl src/b
+  lf src/a-link-2
+  * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4)
+  * committed tla@mercurial--convert/tla--test--0--patch-4
+
+move a-link-2 file and src directory
+
+  $ cd ..
+  $ tla mv src/a-link-2 c
+  $ tla mv src test
+  $ tla commit -s "move and rename a-link-2 file and src directory"
+  D/ src/.arch-ids
+  A/ test/.arch-ids
+  /> src	test
+  => src/.arch-ids/a-link-2.id	.arch-ids/c.id
+  => src/a-link-2	c
+  => src/.arch-ids/=id	test/.arch-ids/=id
+  => src/.arch-ids/a-link.id	test/.arch-ids/a-link.id
+  => src/.arch-ids/b.id	test/.arch-ids/b.id
+  * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5)
+  * committed tla@mercurial--convert/tla--test--0--patch-5
+  $ cd ..
+
+converting tla repo to Mercurial
+
+  $ hg convert tla-repo tla-repo-hg
+  initializing destination tla-repo-hg repository
+  analyzing tree version tla@mercurial--convert/tla--test--0...
+  scanning source...
+  sorting...
+  converting...
+  5 initial import
+  4 added a file, src and src/b (binary)
+  3 added link to a and modify a
+  2 added second link and modify b
+  1 file to link and link to file test
+  0 move and rename a-link-2 file and src directory
+  $ tla register-archive -d tla@mercurial--convert
+  $ glog()
+  > {
+  >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
+  > }
+
+show graph log
+
+  $ glog -R tla-repo-hg
+  o  5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b
+  |
+  o  4 "file to link and link to file test" files: src/a-link-2 src/b
+  |
+  o  3 "added second link and modify b" files: src/a-link-2 src/b
+  |
+  o  2 "added link to a and modify a" files: a src/a-link
+  |
+  o  1 "added a file, src and src/b (binary)" files: a src/b
+  |
+  o  0 "initial import" files:
+  
+  $ hg up -q -R tla-repo-hg
+  $ hg -R tla-repo-hg manifest --debug
+  c4072c4b72e1cabace081888efa148ee80ca3cbb 644   a
+  0201ac32a3a8e86e303dff60366382a54b48a72e 644   c
+  c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link
+  375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b
--- a/tests/test-convert.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,318 +0,0 @@
-hg convert [OPTION]... SOURCE [DEST [REVMAP]]
-
-convert a foreign SCM repository to a Mercurial one.
-
-    Accepted source formats [identifiers]:
-
-    - Mercurial [hg]
-    - CVS [cvs]
-    - Darcs [darcs]
-    - git [git]
-    - Subversion [svn]
-    - Monotone [mtn]
-    - GNU Arch [gnuarch]
-    - Bazaar [bzr]
-    - Perforce [p4]
-
-    Accepted destination formats [identifiers]:
-
-    - Mercurial [hg]
-    - Subversion [svn] (history on branches is not preserved)
-
-    If no revision is given, all revisions will be converted. Otherwise,
-    convert will only import up to the named revision (given in a format
-    understood by the source).
-
-    If no destination directory name is specified, it defaults to the basename
-    of the source with "-hg" appended. If the destination repository doesn't
-    exist, it will be created.
-
-    By default, all sources except Mercurial will use --branchsort. Mercurial
-    uses --sourcesort to preserve original revision numbers order. Sort modes
-    have the following effects:
-
-    --branchsort  convert from parent to child revision when possible, which
-                  means branches are usually converted one after the other. It
-                  generates more compact repositories.
-    --datesort    sort revisions by date. Converted repositories have good-
-                  looking changelogs but are often an order of magnitude
-                  larger than the same ones generated by --branchsort.
-    --sourcesort  try to preserve source revisions order, only supported by
-                  Mercurial sources.
-
-    If <REVMAP> isn't given, it will be put in a default location
-    (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file that
-    maps each source commit ID to the destination ID for that revision, like
-    so:
-
-      <source ID> <destination ID>
-
-    If the file doesn't exist, it's automatically created. It's updated on
-    each commit copied, so "hg convert" can be interrupted and can be run
-    repeatedly to copy new commits.
-
-    The authormap is a simple text file that maps each source commit author to
-    a destination commit author. It is handy for source SCMs that use unix
-    logins to identify authors (eg: CVS). One line per author mapping and the
-    line format is:
-
-      source author = destination author
-
-    Empty lines and lines starting with a "#" are ignored.
-
-    The filemap is a file that allows filtering and remapping of files and
-    directories. Each line can contain one of the following directives:
-
-      include path/to/file-or-dir
-
-      exclude path/to/file-or-dir
-
-      rename path/to/source path/to/destination
-
-    Comment lines start with "#". A specified path matches if it equals the
-    full relative name of a file or one of its parent directories. The
-    "include" or "exclude" directive with the longest matching path applies,
-    so line order does not matter.
-
-    The "include" directive causes a file, or all files under a directory, to
-    be included in the destination repository, and the exclusion of all other
-    files and directories not explicitly included. The "exclude" directive
-    causes files or directories to be omitted. The "rename" directive renames
-    a file or directory if it is converted. To rename from a subdirectory into
-    the root of the repository, use "." as the path to rename to.
-
-    The splicemap is a file that allows insertion of synthetic history,
-    letting you specify the parents of a revision. This is useful if you want
-    to e.g. give a Subversion merge two parents, or graft two disconnected
-    series of history together. Each entry contains a key, followed by a
-    space, followed by one or two comma-separated values:
-
-      key parent1, parent2
-
-    The key is the revision ID in the source revision control system whose
-    parents should be modified (same format as a key in .hg/shamap). The
-    values are the revision IDs (in either the source or destination revision
-    control system) that should be used as the new parents for that node. For
-    example, if you have merged "release-1.0" into "trunk", then you should
-    specify the revision on "trunk" as the first parent and the one on the
-    "release-1.0" branch as the second.
-
-    The branchmap is a file that allows you to rename a branch when it is
-    being brought in from whatever external repository. When used in
-    conjunction with a splicemap, it allows for a powerful combination to help
-    fix even the most badly mismanaged repositories and turn them into nicely
-    structured Mercurial repositories. The branchmap contains lines of the
-    form:
-
-      original_branch_name new_branch_name
-
-    where "original_branch_name" is the name of the branch in the source
-    repository, and "new_branch_name" is the name of the branch is the
-    destination repository. No whitespace is allowed in the branch names. This
-    can be used to (for instance) move code in one repository from "default"
-    to a named branch.
-
-    Mercurial Source
-    ----------------
-
-    --config convert.hg.ignoreerrors=False    (boolean)
-        ignore integrity errors when reading. Use it to fix Mercurial
-        repositories with missing revlogs, by converting from and to
-        Mercurial.
-
-    --config convert.hg.saverev=False         (boolean)
-        store original revision ID in changeset (forces target IDs to change)
-
-    --config convert.hg.startrev=0            (hg revision identifier)
-        convert start revision and its descendants
-
-    CVS Source
-    ----------
-
-    CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
-    indicate the starting point of what will be converted. Direct access to
-    the repository files is not needed, unless of course the repository is
-    :local:. The conversion uses the top level directory in the sandbox to
-    find the CVS repository, and then uses CVS rlog commands to find files to
-    convert. This means that unless a filemap is given, all files under the
-    starting directory will be converted, and that any directory
-    reorganization in the CVS sandbox is ignored.
-
-    The options shown are the defaults.
-
-    --config convert.cvsps.cache=True         (boolean)
-        Set to False to disable remote log caching, for testing and debugging
-        purposes.
-
-    --config convert.cvsps.fuzz=60            (integer)
-        Specify the maximum time (in seconds) that is allowed between commits
-        with identical user and log message in a single changeset. When very
-        large files were checked in as part of a changeset then the default
-        may not be long enough.
-
-    --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
-        Specify a regular expression to which commit log messages are matched.
-        If a match occurs, then the conversion process will insert a dummy
-        revision merging the branch on which this log message occurs to the
-        branch indicated in the regex.
-
-    --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
-        Specify a regular expression to which commit log messages are matched.
-        If a match occurs, then the conversion process will add the most
-        recent revision on the branch indicated in the regex as the second
-        parent of the changeset.
-
-    --config hook.cvslog
-        Specify a Python function to be called at the end of gathering the CVS
-        log. The function is passed a list with the log entries, and can
-        modify the entries in-place, or add or delete them.
-
-    --config hook.cvschangesets
-        Specify a Python function to be called after the changesets are
-        calculated from the the CVS log. The function is passed a list with
-        the changeset entries, and can modify the changesets in-place, or add
-        or delete them.
-
-    An additional "debugcvsps" Mercurial command allows the builtin changeset
-    merging code to be run without doing a conversion. Its parameters and
-    output are similar to that of cvsps 2.1. Please see the command help for
-    more details.
-
-    Subversion Source
-    -----------------
-
-    Subversion source detects classical trunk/branches/tags layouts. By
-    default, the supplied "svn://repo/path/" source URL is converted as a
-    single branch. If "svn://repo/path/trunk" exists it replaces the default
-    branch. If "svn://repo/path/branches" exists, its subdirectories are
-    listed as possible branches. If "svn://repo/path/tags" exists, it is
-    looked for tags referencing converted branches. Default "trunk",
-    "branches" and "tags" values can be overridden with following options. Set
-    them to paths relative to the source URL, or leave them blank to disable
-    auto detection.
-
-    --config convert.svn.branches=branches    (directory name)
-        specify the directory containing branches
-
-    --config convert.svn.tags=tags            (directory name)
-        specify the directory containing tags
-
-    --config convert.svn.trunk=trunk          (directory name)
-        specify the name of the trunk branch
-
-    Source history can be retrieved starting at a specific revision, instead
-    of being integrally converted. Only single branch conversions are
-    supported.
-
-    --config convert.svn.startrev=0           (svn revision number)
-        specify start Subversion revision.
-
-    Perforce Source
-    ---------------
-
-    The Perforce (P4) importer can be given a p4 depot path or a client
-    specification as source. It will convert all files in the source to a flat
-    Mercurial repository, ignoring labels, branches and integrations. Note
-    that when a depot path is given you then usually should specify a target
-    directory, because otherwise the target may be named ...-hg.
-
-    It is possible to limit the amount of source history to be converted by
-    specifying an initial Perforce revision.
-
-    --config convert.p4.startrev=0            (perforce changelist number)
-        specify initial Perforce revision.
-
-    Mercurial Destination
-    ---------------------
-
-    --config convert.hg.clonebranches=False   (boolean)
-        dispatch source branches in separate clones.
-
-    --config convert.hg.tagsbranch=default    (branch name)
-        tag revisions branch name
-
-    --config convert.hg.usebranchnames=True   (boolean)
-        preserve branch names
-
-options:
-
- -s --source-type TYPE  source repository type
- -d --dest-type TYPE    destination repository type
- -r --rev REV           import up to target revision REV
- -A --authormap FILE    remap usernames using this file
-    --filemap FILE      remap file names using contents of file
-    --splicemap FILE    splice synthesized history into place
-    --branchmap FILE    change branch names while converting
-    --branchsort        try to sort changesets by branches
-    --datesort          try to sort changesets by date
-    --sourcesort        preserve source changesets order
-
-use "hg -v help convert" to show global options
-adding a
-assuming destination a-hg
-initializing destination a-hg repository
-scanning source...
-sorting...
-converting...
-4 a
-3 b
-2 c
-1 d
-0 e
-pulling from ../a
-searching for changes
-no changes found
-% should fail
-initializing destination bogusfile repository
-abort: cannot create new bundle repository
-% should fail
-abort: Permission denied: bogusdir
-% should succeed
-initializing destination bogusdir repository
-scanning source...
-sorting...
-converting...
-4 a
-3 b
-2 c
-1 d
-0 e
-% test pre and post conversion actions
-run hg source pre-conversion action
-run hg sink pre-conversion action
-run hg sink post-conversion action
-run hg source post-conversion action
-% converting empty dir should fail nicely
-assuming destination emptydir-hg
-initializing destination emptydir-hg repository
-emptydir does not look like a CVS checkout
-emptydir does not look like a Git repository
-emptydir does not look like a Subversion repository
-emptydir is not a local Mercurial repository
-emptydir does not look like a darcs repository
-emptydir does not look like a monotone repository
-emptydir does not look like a GNU Arch repository
-emptydir does not look like a Bazaar repository
-cannot find required "p4" tool
-abort: emptydir: missing or unsupported repository
-% convert with imaginary source type
-initializing destination a-foo repository
-abort: foo: invalid source repository type
-% convert with imaginary sink type
-abort: foo: invalid destination repository type
-
-% testing: convert must not produce duplicate entries in fncache
-initializing destination b repository
-scanning source...
-sorting...
-converting...
-4 a
-3 b
-2 c
-1 d
-0 e
-% contents of fncache file:
-data/a.i
-data/b.i
-% test bogus URL
-abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-convert.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,387 @@
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > convert=
+  > [convert]
+  > hg.saverev=False
+  > EOF
+  $ hg help convert
+  hg convert [OPTION]... SOURCE [DEST [REVMAP]]
+  
+  convert a foreign SCM repository to a Mercurial one.
+  
+      Accepted source formats [identifiers]:
+  
+      - Mercurial [hg]
+      - CVS [cvs]
+      - Darcs [darcs]
+      - git [git]
+      - Subversion [svn]
+      - Monotone [mtn]
+      - GNU Arch [gnuarch]
+      - Bazaar [bzr]
+      - Perforce [p4]
+  
+      Accepted destination formats [identifiers]:
+  
+      - Mercurial [hg]
+      - Subversion [svn] (history on branches is not preserved)
+  
+      If no revision is given, all revisions will be converted. Otherwise,
+      convert will only import up to the named revision (given in a format
+      understood by the source).
+  
+      If no destination directory name is specified, it defaults to the basename
+      of the source with "-hg" appended. If the destination repository doesn't
+      exist, it will be created.
+  
+      By default, all sources except Mercurial will use --branchsort. Mercurial
+      uses --sourcesort to preserve original revision numbers order. Sort modes
+      have the following effects:
+  
+      --branchsort  convert from parent to child revision when possible, which
+                    means branches are usually converted one after the other. It
+                    generates more compact repositories.
+      --datesort    sort revisions by date. Converted repositories have good-
+                    looking changelogs but are often an order of magnitude
+                    larger than the same ones generated by --branchsort.
+      --sourcesort  try to preserve source revisions order, only supported by
+                    Mercurial sources.
+  
+      If <REVMAP> isn't given, it will be put in a default location
+      (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file that
+      maps each source commit ID to the destination ID for that revision, like
+      so:
+  
+        <source ID> <destination ID>
+  
+      If the file doesn't exist, it's automatically created. It's updated on
+      each commit copied, so "hg convert" can be interrupted and can be run
+      repeatedly to copy new commits.
+  
+      The authormap is a simple text file that maps each source commit author to
+      a destination commit author. It is handy for source SCMs that use unix
+      logins to identify authors (eg: CVS). One line per author mapping and the
+      line format is:
+  
+        source author = destination author
+  
+      Empty lines and lines starting with a "#" are ignored.
+  
+      The filemap is a file that allows filtering and remapping of files and
+      directories. Each line can contain one of the following directives:
+  
+        include path/to/file-or-dir
+  
+        exclude path/to/file-or-dir
+  
+        rename path/to/source path/to/destination
+  
+      Comment lines start with "#". A specified path matches if it equals the
+      full relative name of a file or one of its parent directories. The
+      "include" or "exclude" directive with the longest matching path applies,
+      so line order does not matter.
+  
+      The "include" directive causes a file, or all files under a directory, to
+      be included in the destination repository, and the exclusion of all other
+      files and directories not explicitly included. The "exclude" directive
+      causes files or directories to be omitted. The "rename" directive renames
+      a file or directory if it is converted. To rename from a subdirectory into
+      the root of the repository, use "." as the path to rename to.
+  
+      The splicemap is a file that allows insertion of synthetic history,
+      letting you specify the parents of a revision. This is useful if you want
+      to e.g. give a Subversion merge two parents, or graft two disconnected
+      series of history together. Each entry contains a key, followed by a
+      space, followed by one or two comma-separated values:
+  
+        key parent1, parent2
+  
+      The key is the revision ID in the source revision control system whose
+      parents should be modified (same format as a key in .hg/shamap). The
+      values are the revision IDs (in either the source or destination revision
+      control system) that should be used as the new parents for that node. For
+      example, if you have merged "release-1.0" into "trunk", then you should
+      specify the revision on "trunk" as the first parent and the one on the
+      "release-1.0" branch as the second.
+  
+      The branchmap is a file that allows you to rename a branch when it is
+      being brought in from whatever external repository. When used in
+      conjunction with a splicemap, it allows for a powerful combination to help
+      fix even the most badly mismanaged repositories and turn them into nicely
+      structured Mercurial repositories. The branchmap contains lines of the
+      form:
+  
+        original_branch_name new_branch_name
+  
+      where "original_branch_name" is the name of the branch in the source
+      repository, and "new_branch_name" is the name of the branch is the
+      destination repository. No whitespace is allowed in the branch names. This
+      can be used to (for instance) move code in one repository from "default"
+      to a named branch.
+  
+      Mercurial Source
+      ----------------
+  
+      --config convert.hg.ignoreerrors=False    (boolean)
+          ignore integrity errors when reading. Use it to fix Mercurial
+          repositories with missing revlogs, by converting from and to
+          Mercurial.
+  
+      --config convert.hg.saverev=False         (boolean)
+          store original revision ID in changeset (forces target IDs to change)
+  
+      --config convert.hg.startrev=0            (hg revision identifier)
+          convert start revision and its descendants
+  
+      CVS Source
+      ----------
+  
+      CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
+      indicate the starting point of what will be converted. Direct access to
+      the repository files is not needed, unless of course the repository is
+      :local:. The conversion uses the top level directory in the sandbox to
+      find the CVS repository, and then uses CVS rlog commands to find files to
+      convert. This means that unless a filemap is given, all files under the
+      starting directory will be converted, and that any directory
+      reorganization in the CVS sandbox is ignored.
+  
+      The options shown are the defaults.
+  
+      --config convert.cvsps.cache=True         (boolean)
+          Set to False to disable remote log caching, for testing and debugging
+          purposes.
+  
+      --config convert.cvsps.fuzz=60            (integer)
+          Specify the maximum time (in seconds) that is allowed between commits
+          with identical user and log message in a single changeset. When very
+          large files were checked in as part of a changeset then the default
+          may not be long enough.
+  
+      --config convert.cvsps.mergeto='{{mergetobranch ([-\w]+)}}'
+          Specify a regular expression to which commit log messages are matched.
+          If a match occurs, then the conversion process will insert a dummy
+          revision merging the branch on which this log message occurs to the
+          branch indicated in the regex.
+  
+      --config convert.cvsps.mergefrom='{{mergefrombranch ([-\w]+)}}'
+          Specify a regular expression to which commit log messages are matched.
+          If a match occurs, then the conversion process will add the most
+          recent revision on the branch indicated in the regex as the second
+          parent of the changeset.
+  
+      --config hook.cvslog
+          Specify a Python function to be called at the end of gathering the CVS
+          log. The function is passed a list with the log entries, and can
+          modify the entries in-place, or add or delete them.
+  
+      --config hook.cvschangesets
+          Specify a Python function to be called after the changesets are
+          calculated from the the CVS log. The function is passed a list with
+          the changeset entries, and can modify the changesets in-place, or add
+          or delete them.
+  
+      An additional "debugcvsps" Mercurial command allows the builtin changeset
+      merging code to be run without doing a conversion. Its parameters and
+      output are similar to that of cvsps 2.1. Please see the command help for
+      more details.
+  
+      Subversion Source
+      -----------------
+  
+      Subversion source detects classical trunk/branches/tags layouts. By
+      default, the supplied "svn://repo/path/" source URL is converted as a
+      single branch. If "svn://repo/path/trunk" exists it replaces the default
+      branch. If "svn://repo/path/branches" exists, its subdirectories are
+      listed as possible branches. If "svn://repo/path/tags" exists, it is
+      looked for tags referencing converted branches. Default "trunk",
+      "branches" and "tags" values can be overridden with following options. Set
+      them to paths relative to the source URL, or leave them blank to disable
+      auto detection.
+  
+      --config convert.svn.branches=branches    (directory name)
+          specify the directory containing branches
+  
+      --config convert.svn.tags=tags            (directory name)
+          specify the directory containing tags
+  
+      --config convert.svn.trunk=trunk          (directory name)
+          specify the name of the trunk branch
+  
+      Source history can be retrieved starting at a specific revision, instead
+      of being integrally converted. Only single branch conversions are
+      supported.
+  
+      --config convert.svn.startrev=0           (svn revision number)
+          specify start Subversion revision.
+  
+      Perforce Source
+      ---------------
+  
+      The Perforce (P4) importer can be given a p4 depot path or a client
+      specification as source. It will convert all files in the source to a flat
+      Mercurial repository, ignoring labels, branches and integrations. Note
+      that when a depot path is given you then usually should specify a target
+      directory, because otherwise the target may be named ...-hg.
+  
+      It is possible to limit the amount of source history to be converted by
+      specifying an initial Perforce revision.
+  
+      --config convert.p4.startrev=0            (perforce changelist number)
+          specify initial Perforce revision.
+  
+      Mercurial Destination
+      ---------------------
+  
+      --config convert.hg.clonebranches=False   (boolean)
+          dispatch source branches in separate clones.
+  
+      --config convert.hg.tagsbranch=default    (branch name)
+          tag revisions branch name
+  
+      --config convert.hg.usebranchnames=True   (boolean)
+          preserve branch names
+  
+  options:
+  
+   -s --source-type TYPE  source repository type
+   -d --dest-type TYPE    destination repository type
+   -r --rev REV           import up to target revision REV
+   -A --authormap FILE    remap usernames using this file
+      --filemap FILE      remap file names using contents of file
+      --splicemap FILE    splice synthesized history into place
+      --branchmap FILE    change branch names while converting
+      --branchsort        try to sort changesets by branches
+      --datesort          try to sort changesets by date
+      --sourcesort        preserve source changesets order
+  
+  use "hg -v help convert" to show global options
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -d'0 0' -Ama
+  adding a
+  $ hg cp a b
+  $ hg ci -d'1 0' -mb
+  $ hg rm a
+  $ hg ci -d'2 0' -mc
+  $ hg mv b a
+  $ hg ci -d'3 0' -md
+  $ echo a >> a
+  $ hg ci -d'4 0' -me
+  $ cd ..
+  $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
+  assuming destination a-hg
+  initializing destination a-hg repository
+  scanning source...
+  sorting...
+  converting...
+  4 a
+  3 b
+  2 c
+  1 d
+  0 e
+  $ hg --cwd a-hg pull ../a
+  pulling from ../a
+  searching for changes
+  no changes found
+  $ touch bogusfile
+
+should fail
+
+  $ hg convert a bogusfile
+  initializing destination bogusfile repository
+  abort: cannot create new bundle repository
+  [255]
+  $ mkdir bogusdir
+  $ chmod 000 bogusdir
+
+should fail
+
+  $ hg convert a bogusdir
+  abort: Permission denied: bogusdir
+  [255]
+
+should succeed
+
+  $ chmod 700 bogusdir
+  $ hg convert a bogusdir
+  initializing destination bogusdir repository
+  scanning source...
+  sorting...
+  converting...
+  4 a
+  3 b
+  2 c
+  1 d
+  0 e
+
+test pre and post conversion actions
+
+  $ echo 'include b' > filemap
+  $ hg convert --debug --filemap filemap a partialb | \
+  >     grep 'run hg'
+  run hg source pre-conversion action
+  run hg sink pre-conversion action
+  run hg sink post-conversion action
+  run hg source post-conversion action
+
+converting empty dir should fail "nicely
+
+  $ mkdir emptydir
+
+override $PATH to ensure p4 not visible; use $PYTHON in case we're
+running from a devel copy, not a temp installation
+
+  $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir
+  assuming destination emptydir-hg
+  initializing destination emptydir-hg repository
+  emptydir does not look like a CVS checkout
+  emptydir does not look like a Git repository
+  emptydir does not look like a Subversion repository
+  emptydir is not a local Mercurial repository
+  emptydir does not look like a darcs repository
+  emptydir does not look like a monotone repository
+  emptydir does not look like a GNU Arch repository
+  emptydir does not look like a Bazaar repository
+  cannot find required "p4" tool
+  abort: emptydir: missing or unsupported repository
+  [255]
+
+convert with imaginary source type
+
+  $ hg convert --source-type foo a a-foo
+  initializing destination a-foo repository
+  abort: foo: invalid source repository type
+  [255]
+
+convert with imaginary sink type
+
+  $ hg convert --dest-type foo a a-foo
+  abort: foo: invalid destination repository type
+  [255]
+
+testing: convert must not produce duplicate entries in fncache
+
+  $ hg convert a b
+  initializing destination b repository
+  scanning source...
+  sorting...
+  converting...
+  4 a
+  3 b
+  2 c
+  1 d
+  0 e
+
+contents of fncache file:
+
+  $ cat b/.hg/store/fncache
+  data/a.i
+  data/b.i
+
+test bogus URL
+
+  $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
+  abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
+  [255]
--- a/tests/test-diff-color	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "color=" >> $HGRCPATH
-
-hg init repo
-cd repo
-cat > a <<EOF
-c
-c
-a
-a
-b
-a
-a
-c
-c
-EOF
-hg ci -Am adda
-cat > a <<EOF
-c
-c
-a
-a
-dd
-a
-a
-c
-c
-EOF
-
-echo '% default context'
-hg diff --nodates --color=always
-
-echo '% --unified=2'
-hg diff --nodates -U 2  --color=always
-
-echo '% diffstat'
-hg diff --stat --color=always
-
-echo "record=" >> $HGRCPATH
-echo "[ui]" >> $HGRCPATH
-echo "interactive=true" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "git=True" >> $HGRCPATH
-
-echo % record
-chmod 0755 a
-hg record --color=always -m moda a <<EOF
-y
-y
-EOF
-echo
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg rollback
-echo % qrecord
-hg qrecord --color=always -m moda patch <<EOF
-y
-y
-EOF
-echo
--- a/tests/test-diff-color.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-adding a
-% default context
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-% --unified=2
-diff -r cf9f4ba66af2 a
---- a/a
-+++ b/a
-@@ -3,5 +3,5 @@
- a
- a
--b
-+dd
- a
- a
-% diffstat
- a |  2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-% record
-diff --git a/a b/a
-old mode 100644
-new mode 100755
-1 hunks, 1 lines changed
-examine changes to 'a'? [Ynsfdaq?] 
-@@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-record this change to 'a'? [Ynsfdaq?] 
-
-rolling back to revision 0 (undo commit)
-% qrecord
-diff --git a/a b/a
-old mode 100644
-new mode 100755
-1 hunks, 1 lines changed
-examine changes to 'a'? [Ynsfdaq?] 
-@@ -2,7 +2,7 @@
- c
- a
- a
--b
-+dd
- a
- a
- c
-record this change to 'a'? [Ynsfdaq?] 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-color.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,124 @@
+Setup
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color=" >> $HGRCPATH
+  $ hg init repo
+  $ cd repo
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > b
+  > a
+  > a
+  > c
+  > c
+  > EOF
+  $ hg ci -Am adda
+  adding a
+  $ cat > a <<EOF
+  > c
+  > c
+  > a
+  > a
+  > dd
+  > a
+  > a
+  > c
+  > c
+  > EOF
+
+default context
+
+  $ hg diff --nodates --color=always
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+
+--unified=2
+
+  $ hg diff --nodates -U 2  --color=always
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -3,5 +3,5 @@
+   a
+   a
+  -b
+  +dd
+   a
+   a
+
+diffstat
+
+  $ hg diff --stat --color=always
+   a |  2 +-
+   1 files changed, 1 insertions(+), 1 deletions(-)
+  $ echo "record=" >> $HGRCPATH
+  $ echo "[ui]" >> $HGRCPATH
+  $ echo "interactive=true" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "git=True" >> $HGRCPATH
+
+record
+
+  $ chmod 0755 a
+  $ hg record --color=always -m moda a <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/a b/a
+  old mode 100644
+  new mode 100755
+  1 hunks, 1 lines changed
+  examine changes to 'a'? [Ynsfdaq?] 
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+  record this change to 'a'? [Ynsfdaq?] 
+  $ echo
+  
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ hg rollback
+  rolling back to revision 0 (undo commit)
+
+qrecord
+
+  $ hg qrecord --color=always -m moda patch <<EOF
+  > y
+  > y
+  > EOF
+  diff --git a/a b/a
+  old mode 100644
+  new mode 100755
+  1 hunks, 1 lines changed
+  examine changes to 'a'? [Ynsfdaq?] 
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+  record this change to 'a'? [Ynsfdaq?] 
+  $ echo
+  
--- a/tests/test-encode	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-hg init
-
-cat > .hg/hgrc <<EOF
-[encode]
-not.gz = tr [:lower:] [:upper:]
-*.gz = gzip -d
-
-[decode]
-not.gz = tr [:upper:] [:lower:]
-*.gz = gzip
-
-EOF
-
-echo "this is a test" | gzip > a.gz
-echo "this is a test" > not.gz
-hg add *
-hg ci -m "test"
-echo %% no changes
-hg status
-touch *
-
-echo %% no changes
-hg status
-
-echo %% check contents in repo are encoded
-hg debugdata .hg/store/data/a.gz.d 0
-hg debugdata .hg/store/data/not.gz.d 0
-
-echo %% check committed content was decoded
-gunzip < a.gz
-cat not.gz
-
-rm *
-hg co -C
-
-echo %% check decoding of our new working dir copy
-gunzip < a.gz
-cat not.gz
-
-echo %% check hg cat operation
-hg cat a.gz
-hg cat --decode a.gz | gunzip
-mkdir subdir
-cd subdir
-hg -R .. cat ../a.gz
-hg -R .. cat --decode ../a.gz | gunzip
--- a/tests/test-encode.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-%% no changes
-%% no changes
-%% check contents in repo are encoded
-this is a test
-THIS IS A TEST
-%% check committed content was decoded
-this is a test
-this is a test
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-%% check decoding of our new working dir copy
-this is a test
-this is a test
-%% check hg cat operation
-this is a test
-this is a test
-this is a test
-this is a test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-encode.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,61 @@
+Test encode/decode filters
+
+  $ hg init
+  $ cat > .hg/hgrc <<EOF
+  > [encode]
+  > not.gz = tr [:lower:] [:upper:]
+  > *.gz = gzip -d
+  > [decode]
+  > not.gz = tr [:upper:] [:lower:]
+  > *.gz = gzip
+  > EOF
+  $ echo "this is a test" | gzip > a.gz
+  $ echo "this is a test" > not.gz
+  $ hg add *
+  $ hg ci -m "test"
+
+no changes
+
+  $ hg status
+  $ touch *
+
+no changes
+
+  $ hg status
+
+check contents in repo are encoded
+
+  $ hg debugdata .hg/store/data/a.gz.d 0
+  this is a test
+  $ hg debugdata .hg/store/data/not.gz.d 0
+  THIS IS A TEST
+
+check committed content was decoded
+
+  $ gunzip < a.gz
+  this is a test
+  $ cat not.gz
+  this is a test
+  $ rm *
+  $ hg co -C
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+check decoding of our new working dir copy
+
+  $ gunzip < a.gz
+  this is a test
+  $ cat not.gz
+  this is a test
+
+check hg cat operation
+
+  $ hg cat a.gz
+  this is a test
+  $ hg cat --decode a.gz | gunzip
+  this is a test
+  $ mkdir subdir
+  $ cd subdir
+  $ hg -R .. cat ../a.gz
+  this is a test
+  $ hg -R .. cat --decode ../a.gz | gunzip
+  this is a test
--- a/tests/test-encoding	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-hg init t
-cd t
-
-# we need a repo with some legacy latin-1 changesets
-hg unbundle $TESTDIR/legacy-encoding.hg
-hg co
-
-python << EOF
-f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
-f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
-f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
-EOF
-
-echo % should fail with encoding error
-echo "plain old ascii" > a
-hg st
-HGENCODING=ascii hg ci -l latin-1
-
-echo % these should work
-echo "latin-1" > a
-HGENCODING=latin-1 hg ci -l latin-1
-echo "utf-8" > a
-HGENCODING=utf-8 hg ci -l utf-8
-
-HGENCODING=latin-1 hg tag `cat latin-1-tag`
-HGENCODING=latin-1 hg branch `cat latin-1-tag`
-HGENCODING=latin-1 hg ci -m 'latin1 branch'
-rm .hg/branch
-
-echo "% hg log (ascii)"
-hg --encoding ascii log
-echo "% hg log (latin-1)"
-hg --encoding latin-1 log
-echo "% hg log (utf-8)"
-hg --encoding utf-8 log
-echo "% hg tags (ascii)"
-HGENCODING=ascii hg tags
-echo "% hg tags (latin-1)"
-HGENCODING=latin-1 hg tags
-echo "% hg tags (utf-8)"
-HGENCODING=utf-8 hg tags
-echo "% hg branches (ascii)"
-HGENCODING=ascii hg branches
-echo "% hg branches (latin-1)"
-HGENCODING=latin-1 hg branches
-echo "% hg branches (utf-8)"
-HGENCODING=utf-8 hg branches
-
-echo '[ui]' >> .hg/hgrc
-echo 'fallbackencoding = koi8-r' >> .hg/hgrc
-echo "% hg log (utf-8)"
-HGENCODING=utf-8 hg log
-
-echo "% hg log (dolphin)"
-HGENCODING=dolphin hg log
-
-HGENCODING=ascii hg branch `cat latin-1-tag`
-cp latin-1-tag .hg/branch
-HGENCODING=latin-1 hg ci -m 'should fail'
-exit 0
--- a/tests/test-encoding-align	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-#!/bin/sh
-
-########################################
-
-HGENCODING=utf-8
-export HGENCODING
-
-hg init t
-cd t
-
-python << EOF
-# (byte, width) = (6, 4)
-s = "\xe7\x9f\xad\xe5\x90\x8d"
-# (byte, width) = (7, 7): odd width is good for alignment test
-m = "MIDDLE_"
-# (byte, width) = (18, 12)
-l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d"
-
-f = file('s', 'w'); f.write(s); f.close()
-f = file('m', 'w'); f.write(m); f.close()
-f = file('l', 'w'); f.write(l); f.close()
-
-# instant extension to show list of options
-f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8
-def showoptlist(ui, repo, *pats, **opts):
-    '''dummy command to show option descriptions'''
-    return 0
-
-cmdtable = {
-    'showoptlist':
-        (showoptlist,
-         [('s', 'opt1', '', 'short width',  '""" + s + """'),
-          ('m', 'opt2', '', 'middle width', '""" + m + """'),
-          ('l', 'opt3', '', 'long width',   '""" + l + """')
-         ],
-         ""
-        )
-}
-""")
-f.close()
-EOF
-
-S=`cat s`
-M=`cat m`
-L=`cat l`
-
-########################################
-#### alignment of:
-####     - option descriptions in help
-
-cat <<EOF > .hg/hgrc
-[extensions]
-ja_ext = `pwd`/showoptlist.py
-EOF
-echo '% check alignment of option descriptions in help'
-hg help showoptlist
-
-########################################
-#### alignment of:
-####     - user names in annotate
-####     - file names in diffstat
-
-rm -f s; touch s
-rm -f m; touch m
-rm -f l; touch l
-
-#### add files
-
-cp s $S
-hg add $S
-cp m $M
-hg add $M
-cp l $L
-hg add $L
-
-#### commit(1)
-
-echo 'first line(1)' >> s; cp s $S
-echo 'first line(2)' >> m; cp m $M
-echo 'first line(3)' >> l; cp l $L
-hg commit -m 'first commit' -u $S
-
-#### commit(2)
-
-echo 'second line(1)' >> s; cp s $S
-echo 'second line(2)' >> m; cp m $M
-echo 'second line(3)' >> l; cp l $L
-hg commit -m 'second commit' -u $M
-
-#### commit(3)
-
-echo 'third line(1)' >> s; cp s $S
-echo 'third line(2)' >> m; cp m $M
-echo 'third line(3)' >> l; cp l $L
-hg commit -m 'third commit' -u $L
-
-#### check
-
-echo '% check alignment of user names in annotate'
-hg annotate -u $M
-echo '% check alignment of filenames in diffstat'
-hg diff -c tip --stat
-
-########################################
-#### alignment of:
-####     - branch names in list
-####     - tag names in list
-
-#### add branches/tags
-
-hg branch $S
-hg tag $S
-hg branch $M
-hg tag $M
-hg branch $L
-hg tag $L
-
-#### check
-
-echo '% check alignment of branches'
-hg tags
-echo '% check alignment of tags'
-hg tags
-
-########################################
-
-exit 0
--- a/tests/test-encoding-align.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-% check alignment of option descriptions in help
-hg showoptlist 
-
-dummy command to show option descriptions
-
-options:
-
- -s --opt1 çŸ­å          short width
- -m --opt2 MIDDLE_       middle width
- -l --opt3 é•·ã„é•·ã„åå‰  long width
-
-use "hg -v help showoptlist" to show global options
-% check alignment of user names in annotate
-        短å: first line(2)
-     MIDDLE_: second line(2)
-é•·ã„é•·ã„åå‰: third line(2)
-% check alignment of filenames in diffstat
- MIDDLE_      |  1 +
- çŸ­å         |  1 +
- é•·ã„é•·ã„åå‰ |  1 +
- 3 files changed, 3 insertions(+), 0 deletions(-)
-marked working directory as branch 短å
-marked working directory as branch MIDDLE_
-marked working directory as branch é•·ã„é•·ã„åå‰
-% check alignment of branches
-tip                                5:d745ff46155b
-é•·ã„é•·ã„åå‰                       4:9259be597f19
-MIDDLE_                            3:b06c5b6def9e
-çŸ­å                               2:64a70663cee8
-% check alignment of tags
-tip                                5:d745ff46155b
-é•·ã„é•·ã„åå‰                       4:9259be597f19
-MIDDLE_                            3:b06c5b6def9e
-çŸ­å                               2:64a70663cee8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-encoding-align.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,137 @@
+Test alignment of multibyte characters
+
+  $ HGENCODING=utf-8
+  $ export HGENCODING
+  $ hg init t
+  $ cd t
+  $ python << EOF
+  > # (byte, width) = (6, 4)
+  > s = "\xe7\x9f\xad\xe5\x90\x8d"
+  > # (byte, width) = (7, 7): odd width is good for alignment test
+  > m = "MIDDLE_"
+  > # (byte, width) = (18, 12)
+  > l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d"
+  > f = file('s', 'w'); f.write(s); f.close()
+  > f = file('m', 'w'); f.write(m); f.close()
+  > f = file('l', 'w'); f.write(l); f.close()
+  > # instant extension to show list of options
+  > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8
+  > def showoptlist(ui, repo, *pats, **opts):
+  >     '''dummy command to show option descriptions'''
+  >     return 0
+  > cmdtable = {
+  >     'showoptlist':
+  >         (showoptlist,
+  >          [('s', 'opt1', '', 'short width',  '""" + s + """'),
+  >           ('m', 'opt2', '', 'middle width', '""" + m + """'),
+  >           ('l', 'opt3', '', 'long width',   '""" + l + """')
+  >          ],
+  >          ""
+  >         )
+  > }
+  > """)
+  > f.close()
+  > EOF
+  $ S=`cat s`
+  $ M=`cat m`
+  $ L=`cat l`
+
+alignment of option descriptions in help
+
+  $ cat <<EOF > .hg/hgrc
+  > [extensions]
+  > ja_ext = `pwd`/showoptlist.py
+  > EOF
+
+check alignment of option descriptions in help
+
+  $ hg help showoptlist
+  hg showoptlist 
+  
+  dummy command to show option descriptions
+  
+  options:
+  
+   -s --opt1 çŸ­å          short width
+   -m --opt2 MIDDLE_       middle width
+   -l --opt3 é•·ã„é•·ã„åå‰  long width
+  
+  use "hg -v help showoptlist" to show global options
+
+
+  $ rm -f s; touch s
+  $ rm -f m; touch m
+  $ rm -f l; touch l
+
+add files
+
+  $ cp s $S
+  $ hg add $S
+  $ cp m $M
+  $ hg add $M
+  $ cp l $L
+  $ hg add $L
+
+commit(1)
+
+  $ echo 'first line(1)' >> s; cp s $S
+  $ echo 'first line(2)' >> m; cp m $M
+  $ echo 'first line(3)' >> l; cp l $L
+  $ hg commit -m 'first commit' -u $S
+
+commit(2)
+
+  $ echo 'second line(1)' >> s; cp s $S
+  $ echo 'second line(2)' >> m; cp m $M
+  $ echo 'second line(3)' >> l; cp l $L
+  $ hg commit -m 'second commit' -u $M
+
+commit(3)
+
+  $ echo 'third line(1)' >> s; cp s $S
+  $ echo 'third line(2)' >> m; cp m $M
+  $ echo 'third line(3)' >> l; cp l $L
+  $ hg commit -m 'third commit' -u $L
+
+check alignment of user names in annotate
+
+  $ hg annotate -u $M
+          短å: first line(2)
+       MIDDLE_: second line(2)
+  é•·ã„é•·ã„åå‰: third line(2)
+
+check alignment of filenames in diffstat
+
+  $ hg diff -c tip --stat
+   MIDDLE_      |  1 +
+   çŸ­å         |  1 +
+   é•·ã„é•·ã„åå‰ |  1 +
+   3 files changed, 3 insertions(+), 0 deletions(-)
+
+add branches/tags
+
+  $ hg branch $S
+  marked working directory as branch 短å
+  $ hg tag $S
+  $ hg branch $M
+  marked working directory as branch MIDDLE_
+  $ hg tag $M
+  $ hg branch $L
+  marked working directory as branch é•·ã„é•·ã„åå‰
+  $ hg tag $L
+
+check alignment of branches
+
+  $ hg tags
+  tip                                5:d745ff46155b
+  é•·ã„é•·ã„åå‰                       4:9259be597f19
+  MIDDLE_                            3:b06c5b6def9e
+  çŸ­å                               2:64a70663cee8
+
+check alignment of tags
+
+  $ hg tags
+  tip                                5:d745ff46155b
+  é•·ã„é•·ã„åå‰                       4:9259be597f19
+  MIDDLE_                            3:b06c5b6def9e
+  çŸ­å                               2:64a70663cee8
--- a/tests/test-encoding.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-(run 'hg update' to get a working copy)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should fail with encoding error
-M a
-? latin-1
-? latin-1-tag
-? utf-8
-transaction abort!
-rollback completed
-abort: decoding near ' encoded: é': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)!
-% these should work
-marked working directory as branch é
-% hg log (ascii)
-changeset:   5:093c6077d1c8
-branch:      ?
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin1 branch
-
-changeset:   4:94db611b4196
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag ? for changeset ca661e7520de
-
-changeset:   3:ca661e7520de
-tag:         ?
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e' encoded: ?
-
-changeset:   2:650c6f3d55dd
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin-1 e' encoded: ?
-
-changeset:   1:0e5b7e3f9c4a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     koi8-r: ????? = u'\u0440\u0442\u0443\u0442\u044c'
-
-changeset:   0:1e78a93102a3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     latin-1 e': ? = u'\xe9'
-
-% hg log (latin-1)
-changeset:   5:093c6077d1c8
-branch:      é
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin1 branch
-
-changeset:   4:94db611b4196
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag é for changeset ca661e7520de
-
-changeset:   3:ca661e7520de
-tag:         é
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e' encoded: é
-
-changeset:   2:650c6f3d55dd
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin-1 e' encoded: é
-
-changeset:   1:0e5b7e3f9c4a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     koi8-r: ÒÔÕÔØ = u'\u0440\u0442\u0443\u0442\u044c'
-
-changeset:   0:1e78a93102a3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     latin-1 e': é = u'\xe9'
-
-% hg log (utf-8)
-changeset:   5:093c6077d1c8
-branch:      é
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin1 branch
-
-changeset:   4:94db611b4196
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag é for changeset ca661e7520de
-
-changeset:   3:ca661e7520de
-tag:         é
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e' encoded: é
-
-changeset:   2:650c6f3d55dd
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin-1 e' encoded: é
-
-changeset:   1:0e5b7e3f9c4a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     koi8-r: ÒÔÕÔØ = u'\u0440\u0442\u0443\u0442\u044c'
-
-changeset:   0:1e78a93102a3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     latin-1 e': é = u'\xe9'
-
-% hg tags (ascii)
-tip                                5:093c6077d1c8
-?                                  3:ca661e7520de
-% hg tags (latin-1)
-tip                                5:093c6077d1c8
-é                                 3:ca661e7520de
-% hg tags (utf-8)
-tip                                5:093c6077d1c8
-é                                 3:ca661e7520de
-% hg branches (ascii)
-?                              5:093c6077d1c8
-default                        4:94db611b4196 (inactive)
-% hg branches (latin-1)
-é                             5:093c6077d1c8
-default                        4:94db611b4196 (inactive)
-% hg branches (utf-8)
-é                             5:093c6077d1c8
-default                        4:94db611b4196 (inactive)
-% hg log (utf-8)
-changeset:   5:093c6077d1c8
-branch:      é
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin1 branch
-
-changeset:   4:94db611b4196
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     Added tag é for changeset ca661e7520de
-
-changeset:   3:ca661e7520de
-tag:         é
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     utf-8 e' encoded: é
-
-changeset:   2:650c6f3d55dd
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     latin-1 e' encoded: é
-
-changeset:   1:0e5b7e3f9c4a
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     koi8-r: ртуть = u'\u0440\u0442\u0443\u0442\u044c'
-
-changeset:   0:1e78a93102a3
-user:        test
-date:        Mon Jan 12 13:46:40 1970 +0000
-summary:     latin-1 e': И = u'\xe9'
-
-% hg log (dolphin)
-abort: unknown encoding: dolphin, please check your locale settings
-abort: decoding near 'é': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
-abort: branch name not in UTF-8!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-encoding.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,245 @@
+Test character encoding
+
+  $ hg init t
+  $ cd t
+
+we need a repo with some legacy latin-1 changesets
+
+  $ hg unbundle $TESTDIR/legacy-encoding.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg co
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ python << EOF
+  > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
+  > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
+  > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
+  > EOF
+
+should fail with encoding error
+
+  $ echo "plain old ascii" > a
+  $ hg st
+  M a
+  ? latin-1
+  ? latin-1-tag
+  ? utf-8
+  $ HGENCODING=ascii hg ci -l latin-1
+  transaction abort!
+  rollback completed
+  abort: decoding near ' encoded: é': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)!
+  [255]
+
+these should work
+
+  $ echo "latin-1" > a
+  $ HGENCODING=latin-1 hg ci -l latin-1
+  $ echo "utf-8" > a
+  $ HGENCODING=utf-8 hg ci -l utf-8
+  $ HGENCODING=latin-1 hg tag `cat latin-1-tag`
+  $ HGENCODING=latin-1 hg branch `cat latin-1-tag`
+  marked working directory as branch é
+  $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
+  $ rm .hg/branch
+
+hg log (ascii)
+
+  $ hg --encoding ascii log
+  changeset:   5:093c6077d1c8
+  branch:      ?
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin1 branch
+  
+  changeset:   4:94db611b4196
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag ? for changeset ca661e7520de
+  
+  changeset:   3:ca661e7520de
+  tag:         ?
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     utf-8 e' encoded: ?
+  
+  changeset:   2:650c6f3d55dd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin-1 e' encoded: ?
+  
+  changeset:   1:0e5b7e3f9c4a
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     koi8-r: ????? = u'\u0440\u0442\u0443\u0442\u044c'
+  
+  changeset:   0:1e78a93102a3
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     latin-1 e': ? = u'\xe9'
+  
+
+hg log (latin-1)
+
+  $ hg --encoding latin-1 log
+  changeset:   5:093c6077d1c8
+  branch:      é
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin1 branch
+  
+  changeset:   4:94db611b4196
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag é for changeset ca661e7520de
+  
+  changeset:   3:ca661e7520de
+  tag:         é
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     utf-8 e' encoded: é
+  
+  changeset:   2:650c6f3d55dd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin-1 e' encoded: é
+  
+  changeset:   1:0e5b7e3f9c4a
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     koi8-r: ÒÔÕÔØ = u'\u0440\u0442\u0443\u0442\u044c'
+  
+  changeset:   0:1e78a93102a3
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     latin-1 e': é = u'\xe9'
+  
+
+hg log (utf-8)
+
+  $ hg --encoding utf-8 log
+  changeset:   5:093c6077d1c8
+  branch:      é
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin1 branch
+  
+  changeset:   4:94db611b4196
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag é for changeset ca661e7520de
+  
+  changeset:   3:ca661e7520de
+  tag:         é
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     utf-8 e' encoded: é
+  
+  changeset:   2:650c6f3d55dd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin-1 e' encoded: é
+  
+  changeset:   1:0e5b7e3f9c4a
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     koi8-r: ÒÔÕÔØ = u'\u0440\u0442\u0443\u0442\u044c'
+  
+  changeset:   0:1e78a93102a3
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     latin-1 e': é = u'\xe9'
+  
+
+hg tags (ascii)
+
+  $ HGENCODING=ascii hg tags
+  tip                                5:093c6077d1c8
+  ?                                  3:ca661e7520de
+
+hg tags (latin-1)
+
+  $ HGENCODING=latin-1 hg tags
+  tip                                5:093c6077d1c8
+  é                                 3:ca661e7520de
+
+hg tags (utf-8)
+
+  $ HGENCODING=utf-8 hg tags
+  tip                                5:093c6077d1c8
+  é                                 3:ca661e7520de
+
+hg branches (ascii)
+
+  $ HGENCODING=ascii hg branches
+  ?                              5:093c6077d1c8
+  default                        4:94db611b4196 (inactive)
+
+hg branches (latin-1)
+
+  $ HGENCODING=latin-1 hg branches
+  é                             5:093c6077d1c8
+  default                        4:94db611b4196 (inactive)
+
+hg branches (utf-8)
+
+  $ HGENCODING=utf-8 hg branches
+  é                             5:093c6077d1c8
+  default                        4:94db611b4196 (inactive)
+  $ echo '[ui]' >> .hg/hgrc
+  $ echo 'fallbackencoding = koi8-r' >> .hg/hgrc
+
+hg log (utf-8)
+
+  $ HGENCODING=utf-8 hg log
+  changeset:   5:093c6077d1c8
+  branch:      é
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin1 branch
+  
+  changeset:   4:94db611b4196
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     Added tag é for changeset ca661e7520de
+  
+  changeset:   3:ca661e7520de
+  tag:         é
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     utf-8 e' encoded: é
+  
+  changeset:   2:650c6f3d55dd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     latin-1 e' encoded: é
+  
+  changeset:   1:0e5b7e3f9c4a
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     koi8-r: ртуть = u'\u0440\u0442\u0443\u0442\u044c'
+  
+  changeset:   0:1e78a93102a3
+  user:        test
+  date:        Mon Jan 12 13:46:40 1970 +0000
+  summary:     latin-1 e': И = u'\xe9'
+  
+
+hg log (dolphin)
+
+  $ HGENCODING=dolphin hg log
+  abort: unknown encoding: dolphin, please check your locale settings
+  [255]
+  $ HGENCODING=ascii hg branch `cat latin-1-tag`
+  abort: decoding near 'é': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
+  [255]
+  $ cp latin-1-tag .hg/branch
+  $ HGENCODING=latin-1 hg ci -m 'should fail'
+  abort: branch name not in UTF-8!
+  [255]
--- a/tests/test-eol	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = True
-EOF
-
-cat > switch-eol.py <<EOF
-import sys
-
-try:
-    import os, msvcrt
-    msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
-    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
-except ImportError:
-    pass
-
-(old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
-print "%% switching encoding from %r to %r" % (old, new)
-for path in sys.argv[2:]:
-    data = file(path, 'rb').read()
-    data = data.replace(old, new)
-    file(path, 'wb').write(data)
-EOF
-
-seteol () {
-    if [ $1 = "LF" ]; then
-        EOL='\n'
-    else
-        EOL='\r\n'
-    fi
-}
-
-makerepo () {
-    seteol $1
-    echo "% setup $1 repository"
-    hg init repo
-    cd repo
-
-    cat > .hgeol <<EOF
-[repository]
-native = $1
-
-[patterns]
-mixed.txt = BIN
-**.txt = native
-EOF
-
-    printf "first${EOL}second${EOL}third${EOL}" > a.txt
-    hg commit --addremove -m 'checkin'
-    echo
-    cd ..
-}
-
-dotest () {
-    seteol $1
-    echo "% hg clone repo repo-$1"
-    hg clone --noupdate repo repo-$1
-    cd repo-$1
-
-    cat > .hg/hgrc <<EOF
-[extensions]
-eol =
-
-[eol]
-native = $1
-EOF
-
-    hg update
-    echo '% printrepr.py a.txt'
-    python $TESTDIR/printrepr.py < a.txt
-    echo '% hg cat a.txt'
-    hg cat a.txt | python $TESTDIR/printrepr.py
-
-    printf "fourth${EOL}" >> a.txt
-    echo '% printrepr.py a.txt'
-    python $TESTDIR/printrepr.py < a.txt
-    hg diff | python $TESTDIR/printrepr.py
-
-    python ../switch-eol.py $1 a.txt
-    echo '% hg diff only reports a single changed line:'
-    hg diff | python $TESTDIR/printrepr.py
-
-    echo "% reverting back to $1 format"
-    hg revert a.txt
-    python $TESTDIR/printrepr.py < a.txt
-
-    printf "first\r\nsecond\n" > mixed.txt
-    hg add mixed.txt
-    echo "% hg commit of inconsistent .txt file marked as binary (should work)"
-    hg commit -m 'binary file'
-
-    echo "% hg commit of inconsistent .txt file marked as native (should fail)"
-    printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
-    hg commit -m 'inconsistent file'
-
-    echo "% hg commit --config eol.only-consistent=False (should work)"
-    hg commit --config eol.only-consistent=False -m 'inconsistent file'
-
-    echo "% hg commit of binary .txt file marked as native (binary files always okay)"
-    printf "first${EOL}\0${EOL}third${EOL}" > a.txt
-    hg commit -m 'binary file'
-
-    cd ..
-    rm -r repo-$1
-}
-
-makerepo LF
-dotest LF
-dotest CRLF
-rm -r repo
-
-makerepo CRLF
-dotest LF
-dotest CRLF
-rm -r repo
-
-
-makemixedrepo () {
-    echo
-    echo "# setup $1 repository"
-    hg init mixed
-    cd mixed
-    printf "foo\r\nbar\r\nbaz\r\n" > win.txt
-    printf "foo\nbar\nbaz\n" > unix.txt
-    #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
-
-    hg commit --addremove -m 'created mixed files'
-
-    echo "# setting repository-native EOLs to $1"
-    cat > .hgeol <<EOF
-[repository]
-native = $1
-
-[patterns]
-**.txt = native
-EOF
-    hg commit --addremove -m 'added .hgeol'
-    cd ..
-}
-
-testmixed () {
-    echo
-    echo "% hg clone mixed mixed-$1"
-    hg clone mixed mixed-$1
-    cd mixed-$1
-
-    echo '% hg status (eol extension not yet activated)'
-    hg status
-
-    cat > .hg/hgrc <<EOF
-[extensions]
-eol =
-
-[eol]
-native = $1
-EOF
-
-    echo '% hg status (eol activated)'
-    hg status
-    echo '% hg commit'
-    hg commit -m 'synchronized EOLs'
-
-    echo '% hg status'
-    hg status
-
-    cd ..
-    rm -r mixed-$1
-}
-
-makemixedrepo LF
-testmixed LF
-testmixed CRLF
-rm -r mixed
-
-makemixedrepo CRLF
-testmixed LF
-testmixed CRLF
-rm -r mixed
-
--- a/tests/test-eol-add	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = 1
-EOF
-
-seteol () {
-    if [ $1 = "LF" ]; then
-        EOL='\n'
-    else
-        EOL='\r\n'
-    fi
-}
-
-makerepo () {
-    echo
-    echo "# ==== setup repository ===="
-    echo '% hg init'
-    hg init repo
-    cd repo
-
-    printf "first\nsecond\nthird\n" > a.txt
-    hg commit -d '100 0' --addremove -m 'LF commit'
-    cd ..
-}
-
-dotest () {
-    seteol $1
-
-    echo
-    echo "% hg clone repo repo-$1"
-    hg clone repo repo-$1
-    cd repo-$1
-
-    cat > .hg/hgrc <<EOF
-[extensions]
-eol =
-
-[eol]
-native = LF
-EOF
-
-    cat > .hgeol <<EOF
-[patterns]
-**.txt = native
-
-[repository]
-native = $1
-EOF
-
-    echo '% hg add .hgeol'
-    hg add .hgeol
-    echo '% hg status'
-    hg status
-
-    echo '% hg commit'
-    hg commit -d '200 0' -m 'Added .hgeol file'
-
-    echo '% hg status'
-    hg status
-
-    echo '% hg tip -p'
-    hg tip -p | python $TESTDIR/printrepr.py
-
-    cd ..
-    rm -r repo-$1
-}
-
-makerepo
-dotest LF
-dotest CRLF
-rm -r repo
--- a/tests/test-eol-add.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-
-# ==== setup repository ====
-% hg init
-adding a.txt
-
-% hg clone repo repo-LF
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg add .hgeol
-% hg status
-A .hgeol
-% hg commit
-% hg status
-% hg tip -p
-changeset:   1:34614fc6dc02
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:03:20 1970 +0000
-summary:     Added .hgeol file
-
-diff --git a/.hgeol b/.hgeol
-new file mode 100644
---- /dev/null
-+++ b/.hgeol
-@@ -0,0 +1,5 @@
-+[patterns]
-+**.txt = native
-+
-+[repository]
-+native = LF
-
-
-% hg clone repo repo-CRLF
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg add .hgeol
-% hg status
-M a.txt
-A .hgeol
-% hg commit
-% hg status
-% hg tip -p
-changeset:   1:4bbdacd3fe39
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:03:20 1970 +0000
-summary:     Added .hgeol file
-
-diff --git a/.hgeol b/.hgeol
-new file mode 100644
---- /dev/null
-+++ b/.hgeol
-@@ -0,0 +1,5 @@
-+[patterns]
-+**.txt = native
-+
-+[repository]
-+native = CRLF
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,3 @@
--first
--second
--third
-+first\r
-+second\r
-+third\r
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol-add.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,125 @@
+Test adding .hgeol
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = 1
+  > EOF
+  $ seteol () {
+  >     if [ $1 = "LF" ]; then
+  >         EOL='\n'
+  >     else
+  >         EOL='\r\n'
+  >     fi
+  > }
+  $ makerepo () {
+  >     echo
+  >     echo "# ==== setup repository ===="
+  >     echo '% hg init'
+  >     hg init repo
+  >     cd repo
+  >     printf "first\nsecond\nthird\n" > a.txt
+  >     hg commit -d '100 0' --addremove -m 'LF commit'
+  >     cd ..
+  > }
+  $ dotest () {
+  >     seteol $1
+  >     echo
+  >     echo "% hg clone repo repo-$1"
+  >     hg clone repo repo-$1
+  >     cd repo-$1
+  >     cat > .hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > [eol]
+  > native = LF
+  > EOF
+  >     cat > .hgeol <<EOF
+  > [patterns]
+  > **.txt = native
+  > [repository]
+  > native = $1
+  > EOF
+  >     echo '% hg add .hgeol'
+  >     hg add .hgeol
+  >     echo '% hg status'
+  >     hg status
+  >     echo '% hg commit'
+  >     hg commit -d '200 0' -m 'Added .hgeol file'
+  >     echo '% hg status'
+  >     hg status
+  >     echo '% hg tip -p'
+  >     hg tip -p | python $TESTDIR/printrepr.py
+  >     cd ..
+  >     rm -r repo-$1
+  > }
+  $ makerepo
+  
+  # ==== setup repository ====
+  % hg init
+  adding a.txt
+  $ dotest LF
+  
+  % hg clone repo repo-LF
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg add .hgeol
+  % hg status
+  A .hgeol
+  % hg commit
+  % hg status
+  % hg tip -p
+  changeset:   1:33503edb53b0
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:03:20 1970 +0000
+  summary:     Added .hgeol file
+  
+  diff --git a/.hgeol b/.hgeol
+  new file mode 100644
+  --- /dev/null
+  +++ b/.hgeol
+  @@ -0,0 +1,4 @@
+  +[patterns]
+  +**.txt = native
+  +[repository]
+  +native = LF
+  
+  $ dotest CRLF
+  
+  % hg clone repo repo-CRLF
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg add .hgeol
+  % hg status
+  M a.txt
+  A .hgeol
+  % hg commit
+  % hg status
+  % hg tip -p
+  changeset:   1:6e64eaa9eb23
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:03:20 1970 +0000
+  summary:     Added .hgeol file
+  
+  diff --git a/.hgeol b/.hgeol
+  new file mode 100644
+  --- /dev/null
+  +++ b/.hgeol
+  @@ -0,0 +1,4 @@
+  +[patterns]
+  +**.txt = native
+  +[repository]
+  +native = CRLF
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,3 @@
+  -first
+  -second
+  -third
+  +first\r
+  +second\r
+  +third\r
+  
+  $ rm -r repo
--- a/tests/test-eol-clone	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = True
-
-[extensions]
-eol =
-
-[eol]
-native = CRLF
-EOF
-
-echo "% setup repository"
-hg init repo
-cd repo
-
-cat > .hgeol <<EOF
-[patterns]
-**.txt = native
-EOF
-
-printf "first\r\nsecond\r\nthird\r\n" > a.txt
-hg commit --addremove -m 'checkin'
-cd ..
-
-echo "% hg clone repo repo-2"
-hg clone repo repo-2
-cd repo-2
-
-echo '% printrepr.py a.txt'
-python $TESTDIR/printrepr.py < a.txt
-echo '% hg cat a.txt'
-hg cat a.txt | python $TESTDIR/printrepr.py
-
-hg remove .hgeol
-hg commit -m 'remove eol'
-hg push --quiet
-
-cd ..
-
-# Test clone of repo with .hgeol in working dir, but no .hgeol in tip
-echo "% hg clone repo repo-3"
-hg clone repo repo-3
-cd repo-3
-
-echo '% printrepr.py a.txt'
-python $TESTDIR/printrepr.py < a.txt
-
-cd ..
-
-# Test clone of revision with .hgeol
-echo "% hg clone -r 1 repo repo-4"
-hg clone -r 0 repo repo-4
-cd repo-4
-
-echo '% cat .hgeol'
-cat .hgeol
-
-echo '% printrepr.py a.txt'
-python $TESTDIR/printrepr.py < a.txt
-
-cd ..
--- a/tests/test-eol-clone.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-% setup repository
-adding .hgeol
-adding a.txt
-% hg clone repo repo-2
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first\r
-second\r
-third\r
-% hg cat a.txt
-first
-second
-third
-% hg clone repo repo-3
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first
-second
-third
-% hg clone -r 1 repo repo-4
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% cat .hgeol
-[patterns]
-**.txt = native
-% printrepr.py a.txt
-first\r
-second\r
-third\r
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol-clone.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,78 @@
+Testing cloning with the EOL extension
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = True
+  > 
+  > [extensions]
+  > eol =
+  > 
+  > [eol]
+  > native = CRLF
+  > EOF
+
+setup repository
+
+  $ hg init repo
+  $ cd repo
+  $ cat > .hgeol <<EOF
+  > [patterns]
+  > **.txt = native
+  > EOF
+  $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
+  $ hg commit --addremove -m 'checkin'
+  adding .hgeol
+  adding a.txt
+
+Clone
+
+  $ cd ..
+  $ hg clone repo repo-2
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo-2
+  $ python $TESTDIR/printrepr.py < a.txt
+  first\r
+  second\r
+  third\r
+  $ hg cat a.txt | python $TESTDIR/printrepr.py
+  first
+  second
+  third
+  $ hg remove .hgeol
+  $ hg commit -m 'remove eol'
+  $ hg push --quiet
+  $ cd ..
+
+Test clone of repo with .hgeol in working dir, but no .hgeol in tip
+
+  $ hg clone repo repo-3
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo-3
+
+  $ python $TESTDIR/printrepr.py < a.txt
+  first
+  second
+  third
+
+Test clone of revision with .hgeol
+
+  $ cd ..
+  $ hg clone -r 0 repo repo-4
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd repo-4
+  $ cat .hgeol
+  [patterns]
+  **.txt = native
+
+  $ python $TESTDIR/printrepr.py < a.txt
+  first\r
+  second\r
+  third\r
--- a/tests/test-eol-hook	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = True
-EOF
-
-hg init main
-cat > main/.hg/hgrc <<EOF
-[extensions]
-eol =
-
-[hooks]
-pretxnchangegroup = python:hgext.eol.hook
-EOF
-
-hg clone main fork
-
-cd fork
-cat > .hgeol <<EOF
-[patterns]
-mixed.txt = BIN
-**.txt = native
-EOF
-
-hg add .hgeol
-hg commit -m 'Commit .hgeol'
-
-printf "first\nsecond\nthird\n" > a.txt
-hg add a.txt
-echo "% hg commit (LF a.txt)"
-hg commit -m 'LF a.txt'
-echo "% hg push"
-hg push ../main
-
-printf "first\r\nsecond\r\nthird\n" > a.txt
-echo "% hg commit (CRLF a.txt)"
-hg commit -m 'CRLF a.txt'
-echo "% hg push"
-hg push ../main
-
-
-echo "% hg commit (LF a.txt)"
-printf "first\nsecond\nthird\n" > a.txt
-hg commit -m 'LF a.txt (fixed)'
-echo "% hg push"
-hg push ../main
--- a/tests/test-eol-hook.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg commit (LF a.txt)
-% hg push
-pushing to ../main
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-% hg commit (CRLF a.txt)
-% hg push
-pushing to ../main
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-error: pretxnchangegroup hook failed: a.txt should not have CRLF line endings
-transaction abort!
-rollback completed
-abort: a.txt should not have CRLF line endings
-% hg commit (LF a.txt)
-% hg push
-pushing to ../main
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol-hook.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,63 @@
+Test the EOL hook
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = True
+  > EOF
+  $ hg init main
+  $ cat > main/.hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > 
+  > [hooks]
+  > pretxnchangegroup = python:hgext.eol.hook
+  > EOF
+  $ hg clone main fork
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd fork
+
+Create repo
+  $ cat > .hgeol <<EOF
+  > [patterns]
+  > mixed.txt = BIN
+  > **.txt = native
+  > EOF
+  $ hg add .hgeol
+  $ hg commit -m 'Commit .hgeol'
+
+  $ printf "first\nsecond\nthird\n" > a.txt
+  $ hg add a.txt
+  $ hg commit -m 'LF a.txt'
+  $ hg push ../main
+  pushing to ../main
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+
+  $ printf "first\r\nsecond\r\nthird\n" > a.txt
+  $ hg commit -m 'CRLF a.txt'
+  $ hg push ../main
+  pushing to ../main
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  error: pretxnchangegroup hook failed: a.txt should not have CRLF line endings
+  transaction abort!
+  rollback completed
+  abort: a.txt should not have CRLF line endings
+  [255]
+
+  $ printf "first\nsecond\nthird\n" > a.txt
+  $ hg commit -m 'LF a.txt (fixed)'
+  $ hg push ../main
+  pushing to ../main
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
--- a/tests/test-eol-patch	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = 1
-EOF
-
-seteol () {
-    if [ $1 = "LF" ]; then
-        EOL='\n'
-    else
-        EOL='\r\n'
-    fi
-}
-
-makerepo () {
-    seteol $1
-    echo
-    echo "# ==== setup $1 repository ===="
-    echo '% hg init'
-    hg init repo
-    cd repo
-
-    cat > .hgeol <<EOF
-[repository]
-native = $1
-
-[patterns]
-unix.txt = LF
-win.txt = CRLF
-**.txt = native
-EOF
-
-    printf "first\r\nsecond\r\nthird\r\n" > win.txt
-    printf "first\nsecond\nthird\n" > unix.txt
-    printf "first${EOL}second${EOL}third${EOL}" > native.txt
-    hg commit --addremove -m 'checkin'
-    cd ..
-}
-
-dotest () {
-    seteol $1
-
-    echo
-    echo "% hg clone repo repo-$1"
-    hg clone --noupdate repo repo-$1
-    cd repo-$1
-
-    cat > .hg/hgrc <<EOF
-[extensions]
-eol =
-
-[eol]
-native = $1
-EOF
-
-    hg update
-    echo '% printrepr.py native.txt'
-    python $TESTDIR/printrepr.py < native.txt
-
-    echo '% printrepr.py unix.txt'
-    python $TESTDIR/printrepr.py < unix.txt
-
-    echo '% printrepr.py win.txt'
-    python $TESTDIR/printrepr.py < win.txt
-
-    printf "first${EOL}third${EOL}" > native.txt
-    printf "first\r\nthird\r\n" > win.txt
-    printf "first\nthird\n" > unix.txt
-
-    echo '% hg diff'
-    hg diff > p
-    python $TESTDIR/printrepr.py < p
-
-    echo '% hg revert'
-    hg revert --all
-
-    echo '% hg import'
-    hg import -m 'patch' p
-
-    echo '% printrepr.py native.txt'
-    python $TESTDIR/printrepr.py < native.txt
-    echo '% printrepr.py unix.txt'
-    python $TESTDIR/printrepr.py < unix.txt
-    echo '% printrepr.py win.txt'
-    python $TESTDIR/printrepr.py < win.txt
-
-    echo '% hg diff -c tip'
-    hg diff -c tip | python $TESTDIR/printrepr.py
-
-    cd ..
-    rm -r repo-$1
-}
-
-makerepo LF
-dotest LF
-dotest CRLF
-rm -r repo
-
-makerepo CRLF
-dotest LF
-dotest CRLF
-rm -r repo
--- a/tests/test-eol-patch.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,310 +0,0 @@
-
-# ==== setup LF repository ====
-% hg init
-adding .hgeol
-adding native.txt
-adding unix.txt
-adding win.txt
-
-% hg clone repo repo-LF
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py native.txt
-first
-second
-third
-% printrepr.py unix.txt
-first
-second
-third
-% printrepr.py win.txt
-first\r
-second\r
-third\r
-% hg diff
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg revert
-reverting native.txt
-reverting unix.txt
-reverting win.txt
-% hg import
-applying p
-% printrepr.py native.txt
-first
-third
-% printrepr.py unix.txt
-first
-third
-% printrepr.py win.txt
-first\r
-third\r
-% hg diff -c tip
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-
-% hg clone repo repo-CRLF
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py native.txt
-first\r
-second\r
-third\r
-% printrepr.py unix.txt
-first
-second
-third
-% printrepr.py win.txt
-first\r
-second\r
-third\r
-% hg diff
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg revert
-reverting native.txt
-reverting unix.txt
-reverting win.txt
-% hg import
-applying p
-% printrepr.py native.txt
-first\r
-third\r
-% printrepr.py unix.txt
-first
-third
-% printrepr.py win.txt
-first\r
-third\r
-% hg diff -c tip
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-
-# ==== setup CRLF repository ====
-% hg init
-adding .hgeol
-adding native.txt
-adding unix.txt
-adding win.txt
-
-% hg clone repo repo-LF
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py native.txt
-first
-second
-third
-% printrepr.py unix.txt
-first
-second
-third
-% printrepr.py win.txt
-first\r
-second\r
-third\r
-% hg diff
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg revert
-reverting native.txt
-reverting unix.txt
-reverting win.txt
-% hg import
-applying p
-% printrepr.py native.txt
-first
-third
-% printrepr.py unix.txt
-first
-third
-% printrepr.py win.txt
-first\r
-third\r
-% hg diff -c tip
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-
-% hg clone repo repo-CRLF
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py native.txt
-first\r
-second\r
-third\r
-% printrepr.py unix.txt
-first
-second
-third
-% printrepr.py win.txt
-first\r
-second\r
-third\r
-% hg diff
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg revert
-reverting native.txt
-reverting unix.txt
-reverting win.txt
-% hg import
-applying p
-% printrepr.py native.txt
-first\r
-third\r
-% printrepr.py unix.txt
-first
-third
-% printrepr.py win.txt
-first\r
-third\r
-% hg diff -c tip
-diff --git a/native.txt b/native.txt
---- a/native.txt
-+++ b/native.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-diff --git a/unix.txt b/unix.txt
---- a/unix.txt
-+++ b/unix.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-diff --git a/win.txt b/win.txt
---- a/win.txt
-+++ b/win.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol-patch.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,400 @@
+Test EOL patching
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = 1
+  > EOF
+
+Set up helpers
+
+  $ seteol () {
+  >     if [ $1 = "LF" ]; then
+  >         EOL='\n'
+  >     else
+  >         EOL='\r\n'
+  >     fi
+  > }
+
+  $ makerepo () {
+  >     seteol $1
+  >     echo
+  >     echo "# ==== setup $1 repository ===="
+  >     echo '% hg init'
+  >     hg init repo
+  >     cd repo
+  >     cat > .hgeol <<EOF
+  > [repository]
+  > native = $1
+  > [patterns]
+  > unix.txt = LF
+  > win.txt = CRLF
+  > **.txt = native
+  > EOF
+  >     printf "first\r\nsecond\r\nthird\r\n" > win.txt
+  >     printf "first\nsecond\nthird\n" > unix.txt
+  >     printf "first${EOL}second${EOL}third${EOL}" > native.txt
+  >     hg commit --addremove -m 'checkin'
+  >     cd ..
+  > }
+
+  $ dotest () {
+  >     seteol $1
+  >     echo
+  >     echo "% hg clone repo repo-$1"
+  >     hg clone --noupdate repo repo-$1
+  >     cd repo-$1
+  >     cat > .hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > [eol]
+  > native = $1
+  > EOF
+  >     hg update
+  >     echo '% printrepr.py native.txt'
+  >     python $TESTDIR/printrepr.py < native.txt
+  >     echo '% printrepr.py unix.txt'
+  >     python $TESTDIR/printrepr.py < unix.txt
+  >     echo '% printrepr.py win.txt'
+  >     python $TESTDIR/printrepr.py < win.txt
+  >     printf "first${EOL}third${EOL}" > native.txt
+  >     printf "first\r\nthird\r\n" > win.txt
+  >     printf "first\nthird\n" > unix.txt
+  >     echo '% hg diff'
+  >     hg diff > p
+  >     python $TESTDIR/printrepr.py < p
+  >     echo '% hg revert'
+  >     hg revert --all
+  >     echo '% hg import'
+  >     hg import -m 'patch' p
+  >     echo '% printrepr.py native.txt'
+  >     python $TESTDIR/printrepr.py < native.txt
+  >     echo '% printrepr.py unix.txt'
+  >     python $TESTDIR/printrepr.py < unix.txt
+  >     echo '% printrepr.py win.txt'
+  >     python $TESTDIR/printrepr.py < win.txt
+  >     echo '% hg diff -c tip'
+  >     hg diff -c tip | python $TESTDIR/printrepr.py
+  >     cd ..
+  >     rm -r repo-$1
+  > }
+
+Run tests
+
+  $ makerepo LF
+  
+  # ==== setup LF repository ====
+  % hg init
+  adding .hgeol
+  adding native.txt
+  adding unix.txt
+  adding win.txt
+  $ dotest LF
+  
+  % hg clone repo repo-LF
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py native.txt
+  first
+  second
+  third
+  % printrepr.py unix.txt
+  first
+  second
+  third
+  % printrepr.py win.txt
+  first\r
+  second\r
+  third\r
+  % hg diff
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg revert
+  reverting native.txt
+  reverting unix.txt
+  reverting win.txt
+  % hg import
+  applying p
+  % printrepr.py native.txt
+  first
+  third
+  % printrepr.py unix.txt
+  first
+  third
+  % printrepr.py win.txt
+  first\r
+  third\r
+  % hg diff -c tip
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  $ dotest CRLF
+  
+  % hg clone repo repo-CRLF
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py native.txt
+  first\r
+  second\r
+  third\r
+  % printrepr.py unix.txt
+  first
+  second
+  third
+  % printrepr.py win.txt
+  first\r
+  second\r
+  third\r
+  % hg diff
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg revert
+  reverting native.txt
+  reverting unix.txt
+  reverting win.txt
+  % hg import
+  applying p
+  % printrepr.py native.txt
+  first\r
+  third\r
+  % printrepr.py unix.txt
+  first
+  third
+  % printrepr.py win.txt
+  first\r
+  third\r
+  % hg diff -c tip
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  $ rm -r repo
+  $ makerepo CRLF
+  
+  # ==== setup CRLF repository ====
+  % hg init
+  adding .hgeol
+  adding native.txt
+  adding unix.txt
+  adding win.txt
+  $ dotest LF
+  
+  % hg clone repo repo-LF
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py native.txt
+  first
+  second
+  third
+  % printrepr.py unix.txt
+  first
+  second
+  third
+  % printrepr.py win.txt
+  first\r
+  second\r
+  third\r
+  % hg diff
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg revert
+  reverting native.txt
+  reverting unix.txt
+  reverting win.txt
+  % hg import
+  applying p
+  % printrepr.py native.txt
+  first
+  third
+  % printrepr.py unix.txt
+  first
+  third
+  % printrepr.py win.txt
+  first\r
+  third\r
+  % hg diff -c tip
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  $ dotest CRLF
+  
+  % hg clone repo repo-CRLF
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py native.txt
+  first\r
+  second\r
+  third\r
+  % printrepr.py unix.txt
+  first
+  second
+  third
+  % printrepr.py win.txt
+  first\r
+  second\r
+  third\r
+  % hg diff
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg revert
+  reverting native.txt
+  reverting unix.txt
+  reverting win.txt
+  % hg import
+  applying p
+  % printrepr.py native.txt
+  first\r
+  third\r
+  % printrepr.py unix.txt
+  first
+  third
+  % printrepr.py win.txt
+  first\r
+  third\r
+  % hg diff -c tip
+  diff --git a/native.txt b/native.txt
+  --- a/native.txt
+  +++ b/native.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  diff --git a/unix.txt b/unix.txt
+  --- a/unix.txt
+  +++ b/unix.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  diff --git a/win.txt b/win.txt
+  --- a/win.txt
+  +++ b/win.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  $ rm -r repo
--- a/tests/test-eol-update	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#!/bin/sh
-
-cat > $HGRCPATH <<EOF
-[diff]
-git = 1
-EOF
-
-seteol () {
-    if [ $1 = "LF" ]; then
-        EOL='\n'
-    else
-        EOL='\r\n'
-    fi
-}
-
-makerepo () {
-    echo
-    echo "# ==== setup repository ===="
-    echo '% hg init'
-    hg init repo
-    cd repo
-
-    cat > .hgeol <<EOF
-[patterns]
-**.txt = LF
-EOF
-
-    printf "first\nsecond\nthird\n" > a.txt
-    hg commit --addremove -m 'LF commit'
-
-    cat > .hgeol <<EOF
-[patterns]
-**.txt = CRLF
-EOF
-
-    printf "first\r\nsecond\r\nthird\r\n" > a.txt
-    hg commit -m 'CRLF commit'
-
-    cd ..
-}
-
-dotest () {
-    seteol $1
-
-    echo
-    echo "% hg clone repo repo-$1"
-    hg clone --noupdate repo repo-$1
-    cd repo-$1
-
-    cat > .hg/hgrc <<EOF
-[extensions]
-eol =
-EOF
-
-    hg update
-
-    echo '% printrepr.py a.txt (before)'
-    python $TESTDIR/printrepr.py < a.txt
-
-    printf "first${EOL}third${EOL}" > a.txt
-
-    echo '% printrepr.py a.txt (after)'
-    python $TESTDIR/printrepr.py < a.txt
-    echo '% hg diff'
-    hg diff | python $TESTDIR/printrepr.py
-
-    echo '% hg update 0'
-    hg update 0
-
-    echo '% printrepr.py a.txt'
-    python $TESTDIR/printrepr.py < a.txt
-    echo '% hg diff'
-    hg diff | python $TESTDIR/printrepr.py
-
-
-    cd ..
-    rm -r repo-$1
-}
-
-makerepo
-dotest LF
-dotest CRLF
-rm -r repo
--- a/tests/test-eol-update.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-
-# ==== setup repository ====
-% hg init
-adding .hgeol
-adding a.txt
-
-% hg clone repo repo-LF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt (before)
-first\r
-second\r
-third\r
-% printrepr.py a.txt (after)
-first
-third
-% hg diff
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg update 0
-merging a.txt
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first
-third
-% hg diff
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
-
-% hg clone repo repo-CRLF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt (before)
-first\r
-second\r
-third\r
-% printrepr.py a.txt (after)
-first\r
-third\r
-% hg diff
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,2 @@
- first\r
--second\r
- third\r
-% hg update 0
-merging a.txt
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first
-third
-% hg diff
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,2 @@
- first
--second
- third
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol-update.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,152 @@
+Test EOL update
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = 1
+  > EOF
+
+  $ seteol () {
+  >     if [ $1 = "LF" ]; then
+  >         EOL='\n'
+  >     else
+  >         EOL='\r\n'
+  >     fi
+  > }
+
+  $ makerepo () {
+  >     echo
+  >     echo "# ==== setup repository ===="
+  >     echo '% hg init'
+  >     hg init repo
+  >     cd repo
+  > 
+  >     cat > .hgeol <<EOF
+  > [patterns]
+  > **.txt = LF
+  > EOF
+  > 
+  >     printf "first\nsecond\nthird\n" > a.txt
+  >     hg commit --addremove -m 'LF commit'
+  > 
+  >     cat > .hgeol <<EOF
+  > [patterns]
+  > **.txt = CRLF
+  > EOF
+  > 
+  >     printf "first\r\nsecond\r\nthird\r\n" > a.txt
+  >     hg commit -m 'CRLF commit'
+  > 
+  >     cd ..
+  > }
+
+  $ dotest () {
+  >     seteol $1
+  > 
+  >     echo
+  >     echo "% hg clone repo repo-$1"
+  >     hg clone --noupdate repo repo-$1
+  >     cd repo-$1
+  > 
+  >     cat > .hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > EOF
+  > 
+  >     hg update
+  > 
+  >     echo '% printrepr.py a.txt (before)'
+  >     python $TESTDIR/printrepr.py < a.txt
+  > 
+  >     printf "first${EOL}third${EOL}" > a.txt
+  > 
+  >     echo '% printrepr.py a.txt (after)'
+  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% hg diff'
+  >     hg diff | python $TESTDIR/printrepr.py
+  > 
+  >     echo '% hg update 0'
+  >     hg update 0
+  > 
+  >     echo '% printrepr.py a.txt'
+  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% hg diff'
+  >     hg diff | python $TESTDIR/printrepr.py
+  > 
+  > 
+  >     cd ..
+  >     rm -r repo-$1
+  > }
+
+  $ makerepo
+  
+  # ==== setup repository ====
+  % hg init
+  adding .hgeol
+  adding a.txt
+  $ dotest LF
+  
+  % hg clone repo repo-LF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt (before)
+  first\r
+  second\r
+  third\r
+  % printrepr.py a.txt (after)
+  first
+  third
+  % hg diff
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg update 0
+  merging a.txt
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first
+  third
+  % hg diff
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  $ dotest CRLF
+  
+  % hg clone repo repo-CRLF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt (before)
+  first\r
+  second\r
+  third\r
+  % printrepr.py a.txt (after)
+  first\r
+  third\r
+  % hg diff
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,2 @@
+   first\r
+  -second\r
+   third\r
+  % hg update 0
+  merging a.txt
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first
+  third
+  % hg diff
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,2 @@
+   first
+  -second
+   third
+  $ rm -r repo
--- a/tests/test-eol.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +0,0 @@
-% setup LF repository
-adding .hgeol
-adding a.txt
-
-% hg clone repo repo-LF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first
-second
-third
-% hg cat a.txt
-first
-second
-third
-% printrepr.py a.txt
-first
-second
-third
-fourth
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first
- second
- third
-+fourth
-% switching encoding from '\n' to '\r\n'
-% hg diff only reports a single changed line:
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first
- second
- third
-+fourth
-% reverting back to LF format
-first
-second
-third
-% hg commit of inconsistent .txt file marked as binary (should work)
-% hg commit of inconsistent .txt file marked as native (should fail)
-abort: inconsistent newline style in a.txt
-
-% hg commit --config eol.only-consistent=False (should work)
-% hg commit of binary .txt file marked as native (binary files always okay)
-% hg clone repo repo-CRLF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first\r
-second\r
-third\r
-% hg cat a.txt
-first
-second
-third
-% printrepr.py a.txt
-first\r
-second\r
-third\r
-fourth\r
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first
- second
- third
-+fourth
-% switching encoding from '\r\n' to '\n'
-% hg diff only reports a single changed line:
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first
- second
- third
-+fourth
-% reverting back to CRLF format
-first\r
-second\r
-third\r
-% hg commit of inconsistent .txt file marked as binary (should work)
-% hg commit of inconsistent .txt file marked as native (should fail)
-abort: inconsistent newline style in a.txt
-
-% hg commit --config eol.only-consistent=False (should work)
-% hg commit of binary .txt file marked as native (binary files always okay)
-% setup CRLF repository
-adding .hgeol
-adding a.txt
-
-% hg clone repo repo-LF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first
-second
-third
-% hg cat a.txt
-first\r
-second\r
-third\r
-% printrepr.py a.txt
-first
-second
-third
-fourth
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first\r
- second\r
- third\r
-+fourth\r
-% switching encoding from '\n' to '\r\n'
-% hg diff only reports a single changed line:
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first\r
- second\r
- third\r
-+fourth\r
-% reverting back to LF format
-first
-second
-third
-% hg commit of inconsistent .txt file marked as binary (should work)
-% hg commit of inconsistent .txt file marked as native (should fail)
-abort: inconsistent newline style in a.txt
-
-% hg commit --config eol.only-consistent=False (should work)
-% hg commit of binary .txt file marked as native (binary files always okay)
-% hg clone repo repo-CRLF
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% printrepr.py a.txt
-first\r
-second\r
-third\r
-% hg cat a.txt
-first\r
-second\r
-third\r
-% printrepr.py a.txt
-first\r
-second\r
-third\r
-fourth\r
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first\r
- second\r
- third\r
-+fourth\r
-% switching encoding from '\r\n' to '\n'
-% hg diff only reports a single changed line:
-diff --git a/a.txt b/a.txt
---- a/a.txt
-+++ b/a.txt
-@@ -1,3 +1,4 @@
- first\r
- second\r
- third\r
-+fourth\r
-% reverting back to CRLF format
-first\r
-second\r
-third\r
-% hg commit of inconsistent .txt file marked as binary (should work)
-% hg commit of inconsistent .txt file marked as native (should fail)
-abort: inconsistent newline style in a.txt
-
-% hg commit --config eol.only-consistent=False (should work)
-% hg commit of binary .txt file marked as native (binary files always okay)
-
-# setup LF repository
-adding unix.txt
-adding win.txt
-# setting repository-native EOLs to LF
-adding .hgeol
-
-% hg clone mixed mixed-LF
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg status (eol extension not yet activated)
-% hg status (eol activated)
-M win.txt
-% hg commit
-% hg status
-
-% hg clone mixed mixed-CRLF
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg status (eol extension not yet activated)
-% hg status (eol activated)
-M win.txt
-% hg commit
-% hg status
-
-# setup CRLF repository
-adding unix.txt
-adding win.txt
-# setting repository-native EOLs to CRLF
-adding .hgeol
-
-% hg clone mixed mixed-LF
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg status (eol extension not yet activated)
-% hg status (eol activated)
-M unix.txt
-% hg commit
-% hg status
-
-% hg clone mixed mixed-CRLF
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% hg status (eol extension not yet activated)
-% hg status (eol activated)
-M unix.txt
-% hg commit
-% hg status
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eol.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,385 @@
+Test EOL extension
+
+  $ cat > $HGRCPATH <<EOF
+  > [diff]
+  > git = True
+  > EOF
+
+Set up helpers
+
+  $ cat > switch-eol.py <<EOF
+  > import sys
+  > try:
+  >     import os, msvcrt
+  >     msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+  > except ImportError:
+  >     pass
+  > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
+  > print "%% switching encoding from %r to %r" % (old, new)
+  > for path in sys.argv[2:]:
+  >     data = file(path, 'rb').read()
+  >     data = data.replace(old, new)
+  >     file(path, 'wb').write(data)
+  > EOF
+
+  $ seteol () {
+  >     if [ $1 = "LF" ]; then
+  >         EOL='\n'
+  >     else
+  >         EOL='\r\n'
+  >     fi
+  > }
+
+  $ makerepo () {
+  >     seteol $1
+  >     echo "% setup $1 repository"
+  >     hg init repo
+  >     cd repo
+  >     cat > .hgeol <<EOF
+  > [repository]
+  > native = $1
+  > [patterns]
+  > mixed.txt = BIN
+  > **.txt = native
+  > EOF
+  >     printf "first${EOL}second${EOL}third${EOL}" > a.txt
+  >     hg commit --addremove -m 'checkin'
+  >     echo
+  >     cd ..
+  > }
+
+  $ dotest () {
+  >     seteol $1
+  >     echo "% hg clone repo repo-$1"
+  >     hg clone --noupdate repo repo-$1
+  >     cd repo-$1
+  >     cat > .hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > [eol]
+  > native = $1
+  > EOF
+  >     hg update
+  >     echo '% printrepr.py a.txt'
+  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% hg cat a.txt'
+  >     hg cat a.txt | python $TESTDIR/printrepr.py
+  >     printf "fourth${EOL}" >> a.txt
+  >     echo '% printrepr.py a.txt'
+  >     python $TESTDIR/printrepr.py < a.txt
+  >     hg diff | python $TESTDIR/printrepr.py
+  >     python ../switch-eol.py $1 a.txt
+  >     echo '% hg diff only reports a single changed line:'
+  >     hg diff | python $TESTDIR/printrepr.py
+  >     echo "% reverting back to $1 format"
+  >     hg revert a.txt
+  >     python $TESTDIR/printrepr.py < a.txt
+  >     printf "first\r\nsecond\n" > mixed.txt
+  >     hg add mixed.txt
+  >     echo "% hg commit of inconsistent .txt file marked as binary (should work)"
+  >     hg commit -m 'binary file'
+  >     echo "% hg commit of inconsistent .txt file marked as native (should fail)"
+  >     printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
+  >     hg commit -m 'inconsistent file'
+  >     echo "% hg commit --config eol.only-consistent=False (should work)"
+  >     hg commit --config eol.only-consistent=False -m 'inconsistent file'
+  >     echo "% hg commit of binary .txt file marked as native (binary files always okay)"
+  >     printf "first${EOL}\0${EOL}third${EOL}" > a.txt
+  >     hg commit -m 'binary file'
+  >     cd ..
+  >     rm -r repo-$1
+  > }
+
+  $ makemixedrepo () {
+  >     echo
+  >     echo "# setup $1 repository"
+  >     hg init mixed
+  >     cd mixed
+  >     printf "foo\r\nbar\r\nbaz\r\n" > win.txt
+  >     printf "foo\nbar\nbaz\n" > unix.txt
+  >     #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
+  >     hg commit --addremove -m 'created mixed files'
+  >     echo "# setting repository-native EOLs to $1"
+  >     cat > .hgeol <<EOF
+  > [repository]
+  > native = $1
+  > [patterns]
+  > **.txt = native
+  > EOF
+  >     hg commit --addremove -m 'added .hgeol'
+  >     cd ..
+  > }
+
+  $ testmixed () {
+  >     echo
+  >     echo "% hg clone mixed mixed-$1"
+  >     hg clone mixed mixed-$1
+  >     cd mixed-$1
+  >     echo '% hg status (eol extension not yet activated)'
+  >     hg status
+  >     cat > .hg/hgrc <<EOF
+  > [extensions]
+  > eol =
+  > [eol]
+  > native = $1
+  > EOF
+  >     echo '% hg status (eol activated)'
+  >     hg status
+  >     echo '% hg commit'
+  >     hg commit -m 'synchronized EOLs'
+  >     echo '% hg status'
+  >     hg status
+  >     cd ..
+  >     rm -r mixed-$1
+  > }
+
+Basic tests
+
+  $ makerepo LF
+  % setup LF repository
+  adding .hgeol
+  adding a.txt
+  
+  $ dotest LF
+  % hg clone repo repo-LF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first
+  second
+  third
+  % hg cat a.txt
+  first
+  second
+  third
+  % printrepr.py a.txt
+  first
+  second
+  third
+  fourth
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first
+   second
+   third
+  +fourth
+  % switching encoding from '\n' to '\r\n'
+  % hg diff only reports a single changed line:
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first
+   second
+   third
+  +fourth
+  % reverting back to LF format
+  first
+  second
+  third
+  % hg commit of inconsistent .txt file marked as binary (should work)
+  % hg commit of inconsistent .txt file marked as native (should fail)
+  abort: inconsistent newline style in a.txt
+  
+  % hg commit --config eol.only-consistent=False (should work)
+  % hg commit of binary .txt file marked as native (binary files always okay)
+  $ dotest CRLF
+  % hg clone repo repo-CRLF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first\r
+  second\r
+  third\r
+  % hg cat a.txt
+  first
+  second
+  third
+  % printrepr.py a.txt
+  first\r
+  second\r
+  third\r
+  fourth\r
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first
+   second
+   third
+  +fourth
+  % switching encoding from '\r\n' to '\n'
+  % hg diff only reports a single changed line:
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first
+   second
+   third
+  +fourth
+  % reverting back to CRLF format
+  first\r
+  second\r
+  third\r
+  % hg commit of inconsistent .txt file marked as binary (should work)
+  % hg commit of inconsistent .txt file marked as native (should fail)
+  abort: inconsistent newline style in a.txt
+  
+  % hg commit --config eol.only-consistent=False (should work)
+  % hg commit of binary .txt file marked as native (binary files always okay)
+  $ rm -r repo
+  $ makerepo CRLF
+  % setup CRLF repository
+  adding .hgeol
+  adding a.txt
+  
+  $ dotest LF
+  % hg clone repo repo-LF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first
+  second
+  third
+  % hg cat a.txt
+  first\r
+  second\r
+  third\r
+  % printrepr.py a.txt
+  first
+  second
+  third
+  fourth
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first\r
+   second\r
+   third\r
+  +fourth\r
+  % switching encoding from '\n' to '\r\n'
+  % hg diff only reports a single changed line:
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first\r
+   second\r
+   third\r
+  +fourth\r
+  % reverting back to LF format
+  first
+  second
+  third
+  % hg commit of inconsistent .txt file marked as binary (should work)
+  % hg commit of inconsistent .txt file marked as native (should fail)
+  abort: inconsistent newline style in a.txt
+  
+  % hg commit --config eol.only-consistent=False (should work)
+  % hg commit of binary .txt file marked as native (binary files always okay)
+  $ dotest CRLF
+  % hg clone repo repo-CRLF
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % printrepr.py a.txt
+  first\r
+  second\r
+  third\r
+  % hg cat a.txt
+  first\r
+  second\r
+  third\r
+  % printrepr.py a.txt
+  first\r
+  second\r
+  third\r
+  fourth\r
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first\r
+   second\r
+   third\r
+  +fourth\r
+  % switching encoding from '\r\n' to '\n'
+  % hg diff only reports a single changed line:
+  diff --git a/a.txt b/a.txt
+  --- a/a.txt
+  +++ b/a.txt
+  @@ -1,3 +1,4 @@
+   first\r
+   second\r
+   third\r
+  +fourth\r
+  % reverting back to CRLF format
+  first\r
+  second\r
+  third\r
+  % hg commit of inconsistent .txt file marked as binary (should work)
+  % hg commit of inconsistent .txt file marked as native (should fail)
+  abort: inconsistent newline style in a.txt
+  
+  % hg commit --config eol.only-consistent=False (should work)
+  % hg commit of binary .txt file marked as native (binary files always okay)
+  $ rm -r repo
+
+Mixed tests
+
+  $ makemixedrepo LF
+  
+  # setup LF repository
+  adding unix.txt
+  adding win.txt
+  # setting repository-native EOLs to LF
+  adding .hgeol
+  $ testmixed LF
+  
+  % hg clone mixed mixed-LF
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg status (eol extension not yet activated)
+  % hg status (eol activated)
+  M win.txt
+  % hg commit
+  % hg status
+  $ testmixed CRLF
+  
+  % hg clone mixed mixed-CRLF
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg status (eol extension not yet activated)
+  % hg status (eol activated)
+  M win.txt
+  % hg commit
+  % hg status
+  $ rm -r mixed
+  $ makemixedrepo CRLF
+  
+  # setup CRLF repository
+  adding unix.txt
+  adding win.txt
+  # setting repository-native EOLs to CRLF
+  adding .hgeol
+  $ testmixed LF
+  
+  % hg clone mixed mixed-LF
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg status (eol extension not yet activated)
+  % hg status (eol activated)
+  M unix.txt
+  % hg commit
+  % hg status
+  $ testmixed CRLF
+  
+  % hg clone mixed mixed-CRLF
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  % hg status (eol extension not yet activated)
+  % hg status (eol activated)
+  M unix.txt
+  % hg commit
+  % hg status
+  $ rm -r mixed
--- a/tests/test-eolfilename	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-# http://mercurial.selenic.com/bts/issue352
-
-"$TESTDIR/hghave" eol-in-paths || exit 80
-
-echo % test issue352
-hg init foo
-cd foo
-
-A=`printf 'he\rllo'`
-
-echo foo > "$A"
-hg add
-hg ci -A -m m
-rm "$A"
-
-echo foo > "hell
-o"
-hg add
-hg ci -A -m m
-
-echo foo > "$A"
-hg debugwalk
-
-# http://mercurial.selenic.com/bts/issue2036
-cd ..
-echo % test issue2039
-
-hg init bar
-cd bar
-
-echo "[extensions]" >> $HGRCPATH
-echo "color=" >> $HGRCPATH
-
-A=`printf 'foo\nbar'`
-B=`printf 'foo\nbar.baz'`
-
-touch "$A"
-touch "$B"
-
-hg status --color=always
-
-exit 0
--- a/tests/test-eolfilename.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-% test issue352
-adding he
llo
-abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
-adding he
llo
-abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
-adding hell
-o
-abort: '\n' and '\r' disallowed in filenames: 'hell\no'
-adding hell
-o
-abort: '\n' and '\r' disallowed in filenames: 'hell\no'
-f  he
llo  he
llo
-f  hell
-o  hell
-o
-% test issue2039
-? foo
-bar
-? foo
-bar.baz
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-eolfilename.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,57 @@
+http://mercurial.selenic.com/bts/issue352
+
+  $ "$TESTDIR/hghave" eol-in-paths || exit 80
+
+test issue352
+
+  $ hg init foo
+  $ cd foo
+  $ A=`printf 'he\rllo'`
+  $ echo foo > "$A"
+  $ hg add
+  adding he
llo
+  abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
+  [255]
+  $ hg ci -A -m m
+  adding he
llo
+  abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
+  [255]
+  $ rm "$A"
+  $ echo foo > "hell
+  > o"
+  $ hg add
+  adding hell
+  o
+  abort: '\n' and '\r' disallowed in filenames: 'hell\no'
+  [255]
+  $ hg ci -A -m m
+  adding hell
+  o
+  abort: '\n' and '\r' disallowed in filenames: 'hell\no'
+  [255]
+  $ echo foo > "$A"
+  $ hg debugwalk
+  f  he
llo  he
llo
+  f  hell
+  o  hell
+  o
+
+http://mercurial.selenic.com/bts/issue2036
+
+  $ cd ..
+
+test issue2039
+
+  $ hg init bar
+  $ cd bar
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "color=" >> $HGRCPATH
+  $ A=`printf 'foo\nbar'`
+  $ B=`printf 'foo\nbar.baz'`
+  $ touch "$A"
+  $ touch "$B"
+  $ hg status --color=always
+  ? foo
+  bar
+  ? foo
+  bar.baz
--- a/tests/test-fetch	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-#!/bin/sh
-
-# adjust to non-default HGPORT, e.g. with run-tests.py -j
-hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; }
-hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; }
-
-echo "[extensions]" >> $HGRCPATH
-echo "fetch=" >> $HGRCPATH
-
-echo % test fetch with default branches only
-hg init a
-echo a > a/a
-hg --cwd a commit -d '1 0' -Ama
-
-hg clone a b
-hg clone a c
-
-echo b > a/b
-hg --cwd a commit -d '2 0' -Amb
-hg --cwd a parents -q
-
-echo % should pull one change
-hg --cwd b fetch ../a
-hg --cwd b parents -q
-
-echo c > c/c
-hg --cwd c commit -d '3 0' -Amc
-
-hg clone c d
-hg clone c e
-
-# We cannot use the default commit message if fetching from a local
-# repo, because the path of the repo will be included in the commit
-# message, making every commit appear different.
-
-echo % should merge c into a
-hg --cwd c fetch -d '4 0' -m 'automated merge' ../a
-ls c
-
-netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN
-hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
-cat a/hg.pid >> "$DAEMON_PIDS"
-
-echo '% fetch over http, no auth'
-hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/ | hideport | hidehash
-hg --cwd d tip --template '{desc}\n' | hideport
-
-echo '% fetch over http with auth (should be hidden in desc)'
-hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/ | hideport | hidehash
-hg --cwd e tip --template '{desc}\n' | hideport
-
-hg clone a f
-hg clone a g
-
-echo f > f/f
-hg --cwd f ci -d '6 0' -Amf
-
-echo g > g/g
-hg --cwd g ci -d '6 0' -Amg
-
-hg clone -q f h
-hg clone -q g i
-
-echo % should merge f into g
-hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f
-
-rm i/g
-echo % should abort, because i is modified
-hg --cwd i fetch ../h
-
-
-echo % test fetch with named branches
-hg init nbase
-echo base > nbase/a
-hg -R nbase ci -d '1 0' -Am base
-hg -R nbase branch a
-echo a > nbase/a
-hg -R nbase ci -d '2 0' -m a
-hg -R nbase up -C 0
-hg -R nbase branch b
-echo b > nbase/b
-hg -R nbase ci -Ad '3 0' -m b
-
-echo
-echo % pull in change on foreign branch
-hg clone nbase n1
-hg clone nbase n2
-hg -R n1 up -C a
-echo aa > n1/a
-hg -R n1 ci -d '4 0' -m a1
-
-hg -R n2 up -C b
-hg -R n2 fetch -d '9 0' -m 'merge' n1
-echo '% parent should be 2 (no automatic update)'
-hg -R n2 parents --template '{rev}\n'
-rm -fr n1 n2
-
-echo
-echo % pull in changes on both foreign and local branches
-hg clone nbase n1
-hg clone nbase n2
-hg -R n1 up -C a
-echo aa > n1/a
-hg -R n1 ci -d '4 0' -m a1
-hg -R n1 up -C b
-echo bb > n1/b
-hg -R n1 ci -d '5 0' -m b1
-
-hg -R n2 up -C b
-hg -R n2 fetch -d '9 0' -m 'merge' n1
-echo '% parent should be 4 (fast forward)'
-hg -R n2 parents --template '{rev}\n'
-rm -fr n1 n2
-
-echo
-echo '% pull changes on foreign (2 new heads) and local (1 new head) branches'
-echo % with a local change
-hg clone nbase n1
-hg clone nbase n2
-hg -R n1 up -C a
-echo a1 > n1/a
-hg -R n1 ci -d '4 0' -m a1
-hg -R n1 up -C b
-echo bb > n1/b
-hg -R n1 ci -d '5 0' -m b1
-hg -R n1 up -C 1
-echo a2 > n1/a
-hg -R n1 ci -d '6 0' -m a2
-
-hg -R n2 up -C b
-echo change >> n2/c
-hg -R n2 ci -Ad '7 0' -m local
-hg -R n2 fetch -d '9 0' -m 'merge' n1
-echo '% parent should be 7 (new merge changeset)'
-hg -R n2 parents --template '{rev}\n'
-rm -fr n1 n2
-
-echo '% pull in changes on foreign (merge of local branch) and local (2 new'
-echo '% heads) with a local change'
-hg clone nbase n1
-hg clone nbase n2
-hg -R n1 up -C a
-hg -R n1 merge b
-hg -R n1 ci -d '4 0' -m merge
-hg -R n1 up -C 2
-echo c > n1/a
-hg -R n1 ci -d '5 0' -m c
-hg -R n1 up -C 2
-echo cc > n1/a
-hg -R n1 ci -d '6 0' -m cc
-
-hg -R n2 up -C b
-echo change >> n2/b
-hg -R n2 ci -Ad '7 0' -m local
-hg -R n2 fetch -d '9 0' -m 'merge' n1
-echo '% parent should be 3 (fetch did not merge anything)'
-hg -R n2 parents --template '{rev}\n'
-rm -fr n1 n2
-
-echo % pull in change on different branch than dirstate
-hg init n1
-echo a > n1/a
-hg -R n1 ci -Am initial
-hg clone n1 n2
-echo b > n1/a
-hg -R n1 ci -m next
-hg -R n2 branch topic
-hg -R n2 fetch -d '0 0' -m merge n1
-echo '% parent should be 0 (fetch did not update or merge anything)'
-hg -R n2 parents --template '{rev}\n'
-rm -fr n1 n2
-
-echo % test fetch with inactive branches
-hg init ib1
-echo a > ib1/a
-hg --cwd ib1 ci -Am base
-hg --cwd ib1 branch second
-echo b > ib1/b
-hg --cwd ib1 ci -Am onsecond
-hg --cwd ib1 branch -f default
-echo c > ib1/c
-hg --cwd ib1 ci -Am newdefault
-hg clone ib1 ib2
-echo % fetch should succeed
-hg --cwd ib2 fetch ../ib1
-rm -fr ib1 ib2
-
-echo % test issue1726
-hg init i1726r1
-echo a > i1726r1/a
-hg --cwd i1726r1 ci -Am base
-hg clone i1726r1 i1726r2
-echo b > i1726r1/a
-hg --cwd i1726r1 ci -m second
-echo c > i1726r2/a
-hg --cwd i1726r2 ci -m third
-HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1 | sed 's/new changeset 3:[0-9a-zA-Z]* /new changeset 3 /'
-hg --cwd i1726r2 heads default --template '{rev}\n'
-
-echo
-echo % test issue2047
-hg -q init i2047a
-cd i2047a
-echo a > a
-hg -q ci -Am a
-hg -q branch stable
-echo b > b
-hg -q ci -Am b
-cd ..
-hg -q clone -r 0 i2047a i2047b
-cd i2047b
-hg fetch ../i2047a
-
-"$TESTDIR/killdaemons.py"
-
-true
--- a/tests/test-fetch.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-% test fetch with default branches only
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding b
-1:97d72e5f12c7
-% should pull one change
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1:97d72e5f12c7
-adding c
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% should merge c into a
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-updating to 2:97d72e5f12c7
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging with 1:5e056962225c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-new changeset 3:cd3a41621cf0 merges remote changes with local
-a
-b
-c
-% fetch over http, no auth
-pulling from http://localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-updating to 2:97d72e5f12c7
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging with 1:5e056962225c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-new changeset 3:... merges remote changes with local
-Automated merge with http://localhost:$HGPORT/
-% fetch over http with auth (should be hidden in desc)
-pulling from http://user:***@localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-updating to 2:97d72e5f12c7
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging with 1:5e056962225c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-new changeset 3:... merges remote changes with local
-Automated merge with http://localhost:$HGPORT/
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding f
-adding g
-% should merge f into g
-pulling from ../f
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging with 3:cc6a3744834d
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-new changeset 4:55aa4f32ec59 merges remote changes with local
-% should abort, because i is modified
-abort: working directory is missing some files
-% test fetch with named branches
-adding a
-marked working directory as branch a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch b
-adding b
-
-% pull in change on foreign branch
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from n1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-% parent should be 2 (no automatic update)
-2
-
-% pull in changes on both foreign and local branches
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from n1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% parent should be 4 (fast forward)
-4
-
-% pull changes on foreign (2 new heads) and local (1 new head) branches
-% with a local change
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding c
-pulling from n1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 2 files (+2 heads)
-updating to 5:708c6cce3d26
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-merging with 3:d83427717b1f
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-new changeset 7:48f1a33f52af merges remote changes with local
-% parent should be 7 (new merge changeset)
-7
-% pull in changes on foreign (merge of local branch) and local (2 new
-% heads) with a local change
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from n1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 2 changes to 1 files (+2 heads)
-not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
-% parent should be 3 (fetch did not merge anything)
-3
-% pull in change on different branch than dirstate
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-marked working directory as branch topic
-abort: working dir not at branch tip (use "hg update" to check out branch tip)
-% parent should be 0 (fetch did not update or merge anything)
-0
-% test fetch with inactive branches
-adding a
-marked working directory as branch second
-adding b
-marked working directory as branch default
-adding c
-created new head
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% fetch should succeed
-pulling from ../ib1
-searching for changes
-no changes found
-% test issue1726
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../i1726r1
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-updating to 2:7837755a2789
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-merging with 1:d1f0c6c48ebd
-merging a
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-new changeset 3 merges remote changes with local
-3
-
-% test issue2047
-pulling from ../i2047a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-fetch.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,417 @@
+adjust to non-default HGPORT, e.g. with run-tests.py -j
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "fetch=" >> $HGRCPATH
+
+test fetch with default branches only
+
+  $ hg init a
+  $ echo a > a/a
+  $ hg --cwd a commit -d '1 0' -Ama
+  adding a
+  $ hg clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone a c
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > a/b
+  $ hg --cwd a commit -d '2 0' -Amb
+  adding b
+  $ hg --cwd a parents -q
+  1:97d72e5f12c7
+
+should pull one change
+
+  $ hg --cwd b fetch ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd b parents -q
+  1:97d72e5f12c7
+  $ echo c > c/c
+  $ hg --cwd c commit -d '3 0' -Amc
+  adding c
+  $ hg clone c d
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone c e
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+We cannot use the default commit message if fetching from a local
+repo, because the path of the repo will be included in the commit
+message, making every commit appear different.
+should merge c into a
+
+  $ hg --cwd c fetch -d '4 0' -m 'automated merge' ../a
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  updating to 2:97d72e5f12c7
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  merging with 1:5e056962225c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  new changeset 3:cd3a41621cf0 merges remote changes with local
+  $ ls c
+  a
+  b
+  c
+  $ netstat -tnap 2>/dev/null | grep $HGPORT | grep LISTEN
+  [1]
+  $ hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
+  $ cat a/hg.pid >> "$DAEMON_PIDS"
+
+fetch over http, no auth
+
+  $ hg --cwd d fetch -d '5 0' http://localhost:$HGPORT/
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  updating to 2:97d72e5f12c7
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  merging with 1:5e056962225c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  new changeset 3:* merges remote changes with local (glob)
+  $ hg --cwd d tip --template '{desc}\n'
+  Automated merge with http://localhost:*/ (glob)
+
+fetch over http with auth (should be hidden in desc)
+
+  $ hg --cwd e fetch -d '5 0' http://user:password@localhost:$HGPORT/
+  pulling from http://user:***@localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  updating to 2:97d72e5f12c7
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  merging with 1:5e056962225c
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  new changeset 3:* merges remote changes with local (glob)
+  $ hg --cwd e tip --template '{desc}\n'
+  Automated merge with http://localhost:*/ (glob)
+  $ hg clone a f
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone a g
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo f > f/f
+  $ hg --cwd f ci -d '6 0' -Amf
+  adding f
+  $ echo g > g/g
+  $ hg --cwd g ci -d '6 0' -Amg
+  adding g
+  $ hg clone -q f h
+  $ hg clone -q g i
+
+should merge f into g
+
+  $ hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f
+  pulling from ../f
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  merging with 3:cc6a3744834d
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  new changeset 4:55aa4f32ec59 merges remote changes with local
+  $ rm i/g
+
+should abort, because i is modified
+
+  $ hg --cwd i fetch ../h
+  abort: working directory is missing some files
+  [255]
+
+test fetch with named branches
+
+  $ hg init nbase
+  $ echo base > nbase/a
+  $ hg -R nbase ci -d '1 0' -Am base
+  adding a
+  $ hg -R nbase branch a
+  marked working directory as branch a
+  $ echo a > nbase/a
+  $ hg -R nbase ci -d '2 0' -m a
+  $ hg -R nbase up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R nbase branch b
+  marked working directory as branch b
+  $ echo b > nbase/b
+  $ hg -R nbase ci -Ad '3 0' -m b
+  adding b
+  $ echo
+  
+
+pull in change on foreign branch
+
+  $ hg clone nbase n1
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone nbase n2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n1 up -C a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo aa > n1/a
+  $ hg -R n1 ci -d '4 0' -m a1
+  $ hg -R n2 up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
+  pulling from n1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+parent should be 2 (no automatic update)
+
+  $ hg -R n2 parents --template '{rev}\n'
+  2
+  $ rm -fr n1 n2
+  $ echo
+  
+
+pull in changes on both foreign and local branches
+
+  $ hg clone nbase n1
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone nbase n2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n1 up -C a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo aa > n1/a
+  $ hg -R n1 ci -d '4 0' -m a1
+  $ hg -R n1 up -C b
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo bb > n1/b
+  $ hg -R n1 ci -d '5 0' -m b1
+  $ hg -R n2 up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
+  pulling from n1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+parent should be 4 (fast forward)
+
+  $ hg -R n2 parents --template '{rev}\n'
+  4
+  $ rm -fr n1 n2
+  $ echo
+  
+
+pull changes on foreign (2 new heads) and local (1 new head) branches
+with a local change
+
+  $ hg clone nbase n1
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone nbase n2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n1 up -C a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a1 > n1/a
+  $ hg -R n1 ci -d '4 0' -m a1
+  $ hg -R n1 up -C b
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo bb > n1/b
+  $ hg -R n1 ci -d '5 0' -m b1
+  $ hg -R n1 up -C 1
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo a2 > n1/a
+  $ hg -R n1 ci -d '6 0' -m a2
+  created new head
+  $ hg -R n2 up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo change >> n2/c
+  $ hg -R n2 ci -Ad '7 0' -m local
+  adding c
+  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
+  pulling from n1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 2 files (+2 heads)
+  updating to 5:708c6cce3d26
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  merging with 3:d83427717b1f
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  new changeset 7:48f1a33f52af merges remote changes with local
+
+parent should be 7 (new merge changeset)
+
+  $ hg -R n2 parents --template '{rev}\n'
+  7
+  $ rm -fr n1 n2
+
+pull in changes on foreign (merge of local branch) and local (2 new
+heads) with a local change
+
+  $ hg clone nbase n1
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg clone nbase n2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n1 up -C a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R n1 merge b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg -R n1 ci -d '4 0' -m merge
+  $ hg -R n1 up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo c > n1/a
+  $ hg -R n1 ci -d '5 0' -m c
+  $ hg -R n1 up -C 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo cc > n1/a
+  $ hg -R n1 ci -d '6 0' -m cc
+  created new head
+  $ hg -R n2 up -C b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo change >> n2/b
+  $ hg -R n2 ci -Ad '7 0' -m local
+  $ hg -R n2 fetch -d '9 0' -m 'merge' n1
+  pulling from n1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 2 changes to 1 files (+2 heads)
+  not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them)
+
+parent should be 3 (fetch did not merge anything)
+
+  $ hg -R n2 parents --template '{rev}\n'
+  3
+  $ rm -fr n1 n2
+
+pull in change on different branch than dirstate
+
+  $ hg init n1
+  $ echo a > n1/a
+  $ hg -R n1 ci -Am initial
+  adding a
+  $ hg clone n1 n2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > n1/a
+  $ hg -R n1 ci -m next
+  $ hg -R n2 branch topic
+  marked working directory as branch topic
+  $ hg -R n2 fetch -d '0 0' -m merge n1
+  abort: working dir not at branch tip (use "hg update" to check out branch tip)
+  [255]
+
+parent should be 0 (fetch did not update or merge anything)
+
+  $ hg -R n2 parents --template '{rev}\n'
+  0
+  $ rm -fr n1 n2
+
+test fetch with inactive branches
+
+  $ hg init ib1
+  $ echo a > ib1/a
+  $ hg --cwd ib1 ci -Am base
+  adding a
+  $ hg --cwd ib1 branch second
+  marked working directory as branch second
+  $ echo b > ib1/b
+  $ hg --cwd ib1 ci -Am onsecond
+  adding b
+  $ hg --cwd ib1 branch -f default
+  marked working directory as branch default
+  $ echo c > ib1/c
+  $ hg --cwd ib1 ci -Am newdefault
+  adding c
+  created new head
+  $ hg clone ib1 ib2
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+fetch should succeed
+
+  $ hg --cwd ib2 fetch ../ib1
+  pulling from ../ib1
+  searching for changes
+  no changes found
+  $ rm -fr ib1 ib2
+
+test issue1726
+
+  $ hg init i1726r1
+  $ echo a > i1726r1/a
+  $ hg --cwd i1726r1 ci -Am base
+  adding a
+  $ hg clone i1726r1 i1726r2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo b > i1726r1/a
+  $ hg --cwd i1726r1 ci -m second
+  $ echo c > i1726r2/a
+  $ hg --cwd i1726r2 ci -m third
+  $ HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1
+  pulling from ../i1726r1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  updating to 2:7837755a2789
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  merging with 1:d1f0c6c48ebd
+  merging a
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  new changeset 3:* merges remote changes with local (glob)
+  $ hg --cwd i1726r2 heads default --template '{rev}\n'
+  3
+  $ echo
+  
+
+test issue2047
+
+  $ hg -q init i2047a
+  $ cd i2047a
+  $ echo a > a
+  $ hg -q ci -Am a
+  $ hg -q branch stable
+  $ echo b > b
+  $ hg -q ci -Am b
+  $ cd ..
+  $ hg -q clone -r 0 i2047a i2047b
+  $ cd i2047b
+  $ hg fetch ../i2047a
+  pulling from ../i2047a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  $ "$TESTDIR/killdaemons.py"
--- a/tests/test-gendoc	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" docutils || exit 80
-
-HGENCODING=UTF-8
-export HGENCODING
-
-for PO in C $TESTDIR/../i18n/*.po; do
-    LOCALE=`basename $PO .po`
-    echo
-    echo "% extracting documentation from $LOCALE"
-    echo ".. -*- coding: utf-8 -*-" > gendoc-$LOCALE.txt
-    echo "" >> gendoc-$LOCALE.txt
-    LC_ALL=$LOCALE python $TESTDIR/../doc/gendoc.py >> gendoc-$LOCALE.txt 2> /dev/null || exit
-
-    # We call runrst without adding "--halt warning" to make it report
-    # all errors instead of stopping on the first one.
-    echo "checking for parse errors"
-    python $TESTDIR/../doc/runrst html gendoc-$LOCALE.txt /dev/null
-done
--- a/tests/test-gendoc.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-
-% extracting documentation from C
-checking for parse errors
-
-% extracting documentation from da
-checking for parse errors
-
-% extracting documentation from de
-checking for parse errors
-
-% extracting documentation from el
-checking for parse errors
-
-% extracting documentation from fr
-checking for parse errors
-
-% extracting documentation from it
-checking for parse errors
-
-% extracting documentation from ja
-checking for parse errors
-
-% extracting documentation from pt_BR
-checking for parse errors
-
-% extracting documentation from ro
-checking for parse errors
-
-% extracting documentation from sv
-checking for parse errors
-
-% extracting documentation from zh_CN
-checking for parse errors
-
-% extracting documentation from zh_TW
-checking for parse errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-gendoc.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,54 @@
+Test document extraction
+
+  $ "$TESTDIR/hghave" docutils || exit 80
+  $ HGENCODING=UTF-8
+  $ export HGENCODING
+  $ for PO in C $TESTDIR/../i18n/*.po; do
+  >     LOCALE=`basename $PO .po`
+  >     echo
+  >     echo "% extracting documentation from $LOCALE"
+  >     echo ".. -*- coding: utf-8 -*-" > gendoc-$LOCALE.txt
+  >     echo "" >> gendoc-$LOCALE.txt
+  >     LC_ALL=$LOCALE python $TESTDIR/../doc/gendoc.py >> gendoc-$LOCALE.txt 2> /dev/null || exit
+  > 
+  >     # We call runrst without adding "--halt warning" to make it report
+  >     # all errors instead of stopping on the first one.
+  >     echo "checking for parse errors"
+  >     python $TESTDIR/../doc/runrst html gendoc-$LOCALE.txt /dev/null
+  > done
+  
+  % extracting documentation from C
+  checking for parse errors
+  
+  % extracting documentation from da
+  checking for parse errors
+  
+  % extracting documentation from de
+  checking for parse errors
+  
+  % extracting documentation from el
+  checking for parse errors
+  
+  % extracting documentation from fr
+  checking for parse errors
+  
+  % extracting documentation from it
+  checking for parse errors
+  
+  % extracting documentation from ja
+  checking for parse errors
+  
+  % extracting documentation from pt_BR
+  checking for parse errors
+  
+  % extracting documentation from ro
+  checking for parse errors
+  
+  % extracting documentation from sv
+  checking for parse errors
+  
+  % extracting documentation from zh_CN
+  checking for parse errors
+  
+  % extracting documentation from zh_TW
+  checking for parse errors
--- a/tests/test-gpg	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" gpg || exit 80
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-gpg=
-
-[gpg]
-cmd=gpg --no-permission-warning --no-secmem-warning --homedir $TESTDIR/gpg
-EOF
-
-hg init r
-cd r
-echo foo > foo
-hg ci -Amfoo
-
-echo '% no signatures'
-hg sigs
-
-echo '% hg sign 0'
-hg sign 0
-
-echo '% hg sigs'
-hg sigs
-
-echo '% hg sigcheck 0'
-hg sigcheck 0
--- a/tests/test-gpg.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding foo
-% no signatures
-% hg sign 0
-Signing 0:e63c23eaa88a
-% hg sigs
-hgtest                             0:e63c23eaa88ae77967edcf4ea194d31167c478b0
-% hg sigcheck 0
-e63c23eaa88a is signed by:
- hgtest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-gpg.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,27 @@
+Test the GPG extension
+
+  $ "$TESTDIR/hghave" gpg || exit 80
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > gpg=
+  > 
+  > [gpg]
+  > cmd=gpg --no-permission-warning --no-secmem-warning --homedir $TESTDIR/gpg
+  > EOF
+  $ hg init r
+  $ cd r
+  $ echo foo > foo
+  $ hg ci -Amfoo
+  adding foo
+
+  $ hg sigs
+
+  $ hg sign 0
+  Signing 0:e63c23eaa88a
+
+  $ hg sigs
+  hgtest                             0:e63c23eaa88ae77967edcf4ea194d31167c478b0
+
+  $ hg sigcheck 0
+  e63c23eaa88a is signed by:
+   hgtest
--- a/tests/test-hgcia	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-cat >> $HGRCPATH <<EOF
-[extensions]
-hgcia=
-
-[hooks]
-changegroup.cia = python:hgext.hgcia.hook
-
-[cia]
-user = testuser
-project = testproject
-test = True
-EOF
-
-hg init src
-hg init cia
-
-cd src
-echo foo > foo
-hg ci -Amfoo
-
-hg push ../cia
--- a/tests/test-hgcia.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-adding foo
-pushing to ../cia
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-
-<message>
-  <generator>
-    <name>Mercurial (hgcia)</name>
-    <version>0.1</version>
-    <url>http://hg.kublai.com/mercurial/hgcia</url>
-    <user>testuser</user>
-  </generator>
-  <source>
-<project>testproject</project>
-<branch>default</branch>
-</source>
-  <body>
-    <commit>
-      <author>test</author>
-      <version>0:e63c23eaa88a</version>
-      <log>foo</log>
-      
-      <files><file action="add">foo</file></files>
-    </commit>
-  </body>
-  <timestamp>0</timestamp>
-</message>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgcia.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,51 @@
+Test the CIA extension
+
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > hgcia=
+  > 
+  > [hooks]
+  > changegroup.cia = python:hgext.hgcia.hook
+  > 
+  > [cia]
+  > user = testuser
+  > project = testproject
+  > test = True
+  > EOF
+
+  $ hg init src
+  $ hg init cia
+  $ cd src
+  $ echo foo > foo
+  $ hg ci -Amfoo
+  adding foo
+  $ hg push ../cia
+  pushing to ../cia
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  
+  <message>
+    <generator>
+      <name>Mercurial (hgcia)</name>
+      <version>0.1</version>
+      <url>http://hg.kublai.com/mercurial/hgcia</url>
+      <user>testuser</user>
+    </generator>
+    <source>
+  <project>testproject</project>
+  <branch>default</branch>
+  </source>
+    <body>
+      <commit>
+        <author>test</author>
+        <version>0:e63c23eaa88a</version>
+        <log>foo</log>
+        
+        <files><file action="add">foo</file></files>
+      </commit>
+    </body>
+    <timestamp>0</timestamp>
+  </message>
--- a/tests/test-hghave	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#!/bin/sh
-# Testing that hghave does not crash when checking features
-
-"$TESTDIR/hghave" --test-features 2>/dev/null
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hghave.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,3 @@
+Testing that hghave does not crash when checking features
+
+  $ "$TESTDIR/hghave" --test-features 2>/dev/null
--- a/tests/test-hgk	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "hgk=" >> $HGRCPATH
-
-hg init repo
-cd repo
-echo a > a
-hg ci -Am adda
-hg debug-cat-file commit 0
-
--- a/tests/test-hgk.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-adding a
-tree a0c8bcbbb45c
-parent 000000000000
-author test 0 0
-committer test 0 0
-revision 0
-branch default
-
-adda
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgk.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,18 @@
+Minimal hgk check
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "hgk=" >> $HGRCPATH
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -Am adda
+  adding a
+  $ hg debug-cat-file commit 0
+  tree a0c8bcbbb45c
+  parent 000000000000
+  author test 0 0
+  committer test 0 0
+  revision 0
+  branch default
+  
+  adda
--- a/tests/test-hgweb	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-# Some tests for hgweb. Tests static files, plain files and different 404's.
-
-hg init test
-cd test
-mkdir da
-echo foo > da/foo
-echo foo > foo
-hg ci -Ambase
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % manifest
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw')
-
-echo % plain file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?style=raw'
-
-echo % should give a 404 - static file that does not exist
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/bogus'
-
-echo % should give a 404 - bad revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/spam/foo?style=raw'
-
-echo % should give a 400 - bad command
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?cmd=spam&style=raw' | sed 's/400.*/400/'
-
-echo % should give a 404 - file does not exist
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/bork?style=raw'
-
-echo % try bad style
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=foobar')
-
-echo % stop and restart
-"$TESTDIR/killdaemons.py"
-hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
-cat hg.pid >> $DAEMON_PIDS
-# Test the access/error files are opened in append mode
-python -c "print len(file('access.log').readlines()), 'log lines written'"
-
-echo % static file
-"$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT '/static/style-gitweb.css'
-
-echo % errors
-cat errors.log
--- a/tests/test-hgweb-commands	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#!/bin/sh
-# An attempt at more fully testing the hgweb web interface.
-# The following things are tested elsewhere and are therefore omitted:
-# - archive, tested in test-archive
-# - unbundle, tested in test-push-http
-# - changegroupsubset, tested in test-pull
-
-echo % Set up the repo
-hg init test
-cd test
-mkdir da
-echo foo > da/foo
-echo foo > foo
-hg ci -Ambase
-hg tag 1.0
-echo another > foo
-hg branch stable
-hg ci -Ambranch
-hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % Logs and changes
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/foo/?style=atom' | sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/shortlog/'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/0/'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/1/?style=raw'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log?rev=base'
-
-echo % File-related
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo/?style=raw'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/annotate/1/foo/?style=raw'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/?style=raw'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw'
-
-echo % Overviews
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-tags'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-branches'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb'
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/?style=gitweb'
-
-echo % capabilities
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'
-echo % heads
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
-echo % lookup
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=lookup&key=1'
-echo % branches
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
-echo % changegroup
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
-    | $TESTDIR/printrepr.py
-echo % stream_out
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
-echo % failing unbundle, requires POST request
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle'
-
-echo % Static files
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
-
-echo % Stop and restart with HGENCODING=cp932
-"$TESTDIR/killdaemons.py"
-HGENCODING=cp932 hg serve --config server.uncompressed=False -n test \
-    -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-# commit message with Japanese Kanji 'Noh', which ends with '\x5c'
-echo foo >> foo
-HGENCODING=cp932 hg ci -m `python -c 'print("\x94\x5c")'`
-
-echo % Graph json escape of multibyte character
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/' \
-    | grep '^var data ='
-
-echo % ERRORS ENCOUNTERED
-cat errors.log
--- a/tests/test-hgweb-commands.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,988 +0,0 @@
-% Set up the repo
-adding da/foo
-adding foo
-marked working directory as branch stable
-% Logs and changes
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://127.0.0.1/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/</id>
- <link rel="self" href="http://127.0.0.1/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/"/>
- <title>test Changelog</title>
- <updated>1970-01-01T00:00:00+00:00</updated>
-
- <entry>
-  <title>branch</title>
-  <id>http://127.0.0.1/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id>
-  <link href="http://127.0.0.1/rev/1d22e65f027e"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">branch</pre>
-   </div>
-  </content>
- </entry>
- <entry>
-  <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
-  <id>http://127.0.0.1/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id>
-  <link href="http://127.0.0.1/rev/a4f92ed23982"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
-   </div>
-  </content>
- </entry>
- <entry>
-  <title>base</title>
-  <id>http://127.0.0.1/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id>
-  <link href="http://127.0.0.1/rev/2ef0ac749a14"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">base</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://127.0.0.1/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/</id>
- <link rel="self" href="http://127.0.0.1/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/"/>
- <title>test Changelog</title>
- <updated>1970-01-01T00:00:00+00:00</updated>
-
- <entry>
-  <title>branch</title>
-  <id>http://127.0.0.1/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id>
-  <link href="http://127.0.0.1/rev/1d22e65f027e"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">branch</pre>
-   </div>
-  </content>
- </entry>
- <entry>
-  <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
-  <id>http://127.0.0.1/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id>
-  <link href="http://127.0.0.1/rev/a4f92ed23982"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
-   </div>
-  </content>
- </entry>
- <entry>
-  <title>base</title>
-  <id>http://127.0.0.1/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id>
-  <link href="http://127.0.0.1/rev/2ef0ac749a14"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">base</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://127.0.0.1/2005/Atom">
- <id>http://127.0.0.1/atom-log/tip/foo</id>
- <link rel="self" href="http://127.0.0.1/atom-log/tip/foo"/>
- <title>test: foo history</title>
- <updated>1970-01-01T00:00:00+00:00</updated>
-
- <entry>
-  <title>base</title>
-  <id>http://127.0.0.1/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id>
-  <link href="http://127.0.0.1/rev/2ef0ac749a14"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">base</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
-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: log</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test" />
-</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 class="active">log</li>
-<li><a href="/graph/1d22e65f027e">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/1d22e65f027e">changeset</a></li>
-<li><a href="/file/1d22e65f027e">browse</a></li>
-</ul>
-<ul>
-
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log</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>
-
-<div class="navigate">
-<a href="/shortlog/2?revcount=30">less</a>
-<a href="/shortlog/2?revcount=120">more</a>
-| rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
- </tr>
- <tr class="parity1">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/shortlog/2?revcount=30">less</a>
-<a href="/shortlog/2?revcount=120">more</a>
-| rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-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: 2ef0ac749a14</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/2ef0ac749a14">log</a></li>
- <li><a href="/graph/2ef0ac749a14">graph</a></li>
- <li><a href="/tags">tags</a></li>
- <li><a href="/branches">branches</a></li>
-</ul>
-<ul>
- <li class="active">changeset</li>
- <li><a href="/raw-rev/2ef0ac749a14">raw</a></li>
- <li><a href="/file/2ef0ac749a14">browse</a></li>
-</ul>
-<ul>
- 
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>changeset 0:2ef0ac749a14  <span class="tag">1.0</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>
-
-<div class="description">base</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"> <a href="/rev/a4f92ed23982">a4f92ed23982</a></td>
-</tr>
-<tr>
- <th class="files">files</th>
- <td class="files"><a href="/file/2ef0ac749a14/da/foo">da/foo</a> <a href="/file/2ef0ac749a14/foo">foo</a> </td>
-</tr>
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/da/foo	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+foo
-</span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l2.2" id="l2.2">     2.2</a> <span class="plusline">+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l2.3" id="l2.3">     2.3</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l2.4" id="l2.4">     2.4</a> <span class="plusline">+foo
-</span></pre></div>
-</div>
-
-</div>
-</div>
-
-
-</body>
-</html>
-
-200 Script output follows
-
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de
-# Parent  2ef0ac749a14e4f57a5a822464a0902c6f7f448f
-Added tag 1.0 for changeset 2ef0ac749a14
-
-diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0
-
-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: searching for base</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<div class="logo">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
-</div>
-<ul>
-<li><a href="/shortlog">log</a></li>
-<li><a href="/graph">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>searching for 'base'</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>
-
-<div class="navigate">
-<a href="/search/?rev=base&revcount=5">less</a>
-<a href="/search/?rev=base&revcount=20">more</a>
-</div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/search/?rev=base&revcount=5">less</a>
-<a href="/search/?rev=base&revcount=20">more</a>
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% File-related
-200 Script output follows
-
-foo
-200 Script output follows
-
-
-test@0: foo
-
-
-
-
-200 Script output follows
-
-
-drwxr-xr-x da
--rw-r--r-- 45 .hgtags
--rw-r--r-- 4 foo
-
-
-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: a4f92ed23982 foo</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/a4f92ed23982">log</a></li>
-<li><a href="/graph/a4f92ed23982">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/a4f92ed23982">changeset</a></li>
-<li><a href="/file/a4f92ed23982/">browse</a></li>
-</ul>
-<ul>
-<li class="active">file</li>
-<li><a href="/file/tip/foo">latest</a></li>
-<li><a href="/diff/a4f92ed23982/foo">diff</a></li>
-<li><a href="/annotate/a4f92ed23982/foo">annotate</a></li>
-<li><a href="/log/a4f92ed23982/foo">file log</a></li>
-<li><a href="/raw-file/a4f92ed23982/foo">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>view foo @ 1:a4f92ed23982</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>
-
-<div class="description">Added tag 1.0 for changeset 2ef0ac749a14</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"><a href="/file/1d22e65f027e/foo">1d22e65f027e</a> </td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<div class="sourcefirst"> line source</div>
-
-<div class="parity0 source"><a href="#l1" id="l1">     1</a> foo
-</div>
-<div class="sourcelast"></div>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-200 Script output follows
-
-
-diff -r 000000000000 -r a4f92ed23982 foo
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+foo
-
-
-
-
-% Overviews
-200 Script output follows
-
-tip	1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
-1.0	2ef0ac749a14e4f57a5a822464a0902c6f7f448f
-200 Script output follows
-
-stable	1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe	open
-default	a4f92ed23982be056b9852de5dfe873eaac7f0de	inactive
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" 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-gitweb.css" type="text/css" />
-
-
-<title>test: Summary</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test"/>
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test"/>
-</head>
-<body>
-
-<div class="page_header">
-<a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / summary
-
-<form action="/log">
-<input type="hidden" name="style" value="gitweb" />
-<div class="search">
-<input type="text" name="rev"  />
-</div>
-</form>
-</div>
-
-<div class="page_nav">
-summary |
-<a href="/shortlog?style=gitweb">shortlog</a> |
-<a href="/log?style=gitweb">changelog</a> |
-<a href="/graph?style=gitweb">graph</a> |
-<a href="/tags?style=gitweb">tags</a> |
-<a href="/branches?style=gitweb">branches</a> |
-<a href="/file/1d22e65f027e?style=gitweb">files</a>
-<br/>
-</div>
-
-<div class="title">&nbsp;</div>
-<table cellspacing="0">
-<tr><td>description</td><td>unknown</td></tr>
-<tr><td>owner</td><td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td></tr>
-<tr><td>last change</td><td>Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
-</table>
-
-<div><a  class="title" href="/shortlog?style=gitweb">changes</a></div>
-<table cellspacing="0">
-
-<tr class="parity0">
-<td class="age"><i>1970-01-01</i></td>
-<td><i>test</i></td>
-<td>
-<a class="list" href="/rev/1d22e65f027e?style=gitweb">
-<b>branch</b>
-<span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> </span>
-</a>
-</td>
-<td class="link" nowrap>
-<a href="/rev/1d22e65f027e?style=gitweb">changeset</a> |
-<a href="/file/1d22e65f027e?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="parity1">
-<td class="age"><i>1970-01-01</i></td>
-<td><i>test</i></td>
-<td>
-<a class="list" href="/rev/a4f92ed23982?style=gitweb">
-<b>Added tag 1.0 for changeset 2ef0ac749a14</b>
-<span class="logtags"><span class="branchtag" title="default">default</span> </span>
-</a>
-</td>
-<td class="link" nowrap>
-<a href="/rev/a4f92ed23982?style=gitweb">changeset</a> |
-<a href="/file/a4f92ed23982?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="parity0">
-<td class="age"><i>1970-01-01</i></td>
-<td><i>test</i></td>
-<td>
-<a class="list" href="/rev/2ef0ac749a14?style=gitweb">
-<b>base</b>
-<span class="logtags"><span class="tagtag" title="1.0">1.0</span> </span>
-</a>
-</td>
-<td class="link" nowrap>
-<a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
-<a href="/file/2ef0ac749a14?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="light"><td colspan="4"><a class="list" href="/shortlog?style=gitweb">...</a></td></tr>
-</table>
-
-<div><a class="title" href="/tags?style=gitweb">tags</a></div>
-<table cellspacing="0">
-
-<tr class="parity0">
-<td class="age"><i>1970-01-01</i></td>
-<td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
-<td class="link">
-<a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
-<a href="/log/2ef0ac749a14?style=gitweb">changelog</a> |
-<a href="/file/2ef0ac749a14?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="light"><td colspan="3"><a class="list" href="/tags?style=gitweb">...</a></td></tr>
-</table>
-
-<div><a class="title" href="#">branches</a></div>
-<table cellspacing="0">
-
-<tr class="parity0">
-<td class="age"><i>1970-01-01</i></td>
-<td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
-<td class="">stable</td>
-<td class="link">
-<a href="/changeset/1d22e65f027e?style=gitweb">changeset</a> |
-<a href="/log/1d22e65f027e?style=gitweb">changelog</a> |
-<a href="/file/1d22e65f027e?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="parity1">
-<td class="age"><i>1970-01-01</i></td>
-<td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
-<td class="">default</td>
-<td class="link">
-<a href="/changeset/a4f92ed23982?style=gitweb">changeset</a> |
-<a href="/log/a4f92ed23982?style=gitweb">changelog</a> |
-<a href="/file/a4f92ed23982?style=gitweb">files</a>
-</td>
-</tr>
-<tr class="light">
-  <td colspan="4"><a class="list"  href="#">...</a></td>
-</tr>
-</table>
-<div class="page_footer">
-<div class="page_footer_text">test</div>
-<div class="rss_logo">
-<a href="/rss-log">RSS</a>
-<a href="/atom-log">Atom</a>
-</div>
-<br />
-
-</div>
-</body>
-</html>
-
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" 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-gitweb.css" type="text/css" />
-
-
-<title>test: Graph</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test"/>
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test"/>
-<!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
-</head>
-<body>
-
-<div class="page_header">
-<a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / graph
-</div>
-
-<form action="/log">
-<input type="hidden" name="style" value="gitweb" />
-<div class="search">
-<input type="text" name="rev"  />
-</div>
-</form>
-<div class="page_nav">
-<a href="/summary?style=gitweb">summary</a> |
-<a href="/shortlog?style=gitweb">shortlog</a> |
-<a href="/log/2?style=gitweb">changelog</a> |
-graph |
-<a href="/tags?style=gitweb">tags</a> |
-<a href="/branches?style=gitweb">branches</a> |
-<a href="/file/1d22e65f027e?style=gitweb">files</a>
-<br/>
-<a href="/graph/2?style=gitweb&revcount=30">less</a>
-<a href="/graph/2?style=gitweb&revcount=120">more</a>
-| <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
-</div>
-
-<div class="title">&nbsp;</div>
-
-<noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
-
-<div id="wrapper">
-<ul id="nodebgs"></ul>
-<canvas id="graph" width="224" height="129"></canvas>
-<ul id="graphnodes"></ul>
-</div>
-
-<script type="text/javascript" src="/static/graph.js"></script>
-<script>
-<!-- hide script content
-
-var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
-var graph = new Graph();
-graph.scale(39);
-
-graph.edge = function(x0, y0, x1, y1, color) {
-	
-	this.setColor(color, 0.0, 0.65);
-	this.ctx.beginPath();
-	this.ctx.moveTo(x0, y0);
-	this.ctx.lineTo(x1, y1);
-	this.ctx.stroke();
-	
-}
-
-var revlink = '<li style="_STYLE"><span class="desc">';
-revlink += '<a class="list" href="/rev/_NODEID?style=gitweb" title="_NODEID"><b>_DESC</b></a>';
-revlink += '</span> _TAGS';
-revlink += '<span class="info">_DATE, by _USER</span></li>';
-
-graph.vertex = function(x, y, color, parity, cur) {
-	
-	this.ctx.beginPath();
-	color = this.setColor(color, 0.25, 0.75);
-	this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
-	this.ctx.fill();
-	
-	var bg = '<li class="bg parity' + parity + '"></li>';
-	var left = (this.columns + 1) * this.bg_height;
-	var nstyle = 'padding-left: ' + left + 'px;';
-	var item = revlink.replace(/_STYLE/, nstyle);
-	item = item.replace(/_PARITY/, 'parity' + parity);
-	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
-	item = item.replace(/_USER/, cur[4]);
-	item = item.replace(/_DATE/, cur[5]);
-	
-	var tagspan = '';
-	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
-		tagspan = '<span class="logtags">';
-		if (cur[6][1]) {
-			tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
-			tagspan += cur[6][0] + '</span> ';
-		} else if (!cur[6][1] && cur[6][0] != 'default') {
-			tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
-			tagspan += cur[6][0] + '</span> ';
-		}
-		if (cur[7].length) {
-			for (var t in cur[7]) {
-				var tag = cur[7][t];
-				tagspan += '<span class="tagtag">' + tag + '</span> ';
-			}
-		}
-		tagspan += '</span>';
-	}
-	
-	item = item.replace(/_TAGS/, tagspan);
-	return [bg, item];
-	
-}
-
-graph.render(data);
-
-// stop hiding script -->
-</script>
-
-<div class="page_nav">
-<a href="/graph/2?style=gitweb&revcount=30">less</a>
-<a href="/graph/2?style=gitweb&revcount=120">more</a>
-| <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> 
-</div>
-
-<div class="page_footer">
-<div class="page_footer_text">test</div>
-<div class="rss_logo">
-<a href="/rss-log">RSS</a>
-<a href="/atom-log">Atom</a>
-</div>
-<br />
-
-</div>
-</body>
-</html>
-
-% capabilities
-200 Script output follows
-
-lookup changegroupsubset branchmap pushkey unbundle=HG10GZ,HG10BZ,HG10UN% heads
-200 Script output follows
-
-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
-% lookup
-200 Script output follows
-
-1 a4f92ed23982be056b9852de5dfe873eaac7f0de
-% branches
-200 Script output follows
-
-0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
-% changegroup
-200 Script output follows
-
-x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82
-4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\
-\xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee\t\xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk
-\xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3\'\x859
-\xa8\x80\x84S \xa5\xbd-g\x13`\xe4\xdc\xc3H^\xdf\xe2\xc0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf\'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00\t_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc
-% stream_out
-200 Script output follows
-
-1
-% failing unbundle, requires POST request
-405 push requires POST request
-
-0
-push requires POST request
-% Static files
-200 Script output follows
-
-a { text-decoration:none; }
-.age { white-space:nowrap; }
-.date { white-space:nowrap; }
-.indexlinks { white-space:nowrap; }
-.parity0 { background-color: #ddd; }
-.parity1 { background-color: #eee; }
-.lineno { width: 60px; color: #aaa; font-size: smaller;
-          text-align: right; }
-.plusline { color: green; }
-.minusline { color: red; }
-.atline { color: purple; }
-.annotate { font-size: smaller; text-align: right; padding-right: 1em; }
-.buttons a {
-  background-color: #666;
-  padding: 2pt;
-  color: white;
-  font-family: sans;
-  font-weight: bold;
-}
-.navigate a {
-  background-color: #ccc;
-  padding: 2pt;
-  font-family: sans;
-  color: black;
-}
-
-.metatag {
-  background-color: #888;
-  color: white;
-  text-align: right;
-}
-
-/* Common */
-pre { margin: 0; }
-
-.logo {
-  float: right;
-  clear: right;
-}
-
-/* Changelog/Filelog entries */
-.logEntry { width: 100%; }
-.logEntry .age { width: 15%; }
-.logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
-.logEntry th.age, .logEntry th.firstline { font-weight: bold; }
-.logEntry th.firstline { text-align: left; width: inherit; }
-
-/* Shortlog entries */
-.slogEntry { width: 100%; }
-.slogEntry .age { width: 8em; }
-.slogEntry td { font-weight: normal; text-align: left; vertical-align: top; }
-.slogEntry td.author { width: 15em; }
-
-/* Tag entries */
-#tagEntries { list-style: none; margin: 0; padding: 0; }
-#tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; }
-
-/* Changeset entry */
-#changesetEntry { }
-#changesetEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
-#changesetEntry th.files, #changesetEntry th.description { vertical-align: top; }
-
-/* File diff view */
-#filediffEntry { }
-#filediffEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
-
-/* Graph */
-div#wrapper {
-	position: relative;
-	margin: 0;
-	padding: 0;
-}
-
-canvas {
-	position: absolute;
-	z-index: 5;
-	top: -0.6em;
-	margin: 0;
-}
-
-ul#nodebgs {
-	list-style: none inside none;
-	padding: 0;
-	margin: 0;
-	top: -0.7em;
-}
-
-ul#graphnodes li, ul#nodebgs li {
-	height: 39px;
-}
-
-ul#graphnodes {
-	position: absolute;
-	z-index: 10;
-	top: -0.85em;
-	list-style: none inside none;
-	padding: 0;
-}
-
-ul#graphnodes li .info {
-	display: block;
-	font-size: 70%;
-	position: relative;
-	top: -1px;
-}
-% Stop and restart with HGENCODING=cp932
-% Graph json escape of multibyte character
-var data = [["40b4d6888e92", [0, 1], [[0, 0, 1]], "\u80fd", "test", "1970-01-01", ["stable", true], ["tip"]], ["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", false], []], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
-% ERRORS ENCOUNTERED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-commands.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,1067 @@
+An attempt at more fully testing the hgweb web interface.
+The following things are tested elsewhere and are therefore omitted:
+- archive, tested in test-archive
+- unbundle, tested in test-push-http
+- changegroupsubset, tested in test-pull
+
+Set up the repo
+
+  $ hg init test
+  $ cd test
+  $ mkdir da
+  $ echo foo > da/foo
+  $ echo foo > foo
+  $ hg ci -Ambase
+  adding da/foo
+  adding foo
+  $ hg tag 1.0
+  $ echo another > foo
+  $ hg branch stable
+  marked working directory as branch stable
+  $ hg ci -Ambranch
+  $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+Logs and changes
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/?style=atom'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://*/</id> (glob)
+   <link rel="self" href="http://*/atom-log"/> (glob)
+   <link rel="alternate" href="http://*/"/> (glob)
+   <title>test Changelog</title>
+   <updated>1970-01-01T00:00:00+00:00</updated>
+  
+   <entry>
+    <title>branch</title>
+    <id>http://*/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
+    <link href="http://*/rev/1d22e65f027e"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">branch</pre>
+     </div>
+    </content>
+   </entry>
+   <entry>
+    <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
+    <id>http://*/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
+    <link href="http://*/rev/a4f92ed23982"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
+     </div>
+    </content>
+   </entry>
+   <entry>
+    <title>base</title>
+    <id>http://*/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
+    <link href="http://*/rev/2ef0ac749a14"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">base</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/?style=atom'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://*/</id> (glob)
+   <link rel="self" href="http://*/atom-log"/> (glob)
+   <link rel="alternate" href="http://*/"/> (glob)
+   <title>test Changelog</title>
+   <updated>1970-01-01T00:00:00+00:00</updated>
+  
+   <entry>
+    <title>branch</title>
+    <id>http://*/#changeset-1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe</id> (glob)
+    <link href="http://*/rev/1d22e65f027e"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">branch</pre>
+     </div>
+    </content>
+   </entry>
+   <entry>
+    <title>Added tag 1.0 for changeset 2ef0ac749a14</title>
+    <id>http://*/#changeset-a4f92ed23982be056b9852de5dfe873eaac7f0de</id> (glob)
+    <link href="http://*/rev/a4f92ed23982"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">Added tag 1.0 for changeset 2ef0ac749a14</pre>
+     </div>
+    </content>
+   </entry>
+   <entry>
+    <title>base</title>
+    <id>http://*/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
+    <link href="http://*/rev/2ef0ac749a14"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">base</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log/1/foo/?style=atom'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <id>http://*/atom-log/tip/foo</id> (glob)
+   <link rel="self" href="http://*/atom-log/tip/foo"/> (glob)
+   <title>test: foo history</title>
+   <updated>1970-01-01T00:00:00+00:00</updated>
+  
+   <entry>
+    <title>base</title>
+    <id>http://*/#changeset-2ef0ac749a14e4f57a5a822464a0902c6f7f448f</id> (glob)
+    <link href="http://*/rev/2ef0ac749a14"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">base</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/shortlog/'
+  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: log</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test" />
+  </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 class="active">log</li>
+  <li><a href="/graph/1d22e65f027e">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/1d22e65f027e">changeset</a></li>
+  <li><a href="/file/1d22e65f027e">browse</a></li>
+  </ul>
+  <ul>
+  
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log</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>
+  
+  <div class="navigate">
+  <a href="/shortlog/2?revcount=30">less</a>
+  <a href="/shortlog/2?revcount=120">more</a>
+  | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> </td>
+   </tr>
+   <tr class="parity1">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/shortlog/2?revcount=30">less</a>
+  <a href="/shortlog/2?revcount=120">more</a>
+  | rev 2: <a href="/shortlog/2ef0ac749a14">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/0/'
+  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: 2ef0ac749a14</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/2ef0ac749a14">log</a></li>
+   <li><a href="/graph/2ef0ac749a14">graph</a></li>
+   <li><a href="/tags">tags</a></li>
+   <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+   <li class="active">changeset</li>
+   <li><a href="/raw-rev/2ef0ac749a14">raw</a></li>
+   <li><a href="/file/2ef0ac749a14">browse</a></li>
+  </ul>
+  <ul>
+   
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>changeset 0:2ef0ac749a14  <span class="tag">1.0</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>
+  
+  <div class="description">base</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"> <a href="/rev/a4f92ed23982">a4f92ed23982</a></td>
+  </tr>
+  <tr>
+   <th class="files">files</th>
+   <td class="files"><a href="/file/2ef0ac749a14/da/foo">da/foo</a> <a href="/file/2ef0ac749a14/foo">foo</a> </td>
+  </tr>
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/da/foo	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+foo
+  </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l2.2" id="l2.2">     2.2</a> <span class="plusline">+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l2.3" id="l2.3">     2.3</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l2.4" id="l2.4">     2.4</a> <span class="plusline">+foo
+  </span></pre></div>
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/rev/1/?style=raw'
+  200 Script output follows
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID a4f92ed23982be056b9852de5dfe873eaac7f0de
+  # Parent  2ef0ac749a14e4f57a5a822464a0902c6f7f448f
+  Added tag 1.0 for changeset 2ef0ac749a14
+  
+  diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/log?rev=base'
+  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: searching for base</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
+  </div>
+  <ul>
+  <li><a href="/shortlog">log</a></li>
+  <li><a href="/graph">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>searching for 'base'</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>
+  
+  <div class="navigate">
+  <a href="/search/?rev=base&revcount=5">less</a>
+  <a href="/search/?rev=base&revcount=20">more</a>
+  </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> </td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/search/?rev=base&revcount=5">less</a>
+  <a href="/search/?rev=base&revcount=20">more</a>
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+File-related
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo/?style=raw'
+  200 Script output follows
+  
+  foo
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/annotate/1/foo/?style=raw'
+  200 Script output follows
+  
+  
+  test@0: foo
+  
+  
+  
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/?style=raw'
+  200 Script output follows
+  
+  
+  drwxr-xr-x da
+  -rw-r--r-- 45 .hgtags
+  -rw-r--r-- 4 foo
+  
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/1/foo'
+  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: a4f92ed23982 foo</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/a4f92ed23982">log</a></li>
+  <li><a href="/graph/a4f92ed23982">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/a4f92ed23982">changeset</a></li>
+  <li><a href="/file/a4f92ed23982/">browse</a></li>
+  </ul>
+  <ul>
+  <li class="active">file</li>
+  <li><a href="/file/tip/foo">latest</a></li>
+  <li><a href="/diff/a4f92ed23982/foo">diff</a></li>
+  <li><a href="/annotate/a4f92ed23982/foo">annotate</a></li>
+  <li><a href="/log/a4f92ed23982/foo">file log</a></li>
+  <li><a href="/raw-file/a4f92ed23982/foo">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>view foo @ 1:a4f92ed23982</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>
+  
+  <div class="description">Added tag 1.0 for changeset 2ef0ac749a14</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"><a href="/file/1d22e65f027e/foo">1d22e65f027e</a> </td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst"> line source</div>
+  
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> foo
+  </div>
+  <div class="sourcelast"></div>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/filediff/1/foo/?style=raw'
+  200 Script output follows
+  
+  
+  diff -r 000000000000 -r a4f92ed23982 foo
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +foo
+  
+  
+  
+  
+
+Overviews
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-tags'
+  200 Script output follows
+  
+  tip	1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
+  1.0	2ef0ac749a14e4f57a5a822464a0902c6f7f448f
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/raw-branches'
+  200 Script output follows
+  
+  stable	1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe	open
+  default	a4f92ed23982be056b9852de5dfe873eaac7f0de	inactive
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/summary/?style=gitweb'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" 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-gitweb.css" type="text/css" />
+  
+  
+  <title>test: Summary</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test"/>
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test"/>
+  </head>
+  <body>
+  
+  <div class="page_header">
+  <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / summary
+  
+  <form action="/log">
+  <input type="hidden" name="style" value="gitweb" />
+  <div class="search">
+  <input type="text" name="rev"  />
+  </div>
+  </form>
+  </div>
+  
+  <div class="page_nav">
+  summary |
+  <a href="/shortlog?style=gitweb">shortlog</a> |
+  <a href="/log?style=gitweb">changelog</a> |
+  <a href="/graph?style=gitweb">graph</a> |
+  <a href="/tags?style=gitweb">tags</a> |
+  <a href="/branches?style=gitweb">branches</a> |
+  <a href="/file/1d22e65f027e?style=gitweb">files</a>
+  <br/>
+  </div>
+  
+  <div class="title">&nbsp;</div>
+  <table cellspacing="0">
+  <tr><td>description</td><td>unknown</td></tr>
+  <tr><td>owner</td><td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td></tr>
+  <tr><td>last change</td><td>Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
+  </table>
+  
+  <div><a  class="title" href="/shortlog?style=gitweb">changes</a></div>
+  <table cellspacing="0">
+  
+  <tr class="parity0">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><i>test</i></td>
+  <td>
+  <a class="list" href="/rev/1d22e65f027e?style=gitweb">
+  <b>branch</b>
+  <span class="logtags"><span class="branchtag" title="stable">stable</span> <span class="tagtag" title="tip">tip</span> </span>
+  </a>
+  </td>
+  <td class="link" nowrap>
+  <a href="/rev/1d22e65f027e?style=gitweb">changeset</a> |
+  <a href="/file/1d22e65f027e?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="parity1">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><i>test</i></td>
+  <td>
+  <a class="list" href="/rev/a4f92ed23982?style=gitweb">
+  <b>Added tag 1.0 for changeset 2ef0ac749a14</b>
+  <span class="logtags"><span class="branchtag" title="default">default</span> </span>
+  </a>
+  </td>
+  <td class="link" nowrap>
+  <a href="/rev/a4f92ed23982?style=gitweb">changeset</a> |
+  <a href="/file/a4f92ed23982?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="parity0">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><i>test</i></td>
+  <td>
+  <a class="list" href="/rev/2ef0ac749a14?style=gitweb">
+  <b>base</b>
+  <span class="logtags"><span class="tagtag" title="1.0">1.0</span> </span>
+  </a>
+  </td>
+  <td class="link" nowrap>
+  <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
+  <a href="/file/2ef0ac749a14?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="light"><td colspan="4"><a class="list" href="/shortlog?style=gitweb">...</a></td></tr>
+  </table>
+  
+  <div><a class="title" href="/tags?style=gitweb">tags</a></div>
+  <table cellspacing="0">
+  
+  <tr class="parity0">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
+  <td class="link">
+  <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
+  <a href="/log/2ef0ac749a14?style=gitweb">changelog</a> |
+  <a href="/file/2ef0ac749a14?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="light"><td colspan="3"><a class="list" href="/tags?style=gitweb">...</a></td></tr>
+  </table>
+  
+  <div><a class="title" href="#">branches</a></div>
+  <table cellspacing="0">
+  
+  <tr class="parity0">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
+  <td class="">stable</td>
+  <td class="link">
+  <a href="/changeset/1d22e65f027e?style=gitweb">changeset</a> |
+  <a href="/log/1d22e65f027e?style=gitweb">changelog</a> |
+  <a href="/file/1d22e65f027e?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="parity1">
+  <td class="age"><i>1970-01-01</i></td>
+  <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
+  <td class="">default</td>
+  <td class="link">
+  <a href="/changeset/a4f92ed23982?style=gitweb">changeset</a> |
+  <a href="/log/a4f92ed23982?style=gitweb">changelog</a> |
+  <a href="/file/a4f92ed23982?style=gitweb">files</a>
+  </td>
+  </tr>
+  <tr class="light">
+    <td colspan="4"><a class="list"  href="#">...</a></td>
+  </tr>
+  </table>
+  <div class="page_footer">
+  <div class="page_footer_text">test</div>
+  <div class="rss_logo">
+  <a href="/rss-log">RSS</a>
+  <a href="/atom-log">Atom</a>
+  </div>
+  <br />
+  
+  </div>
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/?style=gitweb'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" 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-gitweb.css" type="text/css" />
+  
+  
+  <title>test: Graph</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test"/>
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test"/>
+  <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
+  </head>
+  <body>
+  
+  <div class="page_header">
+  <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="/summary?style=gitweb">test</a> / graph
+  </div>
+  
+  <form action="/log">
+  <input type="hidden" name="style" value="gitweb" />
+  <div class="search">
+  <input type="text" name="rev"  />
+  </div>
+  </form>
+  <div class="page_nav">
+  <a href="/summary?style=gitweb">summary</a> |
+  <a href="/shortlog?style=gitweb">shortlog</a> |
+  <a href="/log/2?style=gitweb">changelog</a> |
+  graph |
+  <a href="/tags?style=gitweb">tags</a> |
+  <a href="/branches?style=gitweb">branches</a> |
+  <a href="/file/1d22e65f027e?style=gitweb">files</a>
+  <br/>
+  <a href="/graph/2?style=gitweb&revcount=30">less</a>
+  <a href="/graph/2?style=gitweb&revcount=120">more</a>
+  | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
+  </div>
+  
+  <div class="title">&nbsp;</div>
+  
+  <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
+  
+  <div id="wrapper">
+  <ul id="nodebgs"></ul>
+  <canvas id="graph" width="224" height="129"></canvas>
+  <ul id="graphnodes"></ul>
+  </div>
+  
+  <script type="text/javascript" src="/static/graph.js"></script>
+  <script>
+  <!-- hide script content
+  
+  var data = [["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", true], ["tip"]], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
+  var graph = new Graph();
+  graph.scale(39);
+  
+  graph.edge = function(x0, y0, x1, y1, color) {
+  	
+  	this.setColor(color, 0.0, 0.65);
+  	this.ctx.beginPath();
+  	this.ctx.moveTo(x0, y0);
+  	this.ctx.lineTo(x1, y1);
+  	this.ctx.stroke();
+  	
+  }
+  
+  var revlink = '<li style="_STYLE"><span class="desc">';
+  revlink += '<a class="list" href="/rev/_NODEID?style=gitweb" title="_NODEID"><b>_DESC</b></a>';
+  revlink += '</span> _TAGS';
+  revlink += '<span class="info">_DATE, by _USER</span></li>';
+  
+  graph.vertex = function(x, y, color, parity, cur) {
+  	
+  	this.ctx.beginPath();
+  	color = this.setColor(color, 0.25, 0.75);
+  	this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
+  	this.ctx.fill();
+  	
+  	var bg = '<li class="bg parity' + parity + '"></li>';
+  	var left = (this.columns + 1) * this.bg_height;
+  	var nstyle = 'padding-left: ' + left + 'px;';
+  	var item = revlink.replace(/_STYLE/, nstyle);
+  	item = item.replace(/_PARITY/, 'parity' + parity);
+  	item = item.replace(/_NODEID/, cur[0]);
+  	item = item.replace(/_NODEID/, cur[0]);
+  	item = item.replace(/_DESC/, cur[3]);
+  	item = item.replace(/_USER/, cur[4]);
+  	item = item.replace(/_DATE/, cur[5]);
+  	
+  	var tagspan = '';
+  	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
+  		tagspan = '<span class="logtags">';
+  		if (cur[6][1]) {
+  			tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
+  			tagspan += cur[6][0] + '</span> ';
+  		} else if (!cur[6][1] && cur[6][0] != 'default') {
+  			tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
+  			tagspan += cur[6][0] + '</span> ';
+  		}
+  		if (cur[7].length) {
+  			for (var t in cur[7]) {
+  				var tag = cur[7][t];
+  				tagspan += '<span class="tagtag">' + tag + '</span> ';
+  			}
+  		}
+  		tagspan += '</span>';
+  	}
+  	
+  	item = item.replace(/_TAGS/, tagspan);
+  	return [bg, item];
+  	
+  }
+  
+  graph.render(data);
+  
+  // stop hiding script -->
+  </script>
+  
+  <div class="page_nav">
+  <a href="/graph/2?style=gitweb&revcount=30">less</a>
+  <a href="/graph/2?style=gitweb&revcount=120">more</a>
+  | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> 
+  </div>
+  
+  <div class="page_footer">
+  <div class="page_footer_text">test</div>
+  <div class="rss_logo">
+  <a href="/rss-log">RSS</a>
+  <a href="/atom-log">Atom</a>
+  </div>
+  <br />
+  
+  </div>
+  </body>
+  </html>
+  
+
+capabilities
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
+  200 Script output follows
+  
+  lookup changegroupsubset branchmap pushkey unbundle=HG10GZ,HG10BZ,HG10UN
+
+heads
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=heads'
+  200 Script output follows
+  
+  1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe
+
+branches
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
+  200 Script output follows
+  
+  0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
+
+changegroup
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
+  >     | $TESTDIR/printrepr.py
+  200 Script output follows
+  
+  x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82
+  4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\
+  \xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee\t\xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk
+  \xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3\'\x859
+  \xa8\x80\x84S \xa5\xbd-g\x13`\xe4\xdc\xc3H^\xdf\xe2\xc0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf\'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00\t_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc
+
+stream_out
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=stream_out'
+  200 Script output follows
+  
+  1
+
+failing unbundle, requires POST request
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=unbundle'
+  405 push requires POST request
+  
+  0
+  push requires POST request
+  [1]
+
+Static files
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/static/style.css'
+  200 Script output follows
+  
+  a { text-decoration:none; }
+  .age { white-space:nowrap; }
+  .date { white-space:nowrap; }
+  .indexlinks { white-space:nowrap; }
+  .parity0 { background-color: #ddd; }
+  .parity1 { background-color: #eee; }
+  .lineno { width: 60px; color: #aaa; font-size: smaller;
+            text-align: right; }
+  .plusline { color: green; }
+  .minusline { color: red; }
+  .atline { color: purple; }
+  .annotate { font-size: smaller; text-align: right; padding-right: 1em; }
+  .buttons a {
+    background-color: #666;
+    padding: 2pt;
+    color: white;
+    font-family: sans;
+    font-weight: bold;
+  }
+  .navigate a {
+    background-color: #ccc;
+    padding: 2pt;
+    font-family: sans;
+    color: black;
+  }
+  
+  .metatag {
+    background-color: #888;
+    color: white;
+    text-align: right;
+  }
+  
+  /* Common */
+  pre { margin: 0; }
+  
+  .logo {
+    float: right;
+    clear: right;
+  }
+  
+  /* Changelog/Filelog entries */
+  .logEntry { width: 100%; }
+  .logEntry .age { width: 15%; }
+  .logEntry th { font-weight: normal; text-align: right; vertical-align: top; }
+  .logEntry th.age, .logEntry th.firstline { font-weight: bold; }
+  .logEntry th.firstline { text-align: left; width: inherit; }
+  
+  /* Shortlog entries */
+  .slogEntry { width: 100%; }
+  .slogEntry .age { width: 8em; }
+  .slogEntry td { font-weight: normal; text-align: left; vertical-align: top; }
+  .slogEntry td.author { width: 15em; }
+  
+  /* Tag entries */
+  #tagEntries { list-style: none; margin: 0; padding: 0; }
+  #tagEntries .tagEntry { list-style: none; margin: 0; padding: 0; }
+  
+  /* Changeset entry */
+  #changesetEntry { }
+  #changesetEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
+  #changesetEntry th.files, #changesetEntry th.description { vertical-align: top; }
+  
+  /* File diff view */
+  #filediffEntry { }
+  #filediffEntry th { font-weight: normal; background-color: #888; color: #fff; text-align: right; }
+  
+  /* Graph */
+  div#wrapper {
+  	position: relative;
+  	margin: 0;
+  	padding: 0;
+  }
+  
+  canvas {
+  	position: absolute;
+  	z-index: 5;
+  	top: -0.6em;
+  	margin: 0;
+  }
+  
+  ul#nodebgs {
+  	list-style: none inside none;
+  	padding: 0;
+  	margin: 0;
+  	top: -0.7em;
+  }
+  
+  ul#graphnodes li, ul#nodebgs li {
+  	height: 39px;
+  }
+  
+  ul#graphnodes {
+  	position: absolute;
+  	z-index: 10;
+  	top: -0.85em;
+  	list-style: none inside none;
+  	padding: 0;
+  }
+  
+  ul#graphnodes li .info {
+  	display: block;
+  	font-size: 70%;
+  	position: relative;
+  	top: -1px;
+  }
+
+Stop and restart with HGENCODING=cp932
+
+  $ "$TESTDIR/killdaemons.py"
+  $ HGENCODING=cp932 hg serve --config server.uncompressed=False -n test \
+  >     -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+commit message with Japanese Kanji 'Noh', which ends with '\x5c'
+
+  $ echo foo >> foo
+  $ HGENCODING=cp932 hg ci -m `python -c 'print("\x94\x5c")'`
+
+Graph json escape of multibyte character
+
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/' \
+  >     | grep '^var data ='
+  var data = [["40b4d6888e92", [0, 1], [[0, 0, 1]], "\u80fd", "test", "1970-01-01", ["stable", true], ["tip"]], ["1d22e65f027e", [0, 1], [[0, 0, 1]], "branch", "test", "1970-01-01", ["stable", false], []], ["a4f92ed23982", [0, 1], [[0, 0, 1]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"]]];
+
+ERRORS ENCOUNTERED
+
+  $ cat errors.log
--- a/tests/test-hgweb-descend-empties	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-# 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
-
-echo % 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
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % manifest with descending
-"$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file'
-
-echo % ERRORS ENCOUNTERED
-cat errors.log
--- a/tests/test-hgweb-descend-empties.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-% Set up the repo
-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
-% manifest with descending
-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="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/9087c84a0f5d">changeset</a></li>
-<li class="active">browse</li>
-</ul>
-<ul>
-
-</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>
-
-% ERRORS ENCOUNTERED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-descend-empties.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,134 @@
+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="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/9087c84a0f5d">changeset</a></li>
+  <li class="active">browse</li>
+  </ul>
+  <ul>
+  
+  </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
--- a/tests/test-hgweb-diffs	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-echo % setting up repo
-hg init test
-cd test
-echo a > a
-echo b > b
-hg ci -Ama
-
-echo % change permissions for git diffs
-chmod 755 a
-hg ci -Amb
-
-echo % set up hgweb
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
-
-echo % raw revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
-
-echo % diff removed file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
-
-echo % set up hgweb with git diffs
-"$TESTDIR/killdaemons.py"
-hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
-
-echo % revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
-
-echo % diff removed file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
-
-cd ..
-echo % test import rev as raw-rev
-hg clone -r0 test test1
-cd test1
-hg import -q --exact http://localhost:$HGPORT/rev/1
-
-echo % errors
-cat ../test/errors.log
--- a/tests/test-hgweb-diffs.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,428 +0,0 @@
-% setting up repo
-adding a
-adding b
-% change permissions for git diffs
-% set up hgweb
-% revision
-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: 0cd96de13884</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/0cd96de13884">log</a></li>
- <li><a href="/graph/0cd96de13884">graph</a></li>
- <li><a href="/tags">tags</a></li>
- <li><a href="/branches">branches</a></li>
-</ul>
-<ul>
- <li class="active">changeset</li>
- <li><a href="/raw-rev/0cd96de13884">raw</a></li>
- <li><a href="/file/0cd96de13884">browse</a></li>
-</ul>
-<ul>
- 
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>changeset 0:0cd96de13884  </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>
-
-<div class="description">a</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
-</tr>
-<tr>
- <th class="files">files</th>
- <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
-</tr>
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+a
-</span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l2.2" id="l2.2">     2.2</a> <span class="plusline">+++ b/b	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l2.3" id="l2.3">     2.3</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l2.4" id="l2.4">     2.4</a> <span class="plusline">+b
-</span></pre></div>
-</div>
-
-</div>
-</div>
-
-
-</body>
-</html>
-
-% raw revision
-200 Script output follows
-
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
-
-a
-
-diff -r 000000000000 -r 0cd96de13884 a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-diff -r 000000000000 -r 0cd96de13884 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% diff removed 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: a diff</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/78e4ebad7cdf">log</a></li>
-<li><a href="/graph/78e4ebad7cdf">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/78e4ebad7cdf">changeset</a></li>
-<li><a href="/file/78e4ebad7cdf">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/78e4ebad7cdf/a">file</a></li>
-<li><a href="/file/tip/a">latest</a></li>
-<li class="active">diff</li>
-<li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
-<li><a href="/log/78e4ebad7cdf/a">file log</a></li>
-<li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>diff a @ 1:78e4ebad7cdf</h3>
-
-<form class="search" action="/log">
-<p></p>
-<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>
-
-<div class="description">b</div>
-
-<table id="changesetEntry">
-<tr>
- <th>author</th>
- <td>&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th>date</th>
- <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th>parents</th>
- <td></td>
-</tr>
-<tr>
- <th>children</th>
- <td></td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+a
-</span></pre></div>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% set up hgweb with git diffs
-% revision
-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: 0cd96de13884</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/0cd96de13884">log</a></li>
- <li><a href="/graph/0cd96de13884">graph</a></li>
- <li><a href="/tags">tags</a></li>
- <li><a href="/branches">branches</a></li>
-</ul>
-<ul>
- <li class="active">changeset</li>
- <li><a href="/raw-rev/0cd96de13884">raw</a></li>
- <li><a href="/file/0cd96de13884">browse</a></li>
-</ul>
-<ul>
- 
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>changeset 0:0cd96de13884  </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>
-
-<div class="description">a</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
-</tr>
-<tr>
- <th class="files">files</th>
- <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
-</tr>
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> new file mode 100644
-<a href="#l1.2" id="l1.2">     1.2</a> <span class="minusline">--- /dev/null
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="plusline">+++ b/a
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l1.5" id="l1.5">     1.5</a> <span class="plusline">+a
-</span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> new file mode 100644
-<a href="#l2.2" id="l2.2">     2.2</a> <span class="minusline">--- /dev/null
-</span><a href="#l2.3" id="l2.3">     2.3</a> <span class="plusline">+++ b/b
-</span><a href="#l2.4" id="l2.4">     2.4</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l2.5" id="l2.5">     2.5</a> <span class="plusline">+b
-</span></pre></div>
-</div>
-
-</div>
-</div>
-
-
-</body>
-</html>
-
-% revision
-200 Script output follows
-
-
-# HG changeset patch
-# User test
-# Date 0 0
-# Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
-
-a
-
-diff --git a/a b/a
-new file mode 100644
---- /dev/null
-+++ b/a
-@@ -0,0 +1,1 @@
-+a
-diff --git a/b b/b
-new file mode 100644
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+b
-
-% diff removed 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: a diff</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/78e4ebad7cdf">log</a></li>
-<li><a href="/graph/78e4ebad7cdf">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/78e4ebad7cdf">changeset</a></li>
-<li><a href="/file/78e4ebad7cdf">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/78e4ebad7cdf/a">file</a></li>
-<li><a href="/file/tip/a">latest</a></li>
-<li class="active">diff</li>
-<li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
-<li><a href="/log/78e4ebad7cdf/a">file log</a></li>
-<li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>diff a @ 1:78e4ebad7cdf</h3>
-
-<form class="search" action="/log">
-<p></p>
-<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>
-
-<div class="description">b</div>
-
-<table id="changesetEntry">
-<tr>
- <th>author</th>
- <td>&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th>date</th>
- <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th>parents</th>
- <td></td>
-</tr>
-<tr>
- <th>children</th>
- <td></td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> new file mode 100755
-<a href="#l1.2" id="l1.2">     1.2</a> <span class="minusline">--- /dev/null
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="plusline">+++ b/a
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="atline">@@ -0,0 +1,1 @@
-</span><a href="#l1.5" id="l1.5">     1.5</a> <span class="plusline">+a
-</span></pre></div>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% test import rev as raw-rev
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-diffs.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,474 @@
+setting up repo
+
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ echo b > b
+  $ hg ci -Ama
+  adding a
+  adding b
+
+change permissions for git diffs
+
+  $ chmod 755 a
+  $ hg ci -Amb
+
+set up hgweb
+
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
+  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: 0cd96de13884</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/0cd96de13884">log</a></li>
+   <li><a href="/graph/0cd96de13884">graph</a></li>
+   <li><a href="/tags">tags</a></li>
+   <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+   <li class="active">changeset</li>
+   <li><a href="/raw-rev/0cd96de13884">raw</a></li>
+   <li><a href="/file/0cd96de13884">browse</a></li>
+  </ul>
+  <ul>
+   
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>changeset 0:0cd96de13884  </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>
+  
+  <div class="description">a</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
+  </tr>
+  <tr>
+   <th class="files">files</th>
+   <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
+  </tr>
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+a
+  </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l2.2" id="l2.2">     2.2</a> <span class="plusline">+++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l2.3" id="l2.3">     2.3</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l2.4" id="l2.4">     2.4</a> <span class="plusline">+b
+  </span></pre></div>
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+
+raw revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
+  200 Script output follows
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
+  
+  a
+  
+  diff -r 000000000000 -r 0cd96de13884 a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  diff -r 000000000000 -r 0cd96de13884 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+diff removed file
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
+  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: a diff</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/78e4ebad7cdf">log</a></li>
+  <li><a href="/graph/78e4ebad7cdf">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/78e4ebad7cdf">changeset</a></li>
+  <li><a href="/file/78e4ebad7cdf">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/78e4ebad7cdf/a">file</a></li>
+  <li><a href="/file/tip/a">latest</a></li>
+  <li class="active">diff</li>
+  <li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
+  <li><a href="/log/78e4ebad7cdf/a">file log</a></li>
+  <li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>diff a @ 1:78e4ebad7cdf</h3>
+  
+  <form class="search" action="/log">
+  <p></p>
+  <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>
+  
+  <div class="description">b</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th>author</th>
+   <td>&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th>date</th>
+   <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th>parents</th>
+   <td></td>
+  </tr>
+  <tr>
+   <th>children</th>
+   <td></td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="plusline">+a
+  </span></pre></div>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+set up hgweb with git diffs
+
+  $ "$TESTDIR/killdaemons.py"
+  $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
+  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: 0cd96de13884</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/0cd96de13884">log</a></li>
+   <li><a href="/graph/0cd96de13884">graph</a></li>
+   <li><a href="/tags">tags</a></li>
+   <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+   <li class="active">changeset</li>
+   <li><a href="/raw-rev/0cd96de13884">raw</a></li>
+   <li><a href="/file/0cd96de13884">browse</a></li>
+  </ul>
+  <ul>
+   
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>changeset 0:0cd96de13884  </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>
+  
+  <div class="description">a</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"> <a href="/rev/78e4ebad7cdf">78e4ebad7cdf</a></td>
+  </tr>
+  <tr>
+   <th class="files">files</th>
+   <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
+  </tr>
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> new file mode 100644
+  <a href="#l1.2" id="l1.2">     1.2</a> <span class="minusline">--- /dev/null
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="plusline">+++ b/a
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l1.5" id="l1.5">     1.5</a> <span class="plusline">+a
+  </span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1">     2.1</a> new file mode 100644
+  <a href="#l2.2" id="l2.2">     2.2</a> <span class="minusline">--- /dev/null
+  </span><a href="#l2.3" id="l2.3">     2.3</a> <span class="plusline">+++ b/b
+  </span><a href="#l2.4" id="l2.4">     2.4</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l2.5" id="l2.5">     2.5</a> <span class="plusline">+b
+  </span></pre></div>
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+
+revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
+  200 Script output follows
+  
+  
+  # HG changeset patch
+  # User test
+  # Date 0 0
+  # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
+  
+  a
+  
+  diff --git a/a b/a
+  new file mode 100644
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,1 @@
+  +a
+  diff --git a/b b/b
+  new file mode 100644
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +b
+  
+
+diff removed file
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
+  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: a diff</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/78e4ebad7cdf">log</a></li>
+  <li><a href="/graph/78e4ebad7cdf">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/78e4ebad7cdf">changeset</a></li>
+  <li><a href="/file/78e4ebad7cdf">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/78e4ebad7cdf/a">file</a></li>
+  <li><a href="/file/tip/a">latest</a></li>
+  <li class="active">diff</li>
+  <li><a href="/annotate/78e4ebad7cdf/a">annotate</a></li>
+  <li><a href="/log/78e4ebad7cdf/a">file log</a></li>
+  <li><a href="/raw-file/78e4ebad7cdf/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>diff a @ 1:78e4ebad7cdf</h3>
+  
+  <form class="search" action="/log">
+  <p></p>
+  <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>
+  
+  <div class="description">b</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th>author</th>
+   <td>&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th>date</th>
+   <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th>parents</th>
+   <td></td>
+  </tr>
+  <tr>
+   <th>children</th>
+   <td></td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> new file mode 100755
+  <a href="#l1.2" id="l1.2">     1.2</a> <span class="minusline">--- /dev/null
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="plusline">+++ b/a
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="atline">@@ -0,0 +1,1 @@
+  </span><a href="#l1.5" id="l1.5">     1.5</a> <span class="plusline">+a
+  </span></pre></div>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ cd ..
+
+test import rev as raw-rev
+
+  $ hg clone -r0 test test1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test1
+  $ hg import -q --exact http://localhost:$HGPORT/rev/1
+
+errors
+
+  $ cat ../test/errors.log
--- a/tests/test-hgweb-empty	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Some tests for hgweb in an empty repository
-
-hg init test
-cd test
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/shortlog')
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log')
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/graph')
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file')
--- a/tests/test-hgweb-empty.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,366 +0,0 @@
-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: log</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test" />
-</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 class="active">log</li>
-<li><a href="/graph/000000000000">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/000000000000">changeset</a></li>
-<li><a href="/file/000000000000">browse</a></li>
-</ul>
-<ul>
-
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log</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>
-
-<div class="navigate">
-<a href="/shortlog/-1?revcount=30">less</a>
-<a href="/shortlog/-1?revcount=120">more</a>
-| rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/shortlog/-1?revcount=30">less</a>
-<a href="/shortlog/-1?revcount=120">more</a>
-| rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-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: log</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test" />
-</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 class="active">log</li>
-<li><a href="/graph/000000000000">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/000000000000">changeset</a></li>
-<li><a href="/file/000000000000">browse</a></li>
-</ul>
-<ul>
-
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log</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>
-
-<div class="navigate">
-<a href="/shortlog/-1?revcount=5">less</a>
-<a href="/shortlog/-1?revcount=20">more</a>
-| rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/shortlog/-1?revcount=5">less</a>
-<a href="/shortlog/-1?revcount=20">more</a>
-| rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-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: revision graph</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log" title="Atom feed for test: log" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log" title="RSS feed for test: log" />
-<!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
-</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/000000000000">log</a></li>
-<li class="active">graph</li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/000000000000">changeset</a></li>
-<li><a href="/file/000000000000">browse</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>graph</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>
-
-<div class="navigate">
-<a href="/graph/-1?revcount=30">less</a>
-<a href="/graph/-1?revcount=120">more</a>
-| rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
-</div>
-
-<noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
-
-<div id="wrapper">
-<ul id="nodebgs"></ul>
-<canvas id="graph" width="224" height="12"></canvas>
-<ul id="graphnodes"></ul>
-</div>
-
-<script type="text/javascript" src="/static/graph.js"></script>
-<script type="text/javascript">
-<!-- hide script content
-
-var data = [];
-var graph = new Graph();
-graph.scale(39);
-
-graph.edge = function(x0, y0, x1, y1, color) {
-	
-	this.setColor(color, 0.0, 0.65);
-	this.ctx.beginPath();
-	this.ctx.moveTo(x0, y0);
-	this.ctx.lineTo(x1, y1);
-	this.ctx.stroke();
-	
-}
-
-var revlink = '<li style="_STYLE"><span class="desc">';
-revlink += '<a href="/rev/_NODEID" title="_NODEID">_DESC</a>';
-revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>';
-
-graph.vertex = function(x, y, color, parity, cur) {
-	
-	this.ctx.beginPath();
-	color = this.setColor(color, 0.25, 0.75);
-	this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
-	this.ctx.fill();
-	
-	var bg = '<li class="bg parity' + parity + '"></li>';
-	var left = (this.columns + 1) * this.bg_height;
-	var nstyle = 'padding-left: ' + left + 'px;';
-	var item = revlink.replace(/_STYLE/, nstyle);
-	item = item.replace(/_PARITY/, 'parity' + parity);
-	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_NODEID/, cur[0]);
-	item = item.replace(/_DESC/, cur[3]);
-	item = item.replace(/_USER/, cur[4]);
-	item = item.replace(/_DATE/, cur[5]);
-
-	var tagspan = '';
-	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
-		tagspan = '<span class="logtags">';
-		if (cur[6][1]) {
-			tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
-			tagspan += cur[6][0] + '</span> ';
-		} else if (!cur[6][1] && cur[6][0] != 'default') {
-			tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
-			tagspan += cur[6][0] + '</span> ';
-		}
-		if (cur[7].length) {
-			for (var t in cur[7]) {
-				var tag = cur[7][t];
-				tagspan += '<span class="tag">' + tag + '</span> ';
-			}
-		}
-		tagspan += '</span>';
-	}
-	
-	item = item.replace(/_TAGS/, tagspan);
-	return [bg, item];
-	
-}
-
-graph.render(data);
-
-// stop hiding script -->
-</script>
-
-<div class="navigate">
-<a href="/graph/-1?revcount=30">less</a>
-<a href="/graph/-1?revcount=120">more</a>
-| rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-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: 000000000000 /</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/000000000000">log</a></li>
-<li><a href="/graph/000000000000">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/000000000000">changeset</a></li>
-<li class="active">browse</li>
-</ul>
-<ul>
-
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>directory / @ -1:000000000000 <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/000000000000/">[up]</a></td>
-  <td class="size"></td>
-  <td class="permissions">drwxr-xr-x</td>
-</tr>
-
-
-</table>
-</div>
-</div>
-
-
-</body>
-</html>
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-empty.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,376 @@
+Some tests for hgweb in an empty repository
+
+  $ hg init test
+  $ cd test
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/shortlog')
+  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: log</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test" />
+  </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 class="active">log</li>
+  <li><a href="/graph/000000000000">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/000000000000">changeset</a></li>
+  <li><a href="/file/000000000000">browse</a></li>
+  </ul>
+  <ul>
+  
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log</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>
+  
+  <div class="navigate">
+  <a href="/shortlog/-1?revcount=30">less</a>
+  <a href="/shortlog/-1?revcount=120">more</a>
+  | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/shortlog/-1?revcount=30">less</a>
+  <a href="/shortlog/-1?revcount=120">more</a>
+  | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log')
+  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: log</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test" />
+  </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 class="active">log</li>
+  <li><a href="/graph/000000000000">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/000000000000">changeset</a></li>
+  <li><a href="/file/000000000000">browse</a></li>
+  </ul>
+  <ul>
+  
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log</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>
+  
+  <div class="navigate">
+  <a href="/shortlog/-1?revcount=5">less</a>
+  <a href="/shortlog/-1?revcount=20">more</a>
+  | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/shortlog/-1?revcount=5">less</a>
+  <a href="/shortlog/-1?revcount=20">more</a>
+  | rev -1: <a href="/shortlog/000000000000">(0)</a> <a href="/shortlog/tip">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/graph')
+  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: revision graph</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log" title="Atom feed for test: log" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log" title="RSS feed for test: log" />
+  <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
+  </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/000000000000">log</a></li>
+  <li class="active">graph</li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/000000000000">changeset</a></li>
+  <li><a href="/file/000000000000">browse</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>graph</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>
+  
+  <div class="navigate">
+  <a href="/graph/-1?revcount=30">less</a>
+  <a href="/graph/-1?revcount=120">more</a>
+  | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
+  </div>
+  
+  <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
+  
+  <div id="wrapper">
+  <ul id="nodebgs"></ul>
+  <canvas id="graph" width="224" height="12"></canvas>
+  <ul id="graphnodes"></ul>
+  </div>
+  
+  <script type="text/javascript" src="/static/graph.js"></script>
+  <script type="text/javascript">
+  <!-- hide script content
+  
+  var data = [];
+  var graph = new Graph();
+  graph.scale(39);
+  
+  graph.edge = function(x0, y0, x1, y1, color) {
+  	
+  	this.setColor(color, 0.0, 0.65);
+  	this.ctx.beginPath();
+  	this.ctx.moveTo(x0, y0);
+  	this.ctx.lineTo(x1, y1);
+  	this.ctx.stroke();
+  	
+  }
+  
+  var revlink = '<li style="_STYLE"><span class="desc">';
+  revlink += '<a href="/rev/_NODEID" title="_NODEID">_DESC</a>';
+  revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>';
+  
+  graph.vertex = function(x, y, color, parity, cur) {
+  	
+  	this.ctx.beginPath();
+  	color = this.setColor(color, 0.25, 0.75);
+  	this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
+  	this.ctx.fill();
+  	
+  	var bg = '<li class="bg parity' + parity + '"></li>';
+  	var left = (this.columns + 1) * this.bg_height;
+  	var nstyle = 'padding-left: ' + left + 'px;';
+  	var item = revlink.replace(/_STYLE/, nstyle);
+  	item = item.replace(/_PARITY/, 'parity' + parity);
+  	item = item.replace(/_NODEID/, cur[0]);
+  	item = item.replace(/_NODEID/, cur[0]);
+  	item = item.replace(/_DESC/, cur[3]);
+  	item = item.replace(/_USER/, cur[4]);
+  	item = item.replace(/_DATE/, cur[5]);
+  
+  	var tagspan = '';
+  	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
+  		tagspan = '<span class="logtags">';
+  		if (cur[6][1]) {
+  			tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
+  			tagspan += cur[6][0] + '</span> ';
+  		} else if (!cur[6][1] && cur[6][0] != 'default') {
+  			tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
+  			tagspan += cur[6][0] + '</span> ';
+  		}
+  		if (cur[7].length) {
+  			for (var t in cur[7]) {
+  				var tag = cur[7][t];
+  				tagspan += '<span class="tag">' + tag + '</span> ';
+  			}
+  		}
+  		tagspan += '</span>';
+  	}
+  	
+  	item = item.replace(/_TAGS/, tagspan);
+  	return [bg, item];
+  	
+  }
+  
+  graph.render(data);
+  
+  // stop hiding script -->
+  </script>
+  
+  <div class="navigate">
+  <a href="/graph/-1?revcount=30">less</a>
+  <a href="/graph/-1?revcount=120">more</a>
+  | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  $ ("$TESTDIR/get-with-headers.py" localhost:$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: 000000000000 /</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/000000000000">log</a></li>
+  <li><a href="/graph/000000000000">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/000000000000">changeset</a></li>
+  <li class="active">browse</li>
+  </ul>
+  <ul>
+  
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>directory / @ -1:000000000000 <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/000000000000/">[up]</a></td>
+    <td class="size"></td>
+    <td class="permissions">drwxr-xr-x</td>
+  </tr>
+  
+  
+  </table>
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
--- a/tests/test-hgweb-filelog	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-
-echo b > b
-hg ci -Am "b"
-
-echo a > a
-hg ci -Am "first a"
-
-hg rm a
-hg ci -m "del a"
-
-echo b > a
-hg ci -Am "second a"
-
-hg rm a
-hg ci -m "del2 a"
-
-hg mv b c
-hg ci -m "mv b"
-
-echo c >> c
-hg ci -m "change c"
-
-hg log -p
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % tip - two revisions
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/tip/a')
-
-echo % second version - two revisions
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/3/a')
-
-echo % first deleted - one revision
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/2/a')
-
-echo % first version - one revision
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/1/a')
-
-echo % before addition - error
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/0/a')
-
-echo % should show base link, use spartan because it shows it
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/tip/c?style=spartan')
-
-echo % errors
-cat errors.log
--- a/tests/test-hgweb-filelog.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,605 +0,0 @@
-adding b
-adding a
-adding a
-changeset:   6:b7682196df1c
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change c
-
-diff -r 1a6696706df2 -r b7682196df1c c
---- a/c	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,1 +1,2 @@
- b
-+c
-
-changeset:   5:1a6696706df2
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     mv b
-
-diff -r 52e848cdcd88 -r 1a6696706df2 b
---- a/b	Thu Jan 01 00:00:00 1970 +0000
-+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,1 +0,0 @@
--b
-diff -r 52e848cdcd88 -r 1a6696706df2 c
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/c	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-changeset:   4:52e848cdcd88
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     del2 a
-
-diff -r 01de2d66a28d -r 52e848cdcd88 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,1 +0,0 @@
--b
-
-changeset:   3:01de2d66a28d
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     second a
-
-diff -r be3ebcc91739 -r 01de2d66a28d a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-changeset:   2:be3ebcc91739
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     del a
-
-diff -r 5ed941583260 -r be3ebcc91739 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,1 +0,0 @@
--a
-
-changeset:   1:5ed941583260
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     first a
-
-diff -r 6563da9dcf87 -r 5ed941583260 a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+a
-
-changeset:   0:6563da9dcf87
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     b
-
-diff -r 000000000000 -r 6563da9dcf87 b
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/b	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,1 @@
-+b
-
-% tip - two revisions
-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: a history</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log/tip/a" title="Atom feed for test:a" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log/tip/a" title="RSS feed for test:a" />
-</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/01de2d66a28d">log</a></li>
-<li><a href="/graph/01de2d66a28d">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/01de2d66a28d">changeset</a></li>
-<li><a href="/file/01de2d66a28d">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/01de2d66a28d/a">file</a></li>
-<li><a href="/diff/01de2d66a28d/a">diff</a></li>
-<li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
-<li class="active">file log</li>
-<li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log a</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>
-
-<div class="navigate">
-<a href="/log/01de2d66a28d/a?revcount=30">less</a>
-<a href="/log/01de2d66a28d/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
- </tr>
- <tr class="parity1">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/5ed941583260">first a</a></td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/log/01de2d66a28d/a?revcount=30">less</a>
-<a href="/log/01de2d66a28d/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% second version - two revisions
-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: a history</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log/tip/a" title="Atom feed for test:a" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log/tip/a" title="RSS feed for test:a" />
-</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/01de2d66a28d">log</a></li>
-<li><a href="/graph/01de2d66a28d">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/01de2d66a28d">changeset</a></li>
-<li><a href="/file/01de2d66a28d">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/01de2d66a28d/a">file</a></li>
-<li><a href="/diff/01de2d66a28d/a">diff</a></li>
-<li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
-<li class="active">file log</li>
-<li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log a</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>
-
-<div class="navigate">
-<a href="/log/01de2d66a28d/a?revcount=30">less</a>
-<a href="/log/01de2d66a28d/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
- </tr>
- <tr class="parity1">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/5ed941583260">first a</a></td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/log/01de2d66a28d/a?revcount=30">less</a>
-<a href="/log/01de2d66a28d/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% first deleted - one revision
-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: a history</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log/tip/a" title="Atom feed for test:a" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log/tip/a" title="RSS feed for test:a" />
-</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/5ed941583260">log</a></li>
-<li><a href="/graph/5ed941583260">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/5ed941583260">changeset</a></li>
-<li><a href="/file/5ed941583260">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/5ed941583260/a">file</a></li>
-<li><a href="/diff/5ed941583260/a">diff</a></li>
-<li><a href="/annotate/5ed941583260/a">annotate</a></li>
-<li class="active">file log</li>
-<li><a href="/raw-file/5ed941583260/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log a</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>
-
-<div class="navigate">
-<a href="/log/5ed941583260/a?revcount=30">less</a>
-<a href="/log/5ed941583260/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/5ed941583260">first a</a></td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/log/5ed941583260/a?revcount=30">less</a>
-<a href="/log/5ed941583260/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% first version - one revision
-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: a history</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log/tip/a" title="Atom feed for test:a" />
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log/tip/a" title="RSS feed for test:a" />
-</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/5ed941583260">log</a></li>
-<li><a href="/graph/5ed941583260">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/5ed941583260">changeset</a></li>
-<li><a href="/file/5ed941583260">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/5ed941583260/a">file</a></li>
-<li><a href="/diff/5ed941583260/a">diff</a></li>
-<li><a href="/annotate/5ed941583260/a">annotate</a></li>
-<li class="active">file log</li>
-<li><a href="/raw-file/5ed941583260/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>log a</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>
-
-<div class="navigate">
-<a href="/log/5ed941583260/a?revcount=30">less</a>
-<a href="/log/5ed941583260/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
-
-<table class="bigtable">
- <tr>
-  <th class="age">age</th>
-  <th class="author">author</th>
-  <th class="description">description</th>
- </tr>
- <tr class="parity0">
-  <td class="age">1970-01-01</td>
-  <td class="author">test</td>
-  <td class="description"><a href="/rev/5ed941583260">first a</a></td>
- </tr>
-
-</table>
-
-<div class="navigate">
-<a href="/log/5ed941583260/a?revcount=30">less</a>
-<a href="/log/5ed941583260/a?revcount=120">more</a>
-| <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
-</div>
-
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% before addition - error
-404 Not Found
-
-<!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: error</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<div class="logo">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<ul>
-<li><a href="/shortlog">log</a></li>
-<li><a href="/graph">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>error</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>
-
-<div class="description">
-<p>
-An error occurred while processing your request:
-</p>
-<p>
-a@6563da9dcf87: not found in manifest
-</p>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% should show base link, use spartan because it shows it
-200 Script output follows
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<link rel="icon" href="/static/hgicon.png" type="image/png">
-<meta name="robots" content="index, nofollow" />
-<link rel="stylesheet" href="/static/style.css" type="text/css" />
-
-<title>test: c history</title>
-<link rel="alternate" type="application/atom+xml"
-   href="/atom-log/tip/c" title="Atom feed for test:c">
-<link rel="alternate" type="application/rss+xml"
-   href="/rss-log/tip/c" title="RSS feed for test:c">
-</head>
-<body>
-
-<div class="buttons">
-<a href="/log?style=spartan">changelog</a>
-<a href="/shortlog?style=spartan">shortlog</a>
-<a href="/graph?style=spartan">graph</a>
-<a href="/tags?style=spartan">tags</a>
-<a href="/branches?style=spartan">branches</a>
-<a href="/file/b7682196df1c/c?style=spartan">file</a>
-<a href="/annotate/b7682196df1c/c?style=spartan">annotate</a>
-<a type="application/rss+xml" href="/rss-log/tip/c">rss</a>
-<a type="application/atom+xml" href="/atom-log/tip/c" title="Atom feed for test:c">atom</a>
-</div>
-
-<h2>c revision history</h2>
-
-<p>navigate: <small class="navigate"><a href="/log/1a6696706df2/c?style=spartan">(0)</a> <a href="/log/tip/c?style=spartan">tip</a> </small></p>
-
-<table class="logEntry parity0">
- <tr>
-  <th class="age">1970-01-01:</th>
-  <th class="firstline"><a href="/rev/b7682196df1c?style=spartan">change c</a></th>
- </tr>
- <tr>
-  <th class="revision">revision 1:</td>
-  <td class="node">
-   <a href="/file/b7682196df1c/c?style=spartan">b7682196df1c</a>
-   <a href="/diff/b7682196df1c/c?style=spartan">(diff)</a>
-   <a href="/annotate/b7682196df1c/c?style=spartan">(annotate)</a>
-  </td>
- </tr>
- 
- <tr>
-  <th class="author">author:</th>
-  <td class="author">&#116;&#101;&#115;&#116;</td>
- </tr>
- <tr>
-  <th class="date">date:</th>
-  <td class="date">Thu Jan 01 00:00:00 1970 +0000</td>
- </tr>
-</table>
-
-
-<table class="logEntry parity1">
- <tr>
-  <th class="age">1970-01-01:</th>
-  <th class="firstline"><a href="/rev/1a6696706df2?style=spartan">mv b</a></th>
- </tr>
- <tr>
-  <th class="revision">revision 0:</td>
-  <td class="node">
-   <a href="/file/1a6696706df2/c?style=spartan">1a6696706df2</a>
-   <a href="/diff/1a6696706df2/c?style=spartan">(diff)</a>
-   <a href="/annotate/1a6696706df2/c?style=spartan">(annotate)</a>
-  </td>
- </tr>
- 
-<tr>
-<th>base:</th>
-<td>
-<a href="/file/1e88685f5dde/b?style=spartan">
-b@1e88685f5dde
-</a>
-</td>
-</tr>
- <tr>
-  <th class="author">author:</th>
-  <td class="author">&#116;&#101;&#115;&#116;</td>
- </tr>
- <tr>
-  <th class="date">date:</th>
-  <td class="date">Thu Jan 01 00:00:00 1970 +0000</td>
- </tr>
-</table>
-
-
-
-
-
-<div class="logo">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
-</div>
-
-</body>
-</html>
-
-% errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-filelog.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,647 @@
+
+  $ hg init test
+  $ cd test
+  $ echo b > b
+  $ hg ci -Am "b"
+  adding b
+  $ echo a > a
+  $ hg ci -Am "first a"
+  adding a
+  $ hg rm a
+  $ hg ci -m "del a"
+  $ echo b > a
+  $ hg ci -Am "second a"
+  adding a
+  $ hg rm a
+  $ hg ci -m "del2 a"
+  $ hg mv b c
+  $ hg ci -m "mv b"
+  $ echo c >> c
+  $ hg ci -m "change c"
+  $ hg log -p
+  changeset:   6:b7682196df1c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change c
+  
+  diff -r 1a6696706df2 -r b7682196df1c c
+  --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,2 @@
+   b
+  +c
+  
+  changeset:   5:1a6696706df2
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     mv b
+  
+  diff -r 52e848cdcd88 -r 1a6696706df2 b
+  --- a/b	Thu Jan 01 00:00:00 1970 +0000
+  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +0,0 @@
+  -b
+  diff -r 52e848cdcd88 -r 1a6696706df2 c
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  changeset:   4:52e848cdcd88
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     del2 a
+  
+  diff -r 01de2d66a28d -r 52e848cdcd88 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +0,0 @@
+  -b
+  
+  changeset:   3:01de2d66a28d
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     second a
+  
+  diff -r be3ebcc91739 -r 01de2d66a28d a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  changeset:   2:be3ebcc91739
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     del a
+  
+  diff -r 5ed941583260 -r be3ebcc91739 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +0,0 @@
+  -a
+  
+  changeset:   1:5ed941583260
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     first a
+  
+  diff -r 6563da9dcf87 -r 5ed941583260 a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +a
+  
+  changeset:   0:6563da9dcf87
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     b
+  
+  diff -r 000000000000 -r 6563da9dcf87 b
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,1 @@
+  +b
+  
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+tip - two revisions
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/tip/a')
+  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: a history</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log/tip/a" title="Atom feed for test:a" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log/tip/a" title="RSS feed for test:a" />
+  </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/01de2d66a28d">log</a></li>
+  <li><a href="/graph/01de2d66a28d">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/01de2d66a28d">changeset</a></li>
+  <li><a href="/file/01de2d66a28d">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/01de2d66a28d/a">file</a></li>
+  <li><a href="/diff/01de2d66a28d/a">diff</a></li>
+  <li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
+  <li class="active">file log</li>
+  <li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log a</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>
+  
+  <div class="navigate">
+  <a href="/log/01de2d66a28d/a?revcount=30">less</a>
+  <a href="/log/01de2d66a28d/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
+   </tr>
+   <tr class="parity1">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/log/01de2d66a28d/a?revcount=30">less</a>
+  <a href="/log/01de2d66a28d/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+second version - two revisions
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/3/a')
+  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: a history</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log/tip/a" title="Atom feed for test:a" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log/tip/a" title="RSS feed for test:a" />
+  </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/01de2d66a28d">log</a></li>
+  <li><a href="/graph/01de2d66a28d">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/01de2d66a28d">changeset</a></li>
+  <li><a href="/file/01de2d66a28d">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/01de2d66a28d/a">file</a></li>
+  <li><a href="/diff/01de2d66a28d/a">diff</a></li>
+  <li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
+  <li class="active">file log</li>
+  <li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log a</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>
+  
+  <div class="navigate">
+  <a href="/log/01de2d66a28d/a?revcount=30">less</a>
+  <a href="/log/01de2d66a28d/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/01de2d66a28d">second a</a></td>
+   </tr>
+   <tr class="parity1">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/log/01de2d66a28d/a?revcount=30">less</a>
+  <a href="/log/01de2d66a28d/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+first deleted - one revision
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/2/a')
+  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: a history</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log/tip/a" title="Atom feed for test:a" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log/tip/a" title="RSS feed for test:a" />
+  </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/5ed941583260">log</a></li>
+  <li><a href="/graph/5ed941583260">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/5ed941583260">changeset</a></li>
+  <li><a href="/file/5ed941583260">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/5ed941583260/a">file</a></li>
+  <li><a href="/diff/5ed941583260/a">diff</a></li>
+  <li><a href="/annotate/5ed941583260/a">annotate</a></li>
+  <li class="active">file log</li>
+  <li><a href="/raw-file/5ed941583260/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log a</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>
+  
+  <div class="navigate">
+  <a href="/log/5ed941583260/a?revcount=30">less</a>
+  <a href="/log/5ed941583260/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/log/5ed941583260/a?revcount=30">less</a>
+  <a href="/log/5ed941583260/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+first version - one revision
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/1/a')
+  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: a history</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log/tip/a" title="Atom feed for test:a" />
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log/tip/a" title="RSS feed for test:a" />
+  </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/5ed941583260">log</a></li>
+  <li><a href="/graph/5ed941583260">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/5ed941583260">changeset</a></li>
+  <li><a href="/file/5ed941583260">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/5ed941583260/a">file</a></li>
+  <li><a href="/diff/5ed941583260/a">diff</a></li>
+  <li><a href="/annotate/5ed941583260/a">annotate</a></li>
+  <li class="active">file log</li>
+  <li><a href="/raw-file/5ed941583260/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>log a</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>
+  
+  <div class="navigate">
+  <a href="/log/5ed941583260/a?revcount=30">less</a>
+  <a href="/log/5ed941583260/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> </div>
+  
+  <table class="bigtable">
+   <tr>
+    <th class="age">age</th>
+    <th class="author">author</th>
+    <th class="description">description</th>
+   </tr>
+   <tr class="parity0">
+    <td class="age">1970-01-01</td>
+    <td class="author">test</td>
+    <td class="description"><a href="/rev/5ed941583260">first a</a></td>
+   </tr>
+  
+  </table>
+  
+  <div class="navigate">
+  <a href="/log/5ed941583260/a?revcount=30">less</a>
+  <a href="/log/5ed941583260/a?revcount=120">more</a>
+  | <a href="/log/5ed941583260/a">(0)</a> <a href="/log/tip/a">tip</a> 
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+before addition - error
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/0/a')
+  404 Not Found
+  
+  <!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: error</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <ul>
+  <li><a href="/shortlog">log</a></li>
+  <li><a href="/graph">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>error</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>
+  
+  <div class="description">
+  <p>
+  An error occurred while processing your request:
+  </p>
+  <p>
+  a@6563da9dcf87: not found in manifest
+  </p>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  [1]
+
+should show base link, use spartan because it shows it
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/log/tip/c?style=spartan')
+  200 Script output follows
+  
+  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+  <html>
+  <head>
+  <link rel="icon" href="/static/hgicon.png" type="image/png">
+  <meta name="robots" content="index, nofollow" />
+  <link rel="stylesheet" href="/static/style.css" type="text/css" />
+  
+  <title>test: c history</title>
+  <link rel="alternate" type="application/atom+xml"
+     href="/atom-log/tip/c" title="Atom feed for test:c">
+  <link rel="alternate" type="application/rss+xml"
+     href="/rss-log/tip/c" title="RSS feed for test:c">
+  </head>
+  <body>
+  
+  <div class="buttons">
+  <a href="/log?style=spartan">changelog</a>
+  <a href="/shortlog?style=spartan">shortlog</a>
+  <a href="/graph?style=spartan">graph</a>
+  <a href="/tags?style=spartan">tags</a>
+  <a href="/branches?style=spartan">branches</a>
+  <a href="/file/b7682196df1c/c?style=spartan">file</a>
+  <a href="/annotate/b7682196df1c/c?style=spartan">annotate</a>
+  <a type="application/rss+xml" href="/rss-log/tip/c">rss</a>
+  <a type="application/atom+xml" href="/atom-log/tip/c" title="Atom feed for test:c">atom</a>
+  </div>
+  
+  <h2>c revision history</h2>
+  
+  <p>navigate: <small class="navigate"><a href="/log/1a6696706df2/c?style=spartan">(0)</a> <a href="/log/tip/c?style=spartan">tip</a> </small></p>
+  
+  <table class="logEntry parity0">
+   <tr>
+    <th class="age">1970-01-01:</th>
+    <th class="firstline"><a href="/rev/b7682196df1c?style=spartan">change c</a></th>
+   </tr>
+   <tr>
+    <th class="revision">revision 1:</td>
+    <td class="node">
+     <a href="/file/b7682196df1c/c?style=spartan">b7682196df1c</a>
+     <a href="/diff/b7682196df1c/c?style=spartan">(diff)</a>
+     <a href="/annotate/b7682196df1c/c?style=spartan">(annotate)</a>
+    </td>
+   </tr>
+   
+   <tr>
+    <th class="author">author:</th>
+    <td class="author">&#116;&#101;&#115;&#116;</td>
+   </tr>
+   <tr>
+    <th class="date">date:</th>
+    <td class="date">Thu Jan 01 00:00:00 1970 +0000</td>
+   </tr>
+  </table>
+  
+  
+  <table class="logEntry parity1">
+   <tr>
+    <th class="age">1970-01-01:</th>
+    <th class="firstline"><a href="/rev/1a6696706df2?style=spartan">mv b</a></th>
+   </tr>
+   <tr>
+    <th class="revision">revision 0:</td>
+    <td class="node">
+     <a href="/file/1a6696706df2/c?style=spartan">1a6696706df2</a>
+     <a href="/diff/1a6696706df2/c?style=spartan">(diff)</a>
+     <a href="/annotate/1a6696706df2/c?style=spartan">(annotate)</a>
+    </td>
+   </tr>
+   
+  <tr>
+  <th>base:</th>
+  <td>
+  <a href="/file/1e88685f5dde/b?style=spartan">
+  b@1e88685f5dde
+  </a>
+  </td>
+  </tr>
+   <tr>
+    <th class="author">author:</th>
+    <td class="author">&#116;&#101;&#115;&#116;</td>
+   </tr>
+   <tr>
+    <th class="date">date:</th>
+    <td class="date">Thu Jan 01 00:00:00 1970 +0000</td>
+   </tr>
+  </table>
+  
+  
+  
+  
+  
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
+  </div>
+  
+  </body>
+  </html>
+  
+
+errors
+
+  $ cat errors.log
--- a/tests/test-hgweb-no-path-info	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-# This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is
-# no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO
-# should be used from d74fc8dec2b4 onward to route the request.
-
-mkdir repo
-cd repo
-hg init
-echo foo > bar
-hg add bar
-hg commit -m "test"
-hg tip
-
-cat > request.py <<EOF
-from mercurial.hgweb import hgweb, hgwebdir
-from StringIO import StringIO
-import os, sys
-
-errors = StringIO()
-input = StringIO()
-
-def startrsp(status, headers):
-	print '---- STATUS'
-	print status
-	print '---- HEADERS'
-	print [i for i in headers if i[0] != 'ETag']
-	print '---- DATA'
-	return output.write
-
-env = {
-	'wsgi.version': (1, 0),
-	'wsgi.url_scheme': 'http',
-	'wsgi.errors': errors,
-	'wsgi.input': input,
-	'wsgi.multithread': False,
-	'wsgi.multiprocess': False,
-	'wsgi.run_once': False,
-	'REQUEST_METHOD': 'GET',
-	'SCRIPT_NAME': '',
-	'SERVER_NAME': '127.0.0.1',
-	'SERVER_PORT': os.environ['HGPORT'],
-	'SERVER_PROTOCOL': 'HTTP/1.0'
-}
-
-def process(app):
-    content = app(env, startrsp)
-    sys.stdout.write(output.getvalue())
-    sys.stdout.write(''.join(content))
-    print '---- ERRORS'
-    print errors.getvalue()
-
-output = StringIO()
-env['QUERY_STRING'] = 'style=atom'
-process(hgweb('.', name='repo'))
-
-output = StringIO()
-env['QUERY_STRING'] = 'style=raw'
-process(hgwebdir({'repo': '.'}))
-EOF
-
-python request.py | sed "s/http:\/\/127\.0\.0\.1:[0-9]*\//http:\/\/127.0.0.1\//"
--- a/tests/test-hgweb-no-path-info.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-changeset:   0:61c9426e69fe
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'application/atom+xml; charset=ascii')]
----- DATA
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/</id>
- <link rel="self" href="http://127.0.0.1/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/"/>
- <title>repo Changelog</title>
- <updated>1970-01-01T00:00:00+00:00</updated>
-
- <entry>
-  <title>test</title>
-  <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
-  <link href="http://127.0.0.1/rev/61c9426e69fe"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://www.w3.org/1999/xhtml">
-    <pre xml:space="preserve">test</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
----- ERRORS
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'text/plain; charset=ascii')]
----- DATA
-
-repo/
-
----- ERRORS
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-no-path-info.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,108 @@
+This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is
+no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO
+should be used from d74fc8dec2b4 onward to route the request.
+
+  $ mkdir repo
+  $ cd repo
+  $ hg init
+  $ echo foo > bar
+  $ hg add bar
+  $ hg commit -m "test"
+  $ hg tip
+  changeset:   0:61c9426e69fe
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  $ cat > request.py <<EOF
+  > from mercurial.hgweb import hgweb, hgwebdir
+  > from StringIO import StringIO
+  > import os, sys
+  > 
+  > errors = StringIO()
+  > input = StringIO()
+  > 
+  > def startrsp(status, headers):
+  > 	print '---- STATUS'
+  > 	print status
+  > 	print '---- HEADERS'
+  > 	print [i for i in headers if i[0] != 'ETag']
+  > 	print '---- DATA'
+  > 	return output.write
+  > 
+  > env = {
+  > 	'wsgi.version': (1, 0),
+  > 	'wsgi.url_scheme': 'http',
+  > 	'wsgi.errors': errors,
+  > 	'wsgi.input': input,
+  > 	'wsgi.multithread': False,
+  > 	'wsgi.multiprocess': False,
+  > 	'wsgi.run_once': False,
+  > 	'REQUEST_METHOD': 'GET',
+  > 	'SCRIPT_NAME': '',
+  > 	'SERVER_NAME': '127.0.0.1',
+  > 	'SERVER_PORT': os.environ['HGPORT'],
+  > 	'SERVER_PROTOCOL': 'HTTP/1.0'
+  > }
+  > 
+  > def process(app):
+  >     content = app(env, startrsp)
+  >     sys.stdout.write(output.getvalue())
+  >     sys.stdout.write(''.join(content))
+  >     print '---- ERRORS'
+  >     print errors.getvalue()
+  > 
+  > output = StringIO()
+  > env['QUERY_STRING'] = 'style=atom'
+  > process(hgweb('.', name='repo'))
+  > 
+  > output = StringIO()
+  > env['QUERY_STRING'] = 'style=raw'
+  > process(hgwebdir({'repo': '.'}))
+  > EOF
+  $ python request.py
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'application/atom+xml; charset=ascii')]
+  ---- DATA
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://127.0.0.1:*/</id> (glob)
+   <link rel="self" href="http://127.0.0.1:*/atom-log"/> (glob)
+   <link rel="alternate" href="http://127.0.0.1:*/"/> (glob)
+   <title>repo Changelog</title>
+   <updated>1970-01-01T00:00:00+00:00</updated>
+  
+   <entry>
+    <title>test</title>
+    <id>http://127.0.0.1:*/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
+    <link href="http://127.0.0.1:*/rev/61c9426e69fe"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">test</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  ---- ERRORS
+  
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'text/plain; charset=ascii')]
+  ---- DATA
+  
+  repo/
+  
+  ---- ERRORS
+  
--- a/tests/test-hgweb-no-request-uri	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-#!/bin/sh
-# This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is
-# no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO
-# should be used from d74fc8dec2b4 onward to route the request.
-
-mkdir repo
-cd repo
-hg init
-echo foo > bar
-hg add bar
-hg commit -m "test"
-hg tip
-
-cat > request.py <<EOF
-from mercurial.hgweb import hgweb, hgwebdir
-from StringIO import StringIO
-import os, sys
-
-errors = StringIO()
-input = StringIO()
-
-def startrsp(status, headers):
-	print '---- STATUS'
-	print status
-	print '---- HEADERS'
-	print [i for i in headers if i[0] != 'ETag']
-	print '---- DATA'
-	return output.write
-
-env = {
-	'wsgi.version': (1, 0),
-	'wsgi.url_scheme': 'http',
-	'wsgi.errors': errors,
-	'wsgi.input': input,
-	'wsgi.multithread': False,
-	'wsgi.multiprocess': False,
-	'wsgi.run_once': False,
-	'REQUEST_METHOD': 'GET',
-	'SCRIPT_NAME': '',
-	'SERVER_NAME': '127.0.0.1',
-	'SERVER_PORT': os.environ['HGPORT'],
-	'SERVER_PROTOCOL': 'HTTP/1.0'
-}
-
-def process(app):
-	content = app(env, startrsp)
-	sys.stdout.write(output.getvalue())
-	sys.stdout.write(''.join(content))
-	print '---- ERRORS'
-	print errors.getvalue()
-	
-
-output = StringIO()
-env['PATH_INFO'] = '/'
-env['QUERY_STRING'] = 'style=atom'
-process(hgweb('.', name = 'repo'))
-
-output = StringIO()
-env['PATH_INFO'] = '/file/tip/'
-env['QUERY_STRING'] = 'style=raw'
-process(hgweb('.', name = 'repo'))
-
-output = StringIO()
-env['PATH_INFO'] = '/'
-env['QUERY_STRING'] = 'style=raw'
-process(hgwebdir({'repo': '.'}))
-
-output = StringIO()
-env['PATH_INFO'] = '/repo/file/tip/'
-env['QUERY_STRING'] = 'style=raw'
-process(hgwebdir({'repo': '.'}))
-EOF
-
-python request.py | sed "s/http:\/\/127\.0\.0\.1:[0-9]*\//http:\/\/127.0.0.1\//"
--- a/tests/test-hgweb-no-request-uri.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-changeset:   0:61c9426e69fe
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'application/atom+xml; charset=ascii')]
----- DATA
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/</id>
- <link rel="self" href="http://127.0.0.1/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/"/>
- <title>repo Changelog</title>
- <updated>1970-01-01T00:00:00+00:00</updated>
-
- <entry>
-  <title>test</title>
-  <id>http://127.0.0.1/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id>
-  <link href="http://127.0.0.1/rev/61c9426e69fe"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:00+00:00</updated>
-  <published>1970-01-01T00:00:00+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://www.w3.org/1999/xhtml">
-    <pre xml:space="preserve">test</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
----- ERRORS
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'text/plain; charset=ascii')]
----- DATA
-
--rw-r--r-- 4 bar
-
-
----- ERRORS
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'text/plain; charset=ascii')]
----- DATA
-
-/repo/
-
----- ERRORS
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'text/plain; charset=ascii')]
----- DATA
-
--rw-r--r-- 4 bar
-
-
----- ERRORS
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-no-request-uri.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,143 @@
+This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is
+no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO
+should be used from d74fc8dec2b4 onward to route the request.
+
+  $ mkdir repo
+  $ cd repo
+  $ hg init
+  $ echo foo > bar
+  $ hg add bar
+  $ hg commit -m "test"
+  $ hg tip
+  changeset:   0:61c9426e69fe
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  $ cat > request.py <<EOF
+  > from mercurial.hgweb import hgweb, hgwebdir
+  > from StringIO import StringIO
+  > import os, sys
+  > 
+  > errors = StringIO()
+  > input = StringIO()
+  > 
+  > def startrsp(status, headers):
+  > 	print '---- STATUS'
+  > 	print status
+  > 	print '---- HEADERS'
+  > 	print [i for i in headers if i[0] != 'ETag']
+  > 	print '---- DATA'
+  > 	return output.write
+  > 
+  > env = {
+  > 	'wsgi.version': (1, 0),
+  > 	'wsgi.url_scheme': 'http',
+  > 	'wsgi.errors': errors,
+  > 	'wsgi.input': input,
+  > 	'wsgi.multithread': False,
+  > 	'wsgi.multiprocess': False,
+  > 	'wsgi.run_once': False,
+  > 	'REQUEST_METHOD': 'GET',
+  > 	'SCRIPT_NAME': '',
+  > 	'SERVER_NAME': '127.0.0.1',
+  > 	'SERVER_PORT': os.environ['HGPORT'],
+  > 	'SERVER_PROTOCOL': 'HTTP/1.0'
+  > }
+  > 
+  > def process(app):
+  > 	content = app(env, startrsp)
+  > 	sys.stdout.write(output.getvalue())
+  > 	sys.stdout.write(''.join(content))
+  > 	print '---- ERRORS'
+  > 	print errors.getvalue()
+  > 	
+  > 
+  > output = StringIO()
+  > env['PATH_INFO'] = '/'
+  > env['QUERY_STRING'] = 'style=atom'
+  > process(hgweb('.', name = 'repo'))
+  > 
+  > output = StringIO()
+  > env['PATH_INFO'] = '/file/tip/'
+  > env['QUERY_STRING'] = 'style=raw'
+  > process(hgweb('.', name = 'repo'))
+  > 
+  > output = StringIO()
+  > env['PATH_INFO'] = '/'
+  > env['QUERY_STRING'] = 'style=raw'
+  > process(hgwebdir({'repo': '.'}))
+  > 
+  > output = StringIO()
+  > env['PATH_INFO'] = '/repo/file/tip/'
+  > env['QUERY_STRING'] = 'style=raw'
+  > process(hgwebdir({'repo': '.'}))
+  > EOF
+  $ python request.py
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'application/atom+xml; charset=ascii')]
+  ---- DATA
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://127.0.0.1:*/</id> (glob)
+   <link rel="self" href="http://127.0.0.1:*/atom-log"/> (glob)
+   <link rel="alternate" href="http://127.0.0.1:*/"/> (glob)
+   <title>repo Changelog</title>
+   <updated>1970-01-01T00:00:00+00:00</updated>
+  
+   <entry>
+    <title>test</title>
+    <id>http://127.0.0.1:*/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
+    <link href="http://127.0.0.1:*/rev/61c9426e69fe"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:00+00:00</updated>
+    <published>1970-01-01T00:00:00+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">test</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  ---- ERRORS
+  
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'text/plain; charset=ascii')]
+  ---- DATA
+  
+  -rw-r--r-- 4 bar
+  
+  
+  ---- ERRORS
+  
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'text/plain; charset=ascii')]
+  ---- DATA
+  
+  /repo/
+  
+  ---- ERRORS
+  
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'text/plain; charset=ascii')]
+  ---- DATA
+  
+  -rw-r--r-- 4 bar
+  
+  
+  ---- ERRORS
+  
--- a/tests/test-hgweb-non-interactive	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-#!/bin/sh
-# Tests if hgweb can run without touching sys.stdin, as is required
-# by the WSGI standard and strictly implemented by mod_wsgi.
-
-mkdir repo
-cd repo
-hg init
-echo foo > bar
-hg add bar
-hg commit -m "test"
-hg tip
-
-cat > request.py <<EOF
-from mercurial import dispatch
-from mercurial.hgweb.hgweb_mod import hgweb
-from mercurial.ui import ui
-from mercurial import hg
-from StringIO import StringIO
-import os, sys
-
-class FileLike(object):
-    def __init__(self, real):
-        self.real = real
-    def fileno(self):
-        print >> sys.__stdout__, 'FILENO'
-        return self.real.fileno()
-    def read(self):
-        print >> sys.__stdout__, 'READ'
-        return self.real.read()
-    def readline(self):
-        print >> sys.__stdout__, 'READLINE'
-        return self.real.readline()
-
-sys.stdin = FileLike(sys.stdin)
-errors = StringIO()
-input = StringIO()
-output = StringIO()
-
-def startrsp(status, headers):
-	print '---- STATUS'
-	print status
-	print '---- HEADERS'
-	print [i for i in headers if i[0] != 'ETag']
-	print '---- DATA'
-	return output.write
-
-env = {
-	'wsgi.version': (1, 0),
-	'wsgi.url_scheme': 'http',
-	'wsgi.errors': errors,
-	'wsgi.input': input,
-	'wsgi.multithread': False,
-	'wsgi.multiprocess': False,
-	'wsgi.run_once': False,
-	'REQUEST_METHOD': 'GET',
-	'SCRIPT_NAME': '',
-	'PATH_INFO': '',
-	'QUERY_STRING': '',
-	'SERVER_NAME': '127.0.0.1',
-	'SERVER_PORT': os.environ['HGPORT'],
-	'SERVER_PROTOCOL': 'HTTP/1.0'
-}
-
-i = hgweb('.')
-i(env, startrsp)
-print '---- ERRORS'
-print errors.getvalue()
-print '---- OS.ENVIRON wsgi variables'
-print sorted([x for x in os.environ if x.startswith('wsgi')])
-print '---- request.ENVIRON wsgi variables'
-print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
-EOF
-
-python request.py
--- a/tests/test-hgweb-non-interactive.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-changeset:   0:61c9426e69fe
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
----- STATUS
-200 Script output follows
----- HEADERS
-[('Content-Type', 'text/html; charset=ascii')]
----- DATA
----- ERRORS
-
----- OS.ENVIRON wsgi variables
-[]
----- request.ENVIRON wsgi variables
-['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-non-interactive.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,81 @@
+Tests if hgweb can run without touching sys.stdin, as is required
+by the WSGI standard and strictly implemented by mod_wsgi.
+
+  $ mkdir repo
+  $ cd repo
+  $ hg init
+  $ echo foo > bar
+  $ hg add bar
+  $ hg commit -m "test"
+  $ cat > request.py <<EOF
+  > from mercurial import dispatch
+  > from mercurial.hgweb.hgweb_mod import hgweb
+  > from mercurial.ui import ui
+  > from mercurial import hg
+  > from StringIO import StringIO
+  > import os, sys
+  > 
+  > class FileLike(object):
+  >     def __init__(self, real):
+  >         self.real = real
+  >     def fileno(self):
+  >         print >> sys.__stdout__, 'FILENO'
+  >         return self.real.fileno()
+  >     def read(self):
+  >         print >> sys.__stdout__, 'READ'
+  >         return self.real.read()
+  >     def readline(self):
+  >         print >> sys.__stdout__, 'READLINE'
+  >         return self.real.readline()
+  > 
+  > sys.stdin = FileLike(sys.stdin)
+  > errors = StringIO()
+  > input = StringIO()
+  > output = StringIO()
+  > 
+  > def startrsp(status, headers):
+  > 	print '---- STATUS'
+  > 	print status
+  > 	print '---- HEADERS'
+  > 	print [i for i in headers if i[0] != 'ETag']
+  > 	print '---- DATA'
+  > 	return output.write
+  > 
+  > env = {
+  > 	'wsgi.version': (1, 0),
+  > 	'wsgi.url_scheme': 'http',
+  > 	'wsgi.errors': errors,
+  > 	'wsgi.input': input,
+  > 	'wsgi.multithread': False,
+  > 	'wsgi.multiprocess': False,
+  > 	'wsgi.run_once': False,
+  > 	'REQUEST_METHOD': 'GET',
+  > 	'SCRIPT_NAME': '',
+  > 	'PATH_INFO': '',
+  > 	'QUERY_STRING': '',
+  > 	'SERVER_NAME': '127.0.0.1',
+  > 	'SERVER_PORT': os.environ['HGPORT'],
+  > 	'SERVER_PROTOCOL': 'HTTP/1.0'
+  > }
+  > 
+  > i = hgweb('.')
+  > i(env, startrsp)
+  > print '---- ERRORS'
+  > print errors.getvalue()
+  > print '---- OS.ENVIRON wsgi variables'
+  > print sorted([x for x in os.environ if x.startswith('wsgi')])
+  > print '---- request.ENVIRON wsgi variables'
+  > print sorted([x for x in i.repo.ui.environ if x.startswith('wsgi')])
+  > EOF
+  $ python request.py
+  ---- STATUS
+  200 Script output follows
+  ---- HEADERS
+  [('Content-Type', 'text/html; charset=ascii')]
+  ---- DATA
+  ---- ERRORS
+  
+  ---- OS.ENVIRON wsgi variables
+  []
+  ---- request.ENVIRON wsgi variables
+  ['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
--- a/tests/test-hgweb-raw	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-hg init test
-cd test
-mkdir sub
-cat >'sub/some "text".txt' <<ENDSOME
-This is just some random text
-that will go inside the file and take a few lines.
-It is very boring to read, but computers don't
-care about things like that.
-ENDSOME
-hg add 'sub/some "text".txt'
-hg commit -d "1 0" -m "Just some text"
-hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
-
-sleep 5
-kill `cat hg.pid`
-sleep 1 # wait for server to scream and die
-cat getoutput.txt
-cat access.log error.log | \
-  sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/'
--- a/tests/test-hgweb-raw.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-200 Script output follows
-content-type: text/plain; charset="ascii"
-content-length: 157
-content-disposition: inline; filename="some \"text\".txt"
-
-This is just some random text
-that will go inside the file and take a few lines.
-It is very boring to read, but computers don't
-care about things like that.
-host - - [date] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 -
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-raw.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,34 @@
+Test raw style of hgweb
+
+  $ hg init test
+  $ cd test
+  $ mkdir sub
+  $ cat >'sub/some "text".txt' <<ENDSOME
+  > This is just some random text
+  > that will go inside the file and take a few lines.
+  > It is very boring to read, but computers don't
+  > care about things like that.
+  > ENDSOME
+  $ hg add 'sub/some "text".txt'
+  $ hg commit -d "1 0" -m "Just some text"
+
+  $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
+
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
+  $ sleep 5
+  $ kill `cat hg.pid`
+  $ sleep 1 # wait for server to scream and die
+  $ cat getoutput.txt
+  200 Script output follows
+  content-type: text/plain; charset="ascii"
+  content-length: 157
+  content-disposition: inline; filename="some \"text\".txt"
+  
+  This is just some random text
+  that will go inside the file and take a few lines.
+  It is very boring to read, but computers don't
+  care about things like that.
+  $ cat access.log error.log
+  127.0.0.1 - - [*] "GET /?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw HTTP/1.1" 200 - (glob)
+
--- a/tests/test-hgweb-removed	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-echo % setting up repo
-hg init test
-cd test
-echo a > a
-hg ci -Ama
-hg rm a
-hg ci -mdel
-
-echo % set up hgweb
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % revision
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip'
-
-echo % diff removed file
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
--- a/tests/test-hgweb-removed.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-% setting up repo
-adding a
-% set up hgweb
-% revision
-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: c78f6c5cbea9</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/c78f6c5cbea9">log</a></li>
- <li><a href="/graph/c78f6c5cbea9">graph</a></li>
- <li><a href="/tags">tags</a></li>
- <li><a href="/branches">branches</a></li>
-</ul>
-<ul>
- <li class="active">changeset</li>
- <li><a href="/raw-rev/c78f6c5cbea9">raw</a></li>
- <li><a href="/file/c78f6c5cbea9">browse</a></li>
-</ul>
-<ul>
- 
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>changeset 1:c78f6c5cbea9  <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>
-
-<div class="description">del</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"><a href="/rev/cb9a9f314b8b">cb9a9f314b8b</a> </td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="files">files</th>
- <td class="files">a </td>
-</tr>
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -1,1 +0,0 @@
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="minusline">-a
-</span></pre></div>
-</div>
-
-</div>
-</div>
-
-
-</body>
-</html>
-
-% diff removed 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: a diff</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/c78f6c5cbea9">log</a></li>
-<li><a href="/graph/c78f6c5cbea9">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/c78f6c5cbea9">changeset</a></li>
-<li><a href="/file/c78f6c5cbea9">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/c78f6c5cbea9/a">file</a></li>
-<li><a href="/file/tip/a">latest</a></li>
-<li class="active">diff</li>
-<li><a href="/annotate/c78f6c5cbea9/a">annotate</a></li>
-<li><a href="/log/c78f6c5cbea9/a">file log</a></li>
-<li><a href="/raw-file/c78f6c5cbea9/a">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>diff a @ 1:c78f6c5cbea9</h3>
-
-<form class="search" action="/log">
-<p></p>
-<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>
-
-<div class="description">del</div>
-
-<table id="changesetEntry">
-<tr>
- <th>author</th>
- <td>&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th>date</th>
- <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th>parents</th>
- <td><a href="/file/cb9a9f314b8b/a">cb9a9f314b8b</a> </td>
-</tr>
-<tr>
- <th>children</th>
- <td></td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<div class="sourcefirst">   line diff</div>
-
-<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
-</span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -1,1 +0,0 @@
-</span><a href="#l1.4" id="l1.4">     1.4</a> <span class="minusline">-a
-</span></pre></div>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb-removed.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,198 @@
+setting up repo
+
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ hg rm a
+  $ hg ci -mdel
+
+set up hgweb
+
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip'
+  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: c78f6c5cbea9</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/c78f6c5cbea9">log</a></li>
+   <li><a href="/graph/c78f6c5cbea9">graph</a></li>
+   <li><a href="/tags">tags</a></li>
+   <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+   <li class="active">changeset</li>
+   <li><a href="/raw-rev/c78f6c5cbea9">raw</a></li>
+   <li><a href="/file/c78f6c5cbea9">browse</a></li>
+  </ul>
+  <ul>
+   
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>changeset 1:c78f6c5cbea9  <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>
+  
+  <div class="description">del</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td></tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"><a href="/rev/cb9a9f314b8b">cb9a9f314b8b</a> </td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="files">files</th>
+   <td class="files">a </td>
+  </tr>
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -1,1 +0,0 @@
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="minusline">-a
+  </span></pre></div>
+  </div>
+  
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+
+diff removed file
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
+  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: a diff</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/c78f6c5cbea9">log</a></li>
+  <li><a href="/graph/c78f6c5cbea9">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/c78f6c5cbea9">changeset</a></li>
+  <li><a href="/file/c78f6c5cbea9">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/c78f6c5cbea9/a">file</a></li>
+  <li><a href="/file/tip/a">latest</a></li>
+  <li class="active">diff</li>
+  <li><a href="/annotate/c78f6c5cbea9/a">annotate</a></li>
+  <li><a href="/log/c78f6c5cbea9/a">file log</a></li>
+  <li><a href="/raw-file/c78f6c5cbea9/a">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>diff a @ 1:c78f6c5cbea9</h3>
+  
+  <form class="search" action="/log">
+  <p></p>
+  <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>
+  
+  <div class="description">del</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th>author</th>
+   <td>&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th>date</th>
+   <td>Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th>parents</th>
+   <td><a href="/file/cb9a9f314b8b/a">cb9a9f314b8b</a> </td>
+  </tr>
+  <tr>
+   <th>children</th>
+   <td></td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst">   line diff</div>
+  
+  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.2" id="l1.2">     1.2</a> <span class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </span><a href="#l1.3" id="l1.3">     1.3</a> <span class="atline">@@ -1,1 +0,0 @@
+  </span><a href="#l1.4" id="l1.4">     1.4</a> <span class="minusline">-a
+  </span></pre></div>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
--- a/tests/test-hgweb.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,370 +0,0 @@
-adding da/foo
-adding foo
-% manifest
-200 Script output follows
-
-
-drwxr-xr-x da
--rw-r--r-- 4 foo
-
-
-200 Script output follows
-
-
--rw-r--r-- 4 foo
-
-
-% plain file
-200 Script output follows
-
-foo
-% should give a 404 - static file that does not exist
-404 Not Found
-
-<!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: error</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<div class="logo">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<ul>
-<li><a href="/shortlog">log</a></li>
-<li><a href="/graph">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>error</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>
-
-<div class="description">
-<p>
-An error occurred while processing your request:
-</p>
-<p>
-Not Found
-</p>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% should give a 404 - bad revision
-404 Not Found
-
-
-error: revision not found: spam
-% should give a 400 - bad command
-400
-
-
-error: no such method: spam
-% should give a 404 - file does not exist
-404 Not Found
-
-
-error: bork@2ef0ac749a14: not found in manifest
-404 Not Found
-
-<!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: error</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<div class="logo">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<ul>
-<li><a href="/shortlog">log</a></li>
-<li><a href="/graph">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-</div>
-
-<div class="main">
-
-<h2><a href="/">test</a></h2>
-<h3>error</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>
-
-<div class="description">
-<p>
-An error occurred while processing your request:
-</p>
-<p>
-bork@2ef0ac749a14: not found in manifest
-</p>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-404 Not Found
-
-
-error: bork@2ef0ac749a14: not found in manifest
-% try bad style
-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: 2ef0ac749a14 /</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/2ef0ac749a14">log</a></li>
-<li><a href="/graph/2ef0ac749a14">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/2ef0ac749a14">changeset</a></li>
-<li class="active">browse</li>
-</ul>
-<ul>
-
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>directory / @ 0:2ef0ac749a14 <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/2ef0ac749a14/">[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/2ef0ac749a14/da">
-<img src="/static/coal-folder.png" alt="dir."/> da/
-</a>
-<a href="/file/2ef0ac749a14/da/">
-
-</a>
-</td>
-<td class="size"></td>
-<td class="permissions">drwxr-xr-x</td>
-</tr>
-
-<tr class="fileline parity0">
-<td class="filename">
-<a href="/file/2ef0ac749a14/foo">
-<img src="/static/coal-file.png" alt="file"/> foo
-</a>
-</td>
-<td class="size">4</td>
-<td class="permissions">-rw-r--r--</td>
-</tr>
-</table>
-</div>
-</div>
-
-
-</body>
-</html>
-
-% stop and restart
-10 log lines written
-% static file
-200 Script output follows
-
-body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
-a { color:#0000cc; }
-a:hover, a:visited, a:active { color:#880000; }
-div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
-div.page_header a:visited { color:#0000cc; }
-div.page_header a:hover { color:#880000; }
-div.page_nav { padding:8px; }
-div.page_nav a:visited { color:#0000cc; }
-div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
-div.page_footer { padding:4px 8px; background-color: #d9d8d1; }
-div.page_footer_text { float:left; color:#555555; font-style:italic; }
-div.page_body { padding:8px; }
-div.title, a.title {
-	display:block; padding:6px 8px;
-	font-weight:bold; background-color:#edece6; text-decoration:none; color:#000000;
-}
-a.title:hover { background-color: #d9d8d1; }
-div.title_text { padding:6px 0px; border: solid #d9d8d1; border-width:0px 0px 1px; }
-div.log_body { padding:8px 8px 8px 150px; }
-.age { white-space:nowrap; }
-span.age { position:relative; float:left; width:142px; font-style:italic; }
-div.log_link {
-	padding:0px 8px;
-	font-size:10px; font-family:sans-serif; font-style:normal;
-	position:relative; float:left; width:136px;
-}
-div.list_head { padding:6px 8px 4px; border:solid #d9d8d1; border-width:1px 0px 0px; font-style:italic; }
-a.list { text-decoration:none; color:#000000; }
-a.list:hover { text-decoration:underline; color:#880000; }
-table { padding:8px 4px; }
-th { padding:2px 5px; font-size:12px; text-align:left; }
-tr.light:hover, .parity0:hover { background-color:#edece6; }
-tr.dark, .parity1 { background-color:#f6f6f0; }
-tr.dark:hover, .parity1:hover { background-color:#edece6; }
-td { padding:2px 5px; font-size:12px; vertical-align:top; }
-td.closed { background-color: #99f; }
-td.link { padding:2px 5px; font-family:sans-serif; font-size:10px; }
-td.indexlinks { white-space: nowrap; }
-td.indexlinks a {
-  padding: 2px 5px; line-height: 10px;
-  border: 1px solid;
-  color: #ffffff; background-color: #7777bb;
-  border-color: #aaaadd #333366 #333366 #aaaadd;
-  font-weight: bold;  text-align: center; text-decoration: none;
-  font-size: 10px;
-}
-td.indexlinks a:hover { background-color: #6666aa; }
-div.pre { font-family:monospace; font-size:12px; white-space:pre; }
-div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
-div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
-div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
-.linenr { color:#999999; text-decoration:none }
-div.rss_logo { float: right; white-space: nowrap; }
-div.rss_logo a {
-	padding:3px 6px; line-height:10px;
-	border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
-	color:#ffffff; background-color:#ff6600;
-	font-weight:bold; font-family:sans-serif; font-size:10px;
-	text-align:center; text-decoration:none;
-}
-div.rss_logo a:hover { background-color:#ee5500; }
-pre { margin: 0; }
-span.logtags span {
-	padding: 0px 4px;
-	font-size: 10px;
-	font-weight: normal;
-	border: 1px solid;
-	background-color: #ffaaff;
-	border-color: #ffccff #ff00ee #ff00ee #ffccff;
-}
-span.logtags span.tagtag {
-	background-color: #ffffaa;
-	border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
-}
-span.logtags span.branchtag {
-	background-color: #aaffaa;
-	border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
-}
-span.logtags span.inbranchtag {
-	background-color: #d5dde6;
-	border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
-}
-
-/* Graph */
-div#wrapper {
-	position: relative;
-	margin: 0;
-	padding: 0;
-	margin-top: 3px;
-}
-
-canvas {
-	position: absolute;
-	z-index: 5;
-	top: -0.9em;
-	margin: 0;
-}
-
-ul#nodebgs {
-	list-style: none inside none;
-	padding: 0;
-	margin: 0;
-	top: -0.7em;
-}
-
-ul#graphnodes li, ul#nodebgs li {
-	height: 39px;
-}
-
-ul#graphnodes {
-	position: absolute;
-	z-index: 10;
-	top: -0.8em;
-	list-style: none inside none;
-	padding: 0;
-}
-
-ul#graphnodes li .info {
-	display: block;
-	font-size: 100%;
-	position: relative;
-	top: -3px;
-	font-style: italic;
-}
-304 Not Modified
-
-% errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgweb.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,425 @@
+Some tests for hgweb. Tests static files, plain files and different 404's.
+
+  $ hg init test
+  $ cd test
+  $ mkdir da
+  $ echo foo > da/foo
+  $ echo foo > foo
+  $ hg ci -Ambase
+  adding da/foo
+  adding foo
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+manifest
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw')
+  200 Script output follows
+  
+  
+  drwxr-xr-x da
+  -rw-r--r-- 4 foo
+  
+  
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw')
+  200 Script output follows
+  
+  
+  -rw-r--r-- 4 foo
+  
+  
+
+plain file
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?style=raw'
+  200 Script output follows
+  
+  foo
+
+should give a 404 - static file that does not exist
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/static/bogus'
+  404 Not Found
+  
+  <!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: error</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <ul>
+  <li><a href="/shortlog">log</a></li>
+  <li><a href="/graph">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>error</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>
+  
+  <div class="description">
+  <p>
+  An error occurred while processing your request:
+  </p>
+  <p>
+  Not Found
+  </p>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  [1]
+
+should give a 404 - bad revision
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/spam/foo?style=raw'
+  404 Not Found
+  
+  
+  error: revision not found: spam
+  [1]
+
+should give a 400 - bad command
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/foo?cmd=spam&style=raw'
+  400* (glob)
+  
+  
+  error: no such method: spam
+  [1]
+
+should give a 404 - file does not exist
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork?style=raw'
+  404 Not Found
+  
+  
+  error: bork@2ef0ac749a14: not found in manifest
+  [1]
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/bork'
+  404 Not Found
+  
+  <!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: error</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <div class="logo">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <ul>
+  <li><a href="/shortlog">log</a></li>
+  <li><a href="/graph">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  
+  <h2><a href="/">test</a></h2>
+  <h3>error</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>
+  
+  <div class="description">
+  <p>
+  An error occurred while processing your request:
+  </p>
+  <p>
+  bork@2ef0ac749a14: not found in manifest
+  </p>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+  [1]
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/bork?style=raw'
+  404 Not Found
+  
+  
+  error: bork@2ef0ac749a14: not found in manifest
+  [1]
+
+try bad style
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=foobar')
+  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: 2ef0ac749a14 /</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/2ef0ac749a14">log</a></li>
+  <li><a href="/graph/2ef0ac749a14">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/2ef0ac749a14">changeset</a></li>
+  <li class="active">browse</li>
+  </ul>
+  <ul>
+  
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>directory / @ 0:2ef0ac749a14 <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/2ef0ac749a14/">[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/2ef0ac749a14/da">
+  <img src="/static/coal-folder.png" alt="dir."/> da/
+  </a>
+  <a href="/file/2ef0ac749a14/da/">
+  
+  </a>
+  </td>
+  <td class="size"></td>
+  <td class="permissions">drwxr-xr-x</td>
+  </tr>
+  
+  <tr class="fileline parity0">
+  <td class="filename">
+  <a href="/file/2ef0ac749a14/foo">
+  <img src="/static/coal-file.png" alt="file"/> foo
+  </a>
+  </td>
+  <td class="size">4</td>
+  <td class="permissions">-rw-r--r--</td>
+  </tr>
+  </table>
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+
+stop and restart
+
+  $ "$TESTDIR/killdaemons.py"
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+Test the access/error files are opened in append mode
+
+  $ python -c "print len(file('access.log').readlines()), 'log lines written'"
+  10 log lines written
+
+static file
+
+  $ "$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT '/static/style-gitweb.css'
+  200 Script output follows
+  
+  body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
+  a { color:#0000cc; }
+  a:hover, a:visited, a:active { color:#880000; }
+  div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; }
+  div.page_header a:visited { color:#0000cc; }
+  div.page_header a:hover { color:#880000; }
+  div.page_nav { padding:8px; }
+  div.page_nav a:visited { color:#0000cc; }
+  div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px}
+  div.page_footer { padding:4px 8px; background-color: #d9d8d1; }
+  div.page_footer_text { float:left; color:#555555; font-style:italic; }
+  div.page_body { padding:8px; }
+  div.title, a.title {
+  	display:block; padding:6px 8px;
+  	font-weight:bold; background-color:#edece6; text-decoration:none; color:#000000;
+  }
+  a.title:hover { background-color: #d9d8d1; }
+  div.title_text { padding:6px 0px; border: solid #d9d8d1; border-width:0px 0px 1px; }
+  div.log_body { padding:8px 8px 8px 150px; }
+  .age { white-space:nowrap; }
+  span.age { position:relative; float:left; width:142px; font-style:italic; }
+  div.log_link {
+  	padding:0px 8px;
+  	font-size:10px; font-family:sans-serif; font-style:normal;
+  	position:relative; float:left; width:136px;
+  }
+  div.list_head { padding:6px 8px 4px; border:solid #d9d8d1; border-width:1px 0px 0px; font-style:italic; }
+  a.list { text-decoration:none; color:#000000; }
+  a.list:hover { text-decoration:underline; color:#880000; }
+  table { padding:8px 4px; }
+  th { padding:2px 5px; font-size:12px; text-align:left; }
+  tr.light:hover, .parity0:hover { background-color:#edece6; }
+  tr.dark, .parity1 { background-color:#f6f6f0; }
+  tr.dark:hover, .parity1:hover { background-color:#edece6; }
+  td { padding:2px 5px; font-size:12px; vertical-align:top; }
+  td.closed { background-color: #99f; }
+  td.link { padding:2px 5px; font-family:sans-serif; font-size:10px; }
+  td.indexlinks { white-space: nowrap; }
+  td.indexlinks a {
+    padding: 2px 5px; line-height: 10px;
+    border: 1px solid;
+    color: #ffffff; background-color: #7777bb;
+    border-color: #aaaadd #333366 #333366 #aaaadd;
+    font-weight: bold;  text-align: center; text-decoration: none;
+    font-size: 10px;
+  }
+  td.indexlinks a:hover { background-color: #6666aa; }
+  div.pre { font-family:monospace; font-size:12px; white-space:pre; }
+  div.diff_info { font-family:monospace; color:#000099; background-color:#edece6; font-style:italic; }
+  div.index_include { border:solid #d9d8d1; border-width:0px 0px 1px; padding:12px 8px; }
+  div.search { margin:4px 8px; position:absolute; top:56px; right:12px }
+  .linenr { color:#999999; text-decoration:none }
+  div.rss_logo { float: right; white-space: nowrap; }
+  div.rss_logo a {
+  	padding:3px 6px; line-height:10px;
+  	border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e;
+  	color:#ffffff; background-color:#ff6600;
+  	font-weight:bold; font-family:sans-serif; font-size:10px;
+  	text-align:center; text-decoration:none;
+  }
+  div.rss_logo a:hover { background-color:#ee5500; }
+  pre { margin: 0; }
+  span.logtags span {
+  	padding: 0px 4px;
+  	font-size: 10px;
+  	font-weight: normal;
+  	border: 1px solid;
+  	background-color: #ffaaff;
+  	border-color: #ffccff #ff00ee #ff00ee #ffccff;
+  }
+  span.logtags span.tagtag {
+  	background-color: #ffffaa;
+  	border-color: #ffffcc #ffee00 #ffee00 #ffffcc;
+  }
+  span.logtags span.branchtag {
+  	background-color: #aaffaa;
+  	border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
+  }
+  span.logtags span.inbranchtag {
+  	background-color: #d5dde6;
+  	border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
+  }
+  
+  /* Graph */
+  div#wrapper {
+  	position: relative;
+  	margin: 0;
+  	padding: 0;
+  	margin-top: 3px;
+  }
+  
+  canvas {
+  	position: absolute;
+  	z-index: 5;
+  	top: -0.9em;
+  	margin: 0;
+  }
+  
+  ul#nodebgs {
+  	list-style: none inside none;
+  	padding: 0;
+  	margin: 0;
+  	top: -0.7em;
+  }
+  
+  ul#graphnodes li, ul#nodebgs li {
+  	height: 39px;
+  }
+  
+  ul#graphnodes {
+  	position: absolute;
+  	z-index: 10;
+  	top: -0.8em;
+  	list-style: none inside none;
+  	padding: 0;
+  }
+  
+  ul#graphnodes li .info {
+  	display: block;
+  	font-size: 100%;
+  	position: relative;
+  	top: -3px;
+  	font-style: italic;
+  }
+  304 Not Modified
+  
+
+errors
+
+  $ cat errors.log
--- a/tests/test-hgwebdir	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-#!/bin/sh
-# Tests some basic hgwebdir functionality. Tests setting up paths and
-# collection, different forms of 404s and the subdirectory support.
-
-mkdir webdir
-cd webdir
-
-hg init a
-echo a > a/a
-hg --cwd a ci -Ama -d'1 0'
-# create a mercurial queue repository
-hg --cwd a qinit --config extensions.hgext.mq= -c
-
-hg init b
-echo b > b/b
-hg --cwd b ci -Amb -d'2 0'
-
-# create a nested repository
-cd b
-hg init d
-echo d > d/d
-hg --cwd d ci -Amd -d'3 0'
-cd ..
-
-hg init c
-echo c > c/c
-hg --cwd c ci -Amc -d'3 0'
-
-# create repository without .hg/store
-hg init nostore
-rm -R nostore/.hg/store
-
-root=`pwd`
-cd ..
-
-
-cat > paths.conf <<EOF
-[paths]
-a=$root/a
-b=$root/b
-EOF
-
-hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \
-    -A access-paths.log -E error-paths-1.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % should give a 404 - file does not exist
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw'
-
-echo % should succeed
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
-
-echo % should give a 404 - repo is not published
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
-
-echo % atom-log without basedir
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' \
-    | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-echo % rss-log without basedir
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/rss-log' \
-    | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-cat > paths.conf <<EOF
-[paths]
-t/a/=$root/a
-b=$root/b
-coll=$root/*
-rcoll=$root/**
-star=*
-starstar=**
-EOF
-
-hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
-    -A access-paths.log -E error-paths-2.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % should succeed, slashy names
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' \
-	| sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/"
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' \
-	| sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/"
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \
-	| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \
-	| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
-# Test [paths] '*' extension
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
-#test [paths] '**' extension
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
-
-
-"$TESTDIR/killdaemons.py"
-cat > paths.conf <<EOF
-[paths]
-t/a = $root/a
-t/b = $root/b
-c = $root/c
-[web]
-descend=false
-EOF
-
-hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
-    -A access-paths.log -E error-paths-3.log
-cat hg.pid >> $DAEMON_PIDS
-echo % test descend = False
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
-
-
-"$TESTDIR/killdaemons.py"
-cat > paths.conf <<EOF
-[paths]
-nostore = $root/nostore
-inexistent = $root/inexistent
-EOF
-
-hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
-    -A access-paths.log -E error-paths-4.log
-cat hg.pid >> $DAEMON_PIDS
-echo % test inexistent and inaccessible repo should be ignored silently
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/'
-
-
-cat > collections.conf <<EOF
-[collections]
-$root=$root
-EOF
-
-hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \
-    --pid-file=hg.pid --webdir-conf collections.conf \
-    -A access-collections.log -E error-collections.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % collections: should succeed
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
-
-echo % atom-log with basedir /
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \
-    | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-echo % rss-log with basedir /
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \
-    | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-"$TESTDIR/killdaemons.py"
-
-hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \
-    --pid-file=hg.pid --webdir-conf collections.conf \
-    -A access-collections-2.log -E error-collections-2.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % atom-log with basedir /foo/
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \
-    | grep '<link' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-echo % rss-log with basedir /foo/
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \
-    | grep '<guid' | sed 's|//[.a-zA-Z0-9_-]*:[0-9][0-9]*/|//example.com:8080/|'
-
-echo % paths errors 1
-cat error-paths-1.log
-echo % paths errors 2
-cat error-paths-2.log
-echo % paths errors 3
-cat error-paths-3.log
-echo % collections errors
-cat error-collections.log
-echo % collections errors 2
-cat error-collections-2.log
--- a/tests/test-hgwebdir.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,482 +0,0 @@
-adding a
-adding b
-adding d
-adding c
-% should give a 404 - file does not exist
-404 Not Found
-
-
-error: bork@8580ff50825a: not found in manifest
-% should succeed
-200 Script output follows
-
-
-/a/
-/b/
-
-200 Script output follows
-
-a
-200 Script output follows
-
-b
-% should give a 404 - repo is not published
-404 Not Found
-
-
-error: repository c not found
-% atom-log without basedir
- <link rel="self" href="http://example.com:8080/a/atom-log"/>
- <link rel="alternate" href="http://example.com:8080/a/"/>
-  <link href="http://example.com:8080/a/rev/8580ff50825a"/>
-% rss-log without basedir
-    <guid isPermaLink="true">http://example.com:8080/a/rev/8580ff50825a</guid>
-% should succeed, slashy names
-200 Script output follows
-
-
-/t/a/
-/b/
-/coll/a/
-/coll/a/.hg/patches/
-/coll/b/
-/coll/c/
-/rcoll/a/
-/rcoll/a/.hg/patches/
-/rcoll/b/
-/rcoll/b/d/
-/rcoll/c/
-/star/webdir/a/
-/star/webdir/a/.hg/patches/
-/star/webdir/b/
-/star/webdir/c/
-/starstar/webdir/a/
-/starstar/webdir/a/.hg/patches/
-/starstar/webdir/b/
-/starstar/webdir/b/d/
-/starstar/webdir/c/
-
-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>Mercurial repositories index</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<div class="main">
-<h2>Mercurial Repositories</h2>
-
-<table class="bigtable">
-    <tr>
-        <th><a href="?sort=name">Name</a></th>
-        <th><a href="?sort=description">Description</a></th>
-        <th><a href="?sort=contact">Contact</a></th>
-        <th><a href="?sort=lastchange">Last modified</a></th>
-        <th>&nbsp;</th>
-    </tr>
-    
-<tr class="parity0">
-<td><a href="/t/a/?style=paper">t/a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/b/?style=paper">b</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/coll/a/?style=paper">coll/a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/coll/b/?style=paper">coll/b</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/coll/c/?style=paper">coll/c</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/rcoll/a/?style=paper">rcoll/a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/rcoll/b/?style=paper">rcoll/b</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/rcoll/c/?style=paper">rcoll/c</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/star/webdir/a/?style=paper">star/webdir/a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/star/webdir/a/.hg/patches/?style=paper">star/webdir/a/.hg/patches</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/star/webdir/b/?style=paper">star/webdir/b</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/star/webdir/c/?style=paper">star/webdir/c</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/starstar/webdir/a/?style=paper">starstar/webdir/a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/starstar/webdir/a/.hg/patches/?style=paper">starstar/webdir/a/.hg/patches</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/starstar/webdir/b/?style=paper">starstar/webdir/b</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity0">
-<td><a href="/starstar/webdir/b/d/?style=paper">starstar/webdir/b/d</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-<tr class="parity1">
-<td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-</table>
-</div>
-</div>
-
-
-</body>
-</html>
-
-200 Script output follows
-
-
-/t/a/
-
-200 Script output follows
-
-
-/t/a/
-
-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>Mercurial repositories index</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<div class="main">
-<h2>Mercurial Repositories</h2>
-
-<table class="bigtable">
-    <tr>
-        <th><a href="?sort=name">Name</a></th>
-        <th><a href="?sort=description">Description</a></th>
-        <th><a href="?sort=contact">Contact</a></th>
-        <th><a href="?sort=lastchange">Last modified</a></th>
-        <th>&nbsp;</th>
-    </tr>
-    
-<tr class="parity0">
-<td><a href="/t/a/?style=paper">a</a></td>
-<td>unknown</td>
-<td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
-<td class="age">seconds ago</td>
-<td class="indexlinks"></td>
-</tr>
-
-</table>
-</div>
-</div>
-
-
-</body>
-</html>
-
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://127.0.0.1/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/t/a/</id>
- <link rel="self" href="http://127.0.0.1/t/a/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/t/a/"/>
- <title>t/a Changelog</title>
- <updated>1970-01-01T00:00:01+00:00</updated>
-
- <entry>
-  <title>a</title>
-  <id>http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id>
-  <link href="http://127.0.0.1/t/a/rev/8580ff50825a"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:01+00:00</updated>
-  <published>1970-01-01T00:00:01+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">a</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
-200 Script output follows
-
-<?xml version="1.0" encoding="ascii"?>
-<feed xmlns="http://127.0.0.1/2005/Atom">
- <!-- Changelog -->
- <id>http://127.0.0.1/t/a/</id>
- <link rel="self" href="http://127.0.0.1/t/a/atom-log"/>
- <link rel="alternate" href="http://127.0.0.1/t/a/"/>
- <title>t/a Changelog</title>
- <updated>1970-01-01T00:00:01+00:00</updated>
-
- <entry>
-  <title>a</title>
-  <id>http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id>
-  <link href="http://127.0.0.1/t/a/rev/8580ff50825a"/>
-  <author>
-   <name>test</name>
-   <email>&#116;&#101;&#115;&#116;</email>
-  </author>
-  <updated>1970-01-01T00:00:01+00:00</updated>
-  <published>1970-01-01T00:00:01+00:00</published>
-  <content type="xhtml">
-   <div xmlns="http://127.0.0.1/1999/xhtml">
-    <pre xml:space="preserve">a</pre>
-   </div>
-  </content>
- </entry>
-
-</feed>
-200 Script output follows
-
-a
-200 Script output follows
-
-
-/coll/a/
-/coll/a/.hg/patches/
-/coll/b/
-/coll/c/
-
-200 Script output follows
-
-a
-200 Script output follows
-
-
-/rcoll/a/
-/rcoll/a/.hg/patches/
-/rcoll/b/
-/rcoll/b/d/
-/rcoll/c/
-
-200 Script output follows
-
-d
-% test descend = False
-200 Script output follows
-
-
-/c/
-
-200 Script output follows
-
-
-/t/a/
-/t/b/
-
-% test inexistent and inaccessible repo should be ignored silently
-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>Mercurial repositories index</title>
-</head>
-<body>
-
-<div class="container">
-<div class="menu">
-<a href="http://mercurial.selenic.com/">
-<img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
-</div>
-<div class="main">
-<h2>Mercurial Repositories</h2>
-
-<table class="bigtable">
-    <tr>
-        <th><a href="?sort=name">Name</a></th>
-        <th><a href="?sort=description">Description</a></th>
-        <th><a href="?sort=contact">Contact</a></th>
-        <th><a href="?sort=lastchange">Last modified</a></th>
-        <th>&nbsp;</th>
-    </tr>
-    
-</table>
-</div>
-</div>
-
-
-</body>
-</html>
-
-% collections: should succeed
-200 Script output follows
-
-
-/a/
-/a/.hg/patches/
-/b/
-/c/
-
-200 Script output follows
-
-a
-200 Script output follows
-
-b
-200 Script output follows
-
-c
-% atom-log with basedir /
- <link rel="self" href="http://example.com:8080/a/atom-log"/>
- <link rel="alternate" href="http://example.com:8080/a/"/>
-  <link href="http://example.com:8080/a/rev/8580ff50825a"/>
-% rss-log with basedir /
-    <guid isPermaLink="true">http://example.com:8080/a/rev/8580ff50825a</guid>
-% atom-log with basedir /foo/
- <link rel="self" href="http://example.com:8080/foo/a/atom-log"/>
- <link rel="alternate" href="http://example.com:8080/foo/a/"/>
-  <link href="http://example.com:8080/foo/a/rev/8580ff50825a"/>
-% rss-log with basedir /foo/
-    <guid isPermaLink="true">http://example.com:8080/foo/a/rev/8580ff50825a</guid>
-% paths errors 1
-% paths errors 2
-% paths errors 3
-% collections errors
-% collections errors 2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgwebdir.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,648 @@
+Tests some basic hgwebdir functionality. Tests setting up paths and
+collection, different forms of 404s and the subdirectory support.
+
+  $ mkdir webdir
+  $ cd webdir
+  $ hg init a
+  $ echo a > a/a
+  $ hg --cwd a ci -Ama -d'1 0'
+  adding a
+
+create a mercurial queue repository
+
+  $ hg --cwd a qinit --config extensions.hgext.mq= -c
+  $ hg init b
+  $ echo b > b/b
+  $ hg --cwd b ci -Amb -d'2 0'
+  adding b
+
+create a nested repository
+
+  $ cd b
+  $ hg init d
+  $ echo d > d/d
+  $ hg --cwd d ci -Amd -d'3 0'
+  adding d
+  $ cd ..
+  $ hg init c
+  $ echo c > c/c
+  $ hg --cwd c ci -Amc -d'3 0'
+  adding c
+
+create repository without .hg/store
+
+  $ hg init nostore
+  $ rm -R nostore/.hg/store
+  $ root=`pwd`
+  $ cd ..
+  $ cat > paths.conf <<EOF
+  > [paths]
+  > a=$root/a
+  > b=$root/b
+  > EOF
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \
+  >     -A access-paths.log -E error-paths-1.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+should give a 404 - file does not exist
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/bork?style=raw'
+  404 Not Found
+  
+  
+  error: bork@8580ff50825a: not found in manifest
+  [1]
+
+should succeed
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
+  200 Script output follows
+  
+  
+  /a/
+  /b/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/file/tip/a?style=raw'
+  200 Script output follows
+  
+  a
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
+  200 Script output follows
+  
+  b
+
+should give a 404 - repo is not published
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
+  404 Not Found
+  
+  
+  error: repository c not found
+  [1]
+
+atom-log without basedir
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' | grep '<link'
+   <link rel="self" href="http://*/a/atom-log"/> (glob)
+   <link rel="alternate" href="http://*/a/"/> (glob)
+    <link href="http://*/a/rev/8580ff50825a"/> (glob)
+
+rss-log without basedir
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/rss-log' | grep '<guid'
+      <guid isPermaLink="true">http://*/a/rev/8580ff50825a</guid> (glob)
+  $ cat > paths.conf <<EOF
+  > [paths]
+  > t/a/=$root/a
+  > b=$root/b
+  > coll=$root/*
+  > rcoll=$root/**
+  > star=*
+  > starstar=**
+  > EOF
+  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
+  >     -A access-paths.log -E error-paths-2.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+should succeed, slashy names
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  200 Script output follows
+  
+  
+  /t/a/
+  /b/
+  /coll/a/
+  /coll/a/.hg/patches/
+  /coll/b/
+  /coll/c/
+  /rcoll/a/
+  /rcoll/a/.hg/patches/
+  /rcoll/b/
+  /rcoll/b/d/
+  /rcoll/c/
+  /star/webdir/a/
+  /star/webdir/a/.hg/patches/
+  /star/webdir/b/
+  /star/webdir/c/
+  /starstar/webdir/a/
+  /starstar/webdir/a/.hg/patches/
+  /starstar/webdir/b/
+  /starstar/webdir/b/d/
+  /starstar/webdir/c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper'
+  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>Mercurial repositories index</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <div class="main">
+  <h2>Mercurial Repositories</h2>
+  
+  <table class="bigtable">
+      <tr>
+          <th><a href="?sort=name">Name</a></th>
+          <th><a href="?sort=description">Description</a></th>
+          <th><a href="?sort=contact">Contact</a></th>
+          <th><a href="?sort=lastchange">Last modified</a></th>
+          <th>&nbsp;</th>
+      </tr>
+      
+  <tr class="parity0">
+  <td><a href="/t/a/?style=paper">t/a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/b/?style=paper">b</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/coll/a/?style=paper">coll/a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/coll/a/.hg/patches/?style=paper">coll/a/.hg/patches</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/coll/b/?style=paper">coll/b</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/coll/c/?style=paper">coll/c</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/rcoll/a/?style=paper">rcoll/a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/rcoll/a/.hg/patches/?style=paper">rcoll/a/.hg/patches</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/rcoll/b/?style=paper">rcoll/b</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/rcoll/b/d/?style=paper">rcoll/b/d</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/rcoll/c/?style=paper">rcoll/c</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/star/webdir/a/?style=paper">star/webdir/a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/star/webdir/a/.hg/patches/?style=paper">star/webdir/a/.hg/patches</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/star/webdir/b/?style=paper">star/webdir/b</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/star/webdir/c/?style=paper">star/webdir/c</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/starstar/webdir/a/?style=paper">starstar/webdir/a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/starstar/webdir/a/.hg/patches/?style=paper">starstar/webdir/a/.hg/patches</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/starstar/webdir/b/?style=paper">starstar/webdir/b</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity0">
+  <td><a href="/starstar/webdir/b/d/?style=paper">starstar/webdir/b/d</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  <tr class="parity1">
+  <td><a href="/starstar/webdir/c/?style=paper">starstar/webdir/c</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  </table>
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw'
+  200 Script output follows
+  
+  
+  /t/a/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  200 Script output follows
+  
+  
+  /t/a/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper'
+  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>Mercurial repositories index</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <div class="main">
+  <h2>Mercurial Repositories</h2>
+  
+  <table class="bigtable">
+      <tr>
+          <th><a href="?sort=name">Name</a></th>
+          <th><a href="?sort=description">Description</a></th>
+          <th><a href="?sort=contact">Contact</a></th>
+          <th><a href="?sort=lastchange">Last modified</a></th>
+          <th>&nbsp;</th>
+      </tr>
+      
+  <tr class="parity0">
+  <td><a href="/t/a/?style=paper">a</a></td>
+  <td>unknown</td>
+  <td>&#70;&#111;&#111;&#32;&#66;&#97;&#114;&#32;&#60;&#102;&#111;&#111;&#46;&#98;&#97;&#114;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;&#62;</td>
+  <td class="age">* ago</td> (glob)
+  <td class="indexlinks"></td>
+  </tr>
+  
+  </table>
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://*/t/a/</id> (glob)
+   <link rel="self" href="http://*/t/a/atom-log"/> (glob)
+   <link rel="alternate" href="http://*/t/a/"/> (glob)
+   <title>t/a Changelog</title>
+   <updated>1970-01-01T00:00:01+00:00</updated>
+  
+   <entry>
+    <title>a</title>
+    <id>http://*/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob)
+    <link href="http://*/t/a/rev/8580ff50825a"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:01+00:00</updated>
+    <published>1970-01-01T00:00:01+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">a</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom'
+  200 Script output follows
+  
+  <?xml version="1.0" encoding="ascii"?>
+  <feed xmlns="http://www.w3.org/2005/Atom">
+   <!-- Changelog -->
+   <id>http://*/t/a/</id> (glob)
+   <link rel="self" href="http://*/t/a/atom-log"/> (glob)
+   <link rel="alternate" href="http://*/t/a/"/> (glob)
+   <title>t/a Changelog</title>
+   <updated>1970-01-01T00:00:01+00:00</updated>
+  
+   <entry>
+    <title>a</title>
+    <id>http://*/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab</id> (glob)
+    <link href="http://*/t/a/rev/8580ff50825a"/> (glob)
+    <author>
+     <name>test</name>
+     <email>&#116;&#101;&#115;&#116;</email>
+    </author>
+    <updated>1970-01-01T00:00:01+00:00</updated>
+    <published>1970-01-01T00:00:01+00:00</published>
+    <content type="xhtml">
+     <div xmlns="http://www.w3.org/1999/xhtml">
+      <pre xml:space="preserve">a</pre>
+     </div>
+    </content>
+   </entry>
+  
+  </feed>
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/file/tip/a?style=raw'
+  200 Script output follows
+  
+  a
+
+Test [paths] '*' extension
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/?style=raw'
+  200 Script output follows
+  
+  
+  /coll/a/
+  /coll/a/.hg/patches/
+  /coll/b/
+  /coll/c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/coll/a/file/tip/a?style=raw'
+  200 Script output follows
+  
+  a
+
+est [paths] '**' extension
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/?style=raw'
+  200 Script output follows
+  
+  
+  /rcoll/a/
+  /rcoll/a/.hg/patches/
+  /rcoll/b/
+  /rcoll/b/d/
+  /rcoll/c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/rcoll/b/d/file/tip/d?style=raw'
+  200 Script output follows
+  
+  d
+  $ "$TESTDIR/killdaemons.py"
+  $ cat > paths.conf <<EOF
+  > [paths]
+  > t/a = $root/a
+  > t/b = $root/b
+  > c = $root/c
+  > [web]
+  > descend=false
+  > EOF
+  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
+  >     -A access-paths.log -E error-paths-3.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+test descend = False
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  200 Script output follows
+  
+  
+  /c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
+  200 Script output follows
+  
+  
+  /t/a/
+  /t/b/
+  
+  $ "$TESTDIR/killdaemons.py"
+  $ cat > paths.conf <<EOF
+  > [paths]
+  > nostore = $root/nostore
+  > inexistent = $root/inexistent
+  > EOF
+  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
+  >     -A access-paths.log -E error-paths-4.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+test inexistent and inaccessible repo should be ignored silently
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/'
+  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>Mercurial repositories index</title>
+  </head>
+  <body>
+  
+  <div class="container">
+  <div class="menu">
+  <a href="http://mercurial.selenic.com/">
+  <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
+  </div>
+  <div class="main">
+  <h2>Mercurial Repositories</h2>
+  
+  <table class="bigtable">
+      <tr>
+          <th><a href="?sort=name">Name</a></th>
+          <th><a href="?sort=description">Description</a></th>
+          <th><a href="?sort=contact">Contact</a></th>
+          <th><a href="?sort=lastchange">Last modified</a></th>
+          <th>&nbsp;</th>
+      </tr>
+      
+  </table>
+  </div>
+  </div>
+  
+  
+  </body>
+  </html>
+  
+  $ cat > collections.conf <<EOF
+  > [collections]
+  > $root=$root
+  > EOF
+  $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \
+  >     --pid-file=hg.pid --webdir-conf collections.conf \
+  >     -A access-collections.log -E error-collections.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+collections: should succeed
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
+  200 Script output follows
+  
+  
+  /a/
+  /a/.hg/patches/
+  /b/
+  /c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
+  200 Script output follows
+  
+  a
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
+  200 Script output follows
+  
+  b
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
+  200 Script output follows
+  
+  c
+
+atom-log with basedir /
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' | grep '<link'
+   <link rel="self" href="http://hg.example.com:8080/a/atom-log"/>
+   <link rel="alternate" href="http://hg.example.com:8080/a/"/>
+    <link href="http://hg.example.com:8080/a/rev/8580ff50825a"/>
+
+rss-log with basedir /
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep '<guid'
+      <guid isPermaLink="true">http://hg.example.com:8080/a/rev/8580ff50825a</guid>
+  $ "$TESTDIR/killdaemons.py"
+  $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \
+  >     --pid-file=hg.pid --webdir-conf collections.conf \
+  >     -A access-collections-2.log -E error-collections-2.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+atom-log with basedir /foo/
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' | grep '<link'
+   <link rel="self" href="http://hg.example.com:8080/foo/a/atom-log"/>
+   <link rel="alternate" href="http://hg.example.com:8080/foo/a/"/>
+    <link href="http://hg.example.com:8080/foo/a/rev/8580ff50825a"/>
+
+rss-log with basedir /foo/
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' | grep '<guid'
+      <guid isPermaLink="true">http://hg.example.com:8080/foo/a/rev/8580ff50825a</guid>
+
+paths errors 1
+
+  $ cat error-paths-1.log
+
+paths errors 2
+
+  $ cat error-paths-2.log
+
+paths errors 3
+
+  $ cat error-paths-3.log
+
+collections errors
+
+  $ cat error-collections.log
+
+collections errors 2
+
+  $ cat error-collections-2.log
--- a/tests/test-hgwebdirsym	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/bin/sh
-# Tests whether or not hgwebdir properly handles various symlink topologies.
-
-"$TESTDIR/hghave" symlink || exit 80
-
-hg init a
-echo a > a/a
-hg --cwd a ci -Ama -d'1 0'
-
-mkdir webdir
-cd webdir
-
-hg init b
-echo b > b/b
-hg --cwd b ci -Amb -d'2 0'
-
-hg init c
-echo c > c/c
-hg --cwd c ci -Amc -d'3 0'
-
-ln -s ../a al
-ln -s ../webdir circle
-
-root=`pwd`
-
-cd ..
-
-cat > collections.conf <<EOF
-[collections]
-$root=$root
-EOF
-
-hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
-    -A access-collections.log -E error-collections.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % should succeed
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/al/file/tip/a?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
-
-echo % should fail
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/al/file/tip/a?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/b/file/tip/a?style=raw'
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/c/file/tip/a?style=raw'
-
-echo % collections errors
-cat error-collections.log
--- a/tests/test-hgwebdirsym.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-adding a
-adding b
-adding c
-% should succeed
-200 Script output follows
-
-
-/al/
-/b/
-/c/
-
-200 Script output follows
-
-a
-200 Script output follows
-
-b
-200 Script output follows
-
-c
-% should fail
-404 Not Found
-
-
-error: repository circle not found
-404 Not Found
-
-
-error: repository circle not found
-404 Not Found
-
-
-error: repository circle not found
-% collections errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hgwebdirsym.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,76 @@
+Tests whether or not hgwebdir properly handles various symlink topologies.
+
+  $ "$TESTDIR/hghave" symlink || exit 80
+  $ hg init a
+  $ echo a > a/a
+  $ hg --cwd a ci -Ama -d'1 0'
+  adding a
+  $ mkdir webdir
+  $ cd webdir
+  $ hg init b
+  $ echo b > b/b
+  $ hg --cwd b ci -Amb -d'2 0'
+  adding b
+  $ hg init c
+  $ echo c > c/c
+  $ hg --cwd c ci -Amc -d'3 0'
+  adding c
+  $ ln -s ../a al
+  $ ln -s ../webdir circle
+  $ root=`pwd`
+  $ cd ..
+  $ cat > collections.conf <<EOF
+  > [collections]
+  > $root=$root
+  > EOF
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
+  >     -A access-collections.log -E error-collections.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+should succeed
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
+  200 Script output follows
+  
+  
+  /al/
+  /b/
+  /c/
+  
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/al/file/tip/a?style=raw'
+  200 Script output follows
+  
+  a
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
+  200 Script output follows
+  
+  b
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
+  200 Script output follows
+  
+  c
+
+should fail
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/al/file/tip/a?style=raw'
+  404 Not Found
+  
+  
+  error: repository circle not found
+  [1]
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/b/file/tip/a?style=raw'
+  404 Not Found
+  
+  
+  error: repository circle not found
+  [1]
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/circle/c/file/tip/a?style=raw'
+  404 Not Found
+  
+  
+  error: repository circle not found
+  [1]
+
+collections errors
+
+  $ cat error-collections.log
--- a/tests/test-highlight	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" pygments || exit 80
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-highlight =
-[web]
-pygments_style = friendly
-EOF
-
-hg init test
-cd test
-# create random Python file to exercise Pygments
-cat <<EOF > primes.py
-#!/usr/bin/env python
-
-"""Fun with generators. Corresponding Haskell implementation:
-
-primes = 2 : sieve [3, 5..]
-    where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
-"""
-
-from itertools import dropwhile, ifilter, islice, count, chain
-
-def primes():
-    """Generate all primes."""
-    def sieve(ns):
-        p = ns.next()
-        # It is important to yield *here* in order to stop the
-        # infinite recursion.
-        yield p
-        ns = ifilter(lambda n: n % p != 0, ns)
-        for n in sieve(ns):
-            yield n
-
-    odds = ifilter(lambda i: i % 2 == 1, count())
-    return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
-
-if __name__ == "__main__":
-    import sys
-    try:
-        n = int(sys.argv[1])
-    except (ValueError, IndexError):
-        n = 10
-    p = primes()
-    print "The first %d primes: %s" % (n, list(islice(p, n)))
-EOF
-
-hg ci -Ama
-
-echo % hg serve
-hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % hgweb filerevision, html
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py') \
-    | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
-
-echo % hgweb fileannotate, html
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \
-    | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
-
-echo % hgweb fileannotate, raw
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \
-    | sed "s/test@//" > a
-
-echo "200 Script output follows" > b
-echo "" >> b
-echo "" >> b
-hg annotate "primes.py" >> b
-echo "" >> b
-echo "" >> b
-echo "" >> b
-echo "" >> b
-
-diff -u b a
-
-echo
-echo % hgweb filerevision, raw
-("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \
-    > a
-
-echo "200 Script output follows" > b
-echo "" >> b
-hg cat primes.py >> b
-
-diff -u b a
-
-echo
-echo % hgweb highlightcss friendly
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
-head -n 4 out
-rm out
-
-echo % errors encountered
-cat errors.log
-"$TESTDIR/killdaemons.py"
-
-# Change the pygments style
-cat > .hg/hgrc <<EOF
-[web]
-pygments_style = fruity
-EOF
-
-echo % hg serve again
-hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-echo % hgweb highlightcss fruity
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
-head -n 4 out
-rm out
-
-echo % errors encountered
-cat errors.log
-
-cd ..
-hg init eucjp
-cd eucjp
-
-python -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
-
-hg ci -Ama
-
-hgserveget () {
-    "$TESTDIR/killdaemons.py"
-    echo % HGENCODING="$1" hg serve
-    HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
-    cat hg.pid >> $DAEMON_PIDS
-
-    echo % hgweb filerevision, html
-    "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
-        | grep '<div class="parity0 source">' | $TESTDIR/printrepr.py
-    echo % errors encountered
-    cat errors.log
-}
-
-hgserveget euc-jp eucjp.txt
-hgserveget utf-8 eucjp.txt
-hgserveget us-ascii eucjp.txt
--- a/tests/test-highlight.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-adding primes.py
-% hg serve
-% hgweb filerevision, html
-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" />
-
-<link rel="stylesheet" href="/highlightcss" type="text/css" />
-<title>test: 853dcd4de2a6 primes.py</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/853dcd4de2a6">log</a></li>
-<li><a href="/graph/853dcd4de2a6">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-<ul>
-<li><a href="/rev/853dcd4de2a6">changeset</a></li>
-<li><a href="/file/853dcd4de2a6/">browse</a></li>
-</ul>
-<ul>
-<li class="active">file</li>
-<li><a href="/file/tip/primes.py">latest</a></li>
-<li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
-<li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
-<li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
-<li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>view primes.py @ 0:853dcd4de2a6</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>
-
-<div class="description">a</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"></td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<div class="sourcefirst"> line source</div>
-
-<div class="parity0 source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></div>
-<div class="parity1 source"><a href="#l2" id="l2">     2</a> </div>
-<div class="parity0 source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></div>
-<div class="parity1 source"><a href="#l4" id="l4">     4</a> </div>
-<div class="parity0 source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></div>
-<div class="parity1 source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></div>
-<div class="parity0 source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></div>
-<div class="parity1 source"><a href="#l8" id="l8">     8</a> </div>
-<div class="parity0 source"><a href="#l9" id="l9">     9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></div>
-<div class="parity1 source"><a href="#l10" id="l10">    10</a> </div>
-<div class="parity0 source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></div>
-<div class="parity1 source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></div>
-<div class="parity0 source"><a href="#l13" id="l13">    13</a>     <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
-<div class="parity1 source"><a href="#l14" id="l14">    14</a>         <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></div>
-<div class="parity0 source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></div>
-<div class="parity1 source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></div>
-<div class="parity0 source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></div>
-<div class="parity1 source"><a href="#l18" id="l18">    18</a>         <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></div>
-<div class="parity0 source"><a href="#l19" id="l19">    19</a>         <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
-<div class="parity1 source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></div>
-<div class="parity0 source"><a href="#l21" id="l21">    21</a> </div>
-<div class="parity1 source"><a href="#l22" id="l22">    22</a>     <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></div>
-<div class="parity0 source"><a href="#l23" id="l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></div>
-<div class="parity1 source"><a href="#l24" id="l24">    24</a> </div>
-<div class="parity0 source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></div>
-<div class="parity1 source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></div>
-<div class="parity0 source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></div>
-<div class="parity1 source"><a href="#l28" id="l28">    28</a>         <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></div>
-<div class="parity0 source"><a href="#l29" id="l29">    29</a>     <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></div>
-<div class="parity1 source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></div>
-<div class="parity0 source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></div>
-<div class="parity1 source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></div>
-<div class="sourcelast"></div>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% hgweb fileannotate, html
-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" />
-
-<link rel="stylesheet" href="/highlightcss" type="text/css" />
-<title>test: primes.py annotate</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/853dcd4de2a6">log</a></li>
-<li><a href="/graph/853dcd4de2a6">graph</a></li>
-<li><a href="/tags">tags</a></li>
-<li><a href="/branches">branches</a></li>
-</ul>
-
-<ul>
-<li><a href="/rev/853dcd4de2a6">changeset</a></li>
-<li><a href="/file/853dcd4de2a6/">browse</a></li>
-</ul>
-<ul>
-<li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
-<li><a href="/file/tip/primes.py">latest</a></li>
-<li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
-<li class="active">annotate</li>
-<li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
-<li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
-</ul>
-</div>
-
-<div class="main">
-<h2><a href="/">test</a></h2>
-<h3>annotate primes.py @ 0:853dcd4de2a6</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>
-
-<div class="description">a</div>
-
-<table id="changesetEntry">
-<tr>
- <th class="author">author</th>
- <td class="author">&#116;&#101;&#115;&#116;</td>
-</tr>
-<tr>
- <th class="date">date</th>
- <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
-</tr>
-<tr>
- <th class="author">parents</th>
- <td class="author"></td>
-</tr>
-<tr>
- <th class="author">children</th>
- <td class="author"></td>
-</tr>
-
-</table>
-
-<div class="overflow">
-<table class="bigtable">
-<tr>
- <th class="annotate">rev</th>
- <th class="line">&nbsp;&nbsp;line source</th>
-</tr>
-
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#1"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#2"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l2" id="l2">     2</a> </td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#3"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#4"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l4" id="l4">     4</a> </td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#5"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#6"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#7"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#8"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l8" id="l8">     8</a> </td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#9"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l9" id="l9">     9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#10"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l10" id="l10">    10</a> </td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#11"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#12"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#13"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l13" id="l13">    13</a>     <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#14"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l14" id="l14">    14</a>         <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#15"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#16"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#17"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#18"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l18" id="l18">    18</a>         <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#19"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l19" id="l19">    19</a>         <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#20"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#21"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l21" id="l21">    21</a> </td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#22"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l22" id="l22">    22</a>     <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#23"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l23" id="l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#24"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l24" id="l24">    24</a> </td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#25"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#26"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#27"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#28"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l28" id="l28">    28</a>         <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#29"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l29" id="l29">    29</a>     <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#30"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
-</tr>
-<tr class="parity0">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#31"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
-</tr>
-<tr class="parity1">
-<td class="annotate">
-<a href="/annotate/853dcd4de2a6/primes.py#32"
-title="853dcd4de2a6: a">test@0</a>
-</td>
-<td class="source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
-</tr>
-</table>
-</div>
-</div>
-</div>
-
-
-
-</body>
-</html>
-
-% hgweb fileannotate, raw
-
-% hgweb filerevision, raw
-
-% hgweb highlightcss friendly
-200 Script output follows
-
-/* pygments_style = friendly */
-
-% errors encountered
-% hg serve again
-% hgweb highlightcss fruity
-200 Script output follows
-
-/* pygments_style = fruity */
-
-% errors encountered
-adding eucjp.txt
-% HGENCODING=euc-jp hg serve
-% hgweb filerevision, html
-<div class="parity0 source"><a href="#l1" id="l1">     1</a> \xb5\xfe</div>
-% errors encountered
-% HGENCODING=utf-8 hg serve
-% hgweb filerevision, html
-<div class="parity0 source"><a href="#l1" id="l1">     1</a> \xef\xbf\xbd\xef\xbf\xbd</div>
-% errors encountered
-% HGENCODING=us-ascii hg serve
-% hgweb filerevision, html
-<div class="parity0 source"><a href="#l1" id="l1">     1</a> ??</div>
-% errors encountered
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-highlight.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,598 @@
+
+  $ "$TESTDIR/hghave" pygments || exit 80
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > highlight =
+  > [web]
+  > pygments_style = friendly
+  > EOF
+  $ hg init test
+  $ cd test
+
+create random Python file to exercise Pygments
+
+  $ cat <<EOF > primes.py
+  > #!/usr/bin/env python
+  > 
+  > """Fun with generators. Corresponding Haskell implementation:
+  > 
+  > primes = 2 : sieve [3, 5..]
+  >     where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
+  > """
+  > 
+  > from itertools import dropwhile, ifilter, islice, count, chain
+  > 
+  > def primes():
+  >     """Generate all primes."""
+  >     def sieve(ns):
+  >         p = ns.next()
+  >         # It is important to yield *here* in order to stop the
+  >         # infinite recursion.
+  >         yield p
+  >         ns = ifilter(lambda n: n % p != 0, ns)
+  >         for n in sieve(ns):
+  >             yield n
+  > 
+  >     odds = ifilter(lambda i: i % 2 == 1, count())
+  >     return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
+  > 
+  > if __name__ == "__main__":
+  >     import sys
+  >     try:
+  >         n = int(sys.argv[1])
+  >     except (ValueError, IndexError):
+  >         n = 10
+  >     p = primes()
+  >     print "The first %d primes: %s" % (n, list(islice(p, n)))
+  > EOF
+  $ hg ci -Ama
+  adding primes.py
+
+hg serve
+
+  $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+hgweb filerevision, html
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py') \
+  >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mf\"/class=\"mi\"/g"
+  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" />
+  
+  <link rel="stylesheet" href="/highlightcss" type="text/css" />
+  <title>test: 853dcd4de2a6 primes.py</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/853dcd4de2a6">log</a></li>
+  <li><a href="/graph/853dcd4de2a6">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  <ul>
+  <li><a href="/rev/853dcd4de2a6">changeset</a></li>
+  <li><a href="/file/853dcd4de2a6/">browse</a></li>
+  </ul>
+  <ul>
+  <li class="active">file</li>
+  <li><a href="/file/tip/primes.py">latest</a></li>
+  <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
+  <li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
+  <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
+  <li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>view primes.py @ 0:853dcd4de2a6</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>
+  
+  <div class="description">a</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"></td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <div class="sourcefirst"> line source</div>
+  
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></div>
+  <div class="parity1 source"><a href="#l2" id="l2">     2</a> </div>
+  <div class="parity0 source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></div>
+  <div class="parity1 source"><a href="#l4" id="l4">     4</a> </div>
+  <div class="parity0 source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></div>
+  <div class="parity1 source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></div>
+  <div class="parity0 source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></div>
+  <div class="parity1 source"><a href="#l8" id="l8">     8</a> </div>
+  <div class="parity0 source"><a href="#l9" id="l9">     9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></div>
+  <div class="parity1 source"><a href="#l10" id="l10">    10</a> </div>
+  <div class="parity0 source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></div>
+  <div class="parity1 source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></div>
+  <div class="parity0 source"><a href="#l13" id="l13">    13</a>     <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
+  <div class="parity1 source"><a href="#l14" id="l14">    14</a>         <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></div>
+  <div class="parity0 source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></div>
+  <div class="parity1 source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></div>
+  <div class="parity0 source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></div>
+  <div class="parity1 source"><a href="#l18" id="l18">    18</a>         <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></div>
+  <div class="parity0 source"><a href="#l19" id="l19">    19</a>         <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></div>
+  <div class="parity1 source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></div>
+  <div class="parity0 source"><a href="#l21" id="l21">    21</a> </div>
+  <div class="parity1 source"><a href="#l22" id="l22">    22</a>     <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mi">2</span> <span class="o">==</span> <span class="mi">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></div>
+  <div class="parity0 source"><a href="#l23" id="l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mi">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></div>
+  <div class="parity1 source"><a href="#l24" id="l24">    24</a> </div>
+  <div class="parity0 source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></div>
+  <div class="parity1 source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></div>
+  <div class="parity0 source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></div>
+  <div class="parity1 source"><a href="#l28" id="l28">    28</a>         <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span></div>
+  <div class="parity0 source"><a href="#l29" id="l29">    29</a>     <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></div>
+  <div class="parity1 source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mi">10</span></div>
+  <div class="parity0 source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></div>
+  <div class="parity1 source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></div>
+  <div class="sourcelast"></div>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+hgweb fileannotate, html
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py') \
+  >     | sed "s/class=\"k\"/class=\"kn\"/g" | sed "s/class=\"mi\"/class=\"mf\"/g"
+  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" />
+  
+  <link rel="stylesheet" href="/highlightcss" type="text/css" />
+  <title>test: primes.py annotate</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/853dcd4de2a6">log</a></li>
+  <li><a href="/graph/853dcd4de2a6">graph</a></li>
+  <li><a href="/tags">tags</a></li>
+  <li><a href="/branches">branches</a></li>
+  </ul>
+  
+  <ul>
+  <li><a href="/rev/853dcd4de2a6">changeset</a></li>
+  <li><a href="/file/853dcd4de2a6/">browse</a></li>
+  </ul>
+  <ul>
+  <li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
+  <li><a href="/file/tip/primes.py">latest</a></li>
+  <li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
+  <li class="active">annotate</li>
+  <li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
+  <li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
+  </ul>
+  </div>
+  
+  <div class="main">
+  <h2><a href="/">test</a></h2>
+  <h3>annotate primes.py @ 0:853dcd4de2a6</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>
+  
+  <div class="description">a</div>
+  
+  <table id="changesetEntry">
+  <tr>
+   <th class="author">author</th>
+   <td class="author">&#116;&#101;&#115;&#116;</td>
+  </tr>
+  <tr>
+   <th class="date">date</th>
+   <td class="date">Thu Jan 01 00:00:00 1970 +0000 (1970-01-01)</td>
+  </tr>
+  <tr>
+   <th class="author">parents</th>
+   <td class="author"></td>
+  </tr>
+  <tr>
+   <th class="author">children</th>
+   <td class="author"></td>
+  </tr>
+  
+  </table>
+  
+  <div class="overflow">
+  <table class="bigtable">
+  <tr>
+   <th class="annotate">rev</th>
+   <th class="line">&nbsp;&nbsp;line source</th>
+  </tr>
+  
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#1"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l1" id="l1">     1</a> <span class="c">#!/usr/bin/env python</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#2"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l2" id="l2">     2</a> </td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#3"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l3" id="l3">     3</a> <span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#4"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l4" id="l4">     4</a> </td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#5"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l5" id="l5">     5</a> <span class="sd">primes = 2 : sieve [3, 5..]</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#6"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l6" id="l6">     6</a> <span class="sd">    where sieve (p:ns) = p : sieve [n | n &lt;- ns, mod n p /= 0]</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#7"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l7" id="l7">     7</a> <span class="sd">&quot;&quot;&quot;</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#8"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l8" id="l8">     8</a> </td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#9"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l9" id="l9">     9</a> <span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">dropwhile</span><span class="p">,</span> <span class="n">ifilter</span><span class="p">,</span> <span class="n">islice</span><span class="p">,</span> <span class="n">count</span><span class="p">,</span> <span class="n">chain</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#10"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l10" id="l10">    10</a> </td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#11"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l11" id="l11">    11</a> <span class="kn">def</span> <span class="nf">primes</span><span class="p">():</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#12"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l12" id="l12">    12</a>     <span class="sd">&quot;&quot;&quot;Generate all primes.&quot;&quot;&quot;</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#13"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l13" id="l13">    13</a>     <span class="kn">def</span> <span class="nf">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#14"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l14" id="l14">    14</a>         <span class="n">p</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">next</span><span class="p">()</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#15"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l15" id="l15">    15</a>         <span class="c"># It is important to yield *here* in order to stop the</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#16"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l16" id="l16">    16</a>         <span class="c"># infinite recursion.</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#17"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l17" id="l17">    17</a>         <span class="kn">yield</span> <span class="n">p</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#18"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l18" id="l18">    18</a>         <span class="n">ns</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">%</span> <span class="n">p</span> <span class="o">!=</span> <span class="mf">0</span><span class="p">,</span> <span class="n">ns</span><span class="p">)</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#19"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l19" id="l19">    19</a>         <span class="kn">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">sieve</span><span class="p">(</span><span class="n">ns</span><span class="p">):</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#20"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l20" id="l20">    20</a>             <span class="kn">yield</span> <span class="n">n</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#21"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l21" id="l21">    21</a> </td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#22"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l22" id="l22">    22</a>     <span class="n">odds</span> <span class="o">=</span> <span class="n">ifilter</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">i</span><span class="p">:</span> <span class="n">i</span> <span class="o">%</span> <span class="mf">2</span> <span class="o">==</span> <span class="mf">1</span><span class="p">,</span> <span class="n">count</span><span class="p">())</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#23"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l23" id="l23">    23</a>     <span class="kn">return</span> <span class="n">chain</span><span class="p">([</span><span class="mf">2</span><span class="p">],</span> <span class="n">sieve</span><span class="p">(</span><span class="n">dropwhile</span><span class="p">(</span><span class="kn">lambda</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span> <span class="o">&lt;</span> <span class="mf">3</span><span class="p">,</span> <span class="n">odds</span><span class="p">)))</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#24"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l24" id="l24">    24</a> </td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#25"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l25" id="l25">    25</a> <span class="kn">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#26"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l26" id="l26">    26</a>     <span class="kn">import</span> <span class="nn">sys</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#27"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l27" id="l27">    27</a>     <span class="kn">try</span><span class="p">:</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#28"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l28" id="l28">    28</a>         <span class="n">n</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mf">1</span><span class="p">])</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#29"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l29" id="l29">    29</a>     <span class="kn">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#30"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l30" id="l30">    30</a>         <span class="n">n</span> <span class="o">=</span> <span class="mf">10</span></td>
+  </tr>
+  <tr class="parity0">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#31"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l31" id="l31">    31</a>     <span class="n">p</span> <span class="o">=</span> <span class="n">primes</span><span class="p">()</span></td>
+  </tr>
+  <tr class="parity1">
+  <td class="annotate">
+  <a href="/annotate/853dcd4de2a6/primes.py#32"
+  title="853dcd4de2a6: a">test@0</a>
+  </td>
+  <td class="source"><a href="#l32" id="l32">    32</a>     <span class="kn">print</span> <span class="s">&quot;The first </span><span class="si">%d</span><span class="s"> primes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="nb">list</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">n</span><span class="p">)))</span></td>
+  </tr>
+  </table>
+  </div>
+  </div>
+  </div>
+  
+  
+  
+  </body>
+  </html>
+  
+
+hgweb fileannotate, raw
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/primes.py?style=raw') \
+  >     | sed "s/test@//" > a
+  $ echo "200 Script output follows" > b
+  $ echo "" >> b
+  $ echo "" >> b
+  $ hg annotate "primes.py" >> b
+  $ echo "" >> b
+  $ echo "" >> b
+  $ echo "" >> b
+  $ echo "" >> b
+  $ diff -u b a
+  $ echo
+  
+
+hgweb filerevision, raw
+
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/primes.py?style=raw') \
+  >     > a
+  $ echo "200 Script output follows" > b
+  $ echo "" >> b
+  $ hg cat primes.py >> b
+  $ diff -u b a
+  $ echo
+  
+
+hgweb highlightcss friendly
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
+  $ head -n 4 out
+  200 Script output follows
+  
+  /* pygments_style = friendly */
+  
+  $ rm out
+
+errors encountered
+
+  $ cat errors.log
+  $ "$TESTDIR/killdaemons.py"
+
+Change the pygments style
+
+  $ cat > .hg/hgrc <<EOF
+  > [web]
+  > pygments_style = fruity
+  > EOF
+
+hg serve again
+
+  $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+hgweb highlightcss fruity
+
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out
+  $ head -n 4 out
+  200 Script output follows
+  
+  /* pygments_style = fruity */
+  
+  $ rm out
+
+errors encountered
+
+  $ cat errors.log
+  $ cd ..
+  $ hg init eucjp
+  $ cd eucjp
+  $ python -c 'print("\265\376")' >> eucjp.txt  # Japanese kanji "Kyo"
+  $ hg ci -Ama
+  adding eucjp.txt
+  $ hgserveget () {
+  >     "$TESTDIR/killdaemons.py"
+  >     echo % HGENCODING="$1" hg serve
+  >     HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log
+  >     cat hg.pid >> $DAEMON_PIDS
+  > 
+  >     echo % hgweb filerevision, html
+  >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
+  >         | grep '<div class="parity0 source">' | $TESTDIR/printrepr.py
+  >     echo % errors encountered
+  >     cat errors.log
+  > }
+  $ hgserveget euc-jp eucjp.txt
+  % HGENCODING=euc-jp hg serve
+  % hgweb filerevision, html
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xb5\xfe</div>
+  % errors encountered
+  $ hgserveget utf-8 eucjp.txt
+  % HGENCODING=utf-8 hg serve
+  % hgweb filerevision, html
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xef\xbf\xbd\xef\xbf\xbd</div>
+  % errors encountered
+  $ hgserveget us-ascii eucjp.txt
+  % HGENCODING=us-ascii hg serve
+  % hgweb filerevision, html
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> ??</div>
+  % errors encountered
--- a/tests/test-http	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-hg init test
-cd test
-echo foo>foo
-mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
-echo foo>foo.d/foo
-echo bar>foo.d/bAr.hg.d/BaR
-echo bar>foo.d/baR.d.hg/bAR
-
-hg commit -A -m 1
-hg serve -p $HGPORT -d --pid-file=../hg1.pid
-hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
-# Test server address cannot be reused
-hg serve -p $HGPORT1 2>&1 | sed -e "s/abort: cannot start server at ':$HGPORT1':.*/abort: cannot start server at ':\$HGPORT1':/"
-cd ..
-cat hg1.pid hg2.pid >> $DAEMON_PIDS
-
-echo % clone via stream
-hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | \
-  sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
-hg verify -R copy
-
-echo % try to clone via stream, should use pull instead
-hg clone --uncompressed http://localhost:$HGPORT1/ copy2
-
-echo % clone via pull
-hg clone http://localhost:$HGPORT1/ copy-pull
-hg verify -R copy-pull
-
-cd test
-echo bar > bar
-hg commit -A -d '1 0' -m 2
-cd ..
-
-echo % pull
-cd copy-pull
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-hg pull | sed -e "s,:$HGPORT1/,:\$HGPORT1/,"
-cd ..
--- a/tests/test-http-branchmap	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-hgserve()
-{
-    hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
-        | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
-    cat hg.pid >> "$DAEMON_PIDS"
-}
-
-hg init a
-hg --encoding utf-8 -R a branch æ
-echo foo > a/foo
-hg -R a ci -Am foo
-
-hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
-hg --encoding utf-8 clone http://localhost:$HGPORT1 b
-hg --encoding utf-8 -R b log
-echo bar >> b/foo
-hg -R b ci -m bar
-hg --encoding utf-8 -R b push | sed "s/$HGPORT1/PORT/"
-hg -R a --encoding utf-8 log
-
-kill `cat hg.pid`
-
-
-# verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
-
-cat <<EOF > oldhg
-import sys
-from mercurial import ui, hg, commands
-
-class StdoutWrapper(object):
-    def __init__(self, stdout):
-        self._file = stdout
-
-    def write(self, data):
-        if data == '47\n':
-            # latin1 encoding is one %xx (3 bytes) shorter
-            data = '44\n'
-        elif data.startswith('%C3%A6 '):
-            # translate to latin1 encoding
-            data = '%%E6 %s' % data[7:]
-        self._file.write(data)
-
-    def __getattr__(self, name):
-        return getattr(self._file, name)
-
-sys.stdout = StdoutWrapper(sys.stdout)
-sys.stderr = StdoutWrapper(sys.stderr)
-
-myui = ui.ui()
-repo = hg.repository(myui, 'a')
-commands.serve(myui, repo, stdio=True)
-EOF
-
-echo baz >> b/foo
-hg -R b ci -m baz
-hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
--- a/tests/test-http-branchmap.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-marked working directory as branch æ
-adding foo
-listening at http://localhost/ (bound to 127.0.0.1)
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch æ
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   0:867c11ce77b8
-branch:      æ
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
-pushing to http://localhost:PORT
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-changeset:   1:58e7c90d67cb
-branch:      æ
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     bar
-
-changeset:   0:867c11ce77b8
-branch:      æ
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     foo
-
-pushing to ssh://dummy/
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http-branchmap.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,92 @@
+
+  $ hgserve() {
+  >     hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@
+  >     cat hg.pid >> "$DAEMON_PIDS"
+  > }
+  $ hg init a
+  $ hg --encoding utf-8 -R a branch æ
+  marked working directory as branch æ
+  $ echo foo > a/foo
+  $ hg -R a ci -Am foo
+  adding foo
+  $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1
+  listening at http://localhost*/ (bound to 127.0.0.1:*) (glob)
+  $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch æ
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --encoding utf-8 -R b log
+  changeset:   0:867c11ce77b8
+  branch:      æ
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo
+  
+  $ echo bar >> b/foo
+  $ hg -R b ci -m bar
+  $ hg --encoding utf-8 -R b push
+  pushing to http://localhost:* (glob)
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  $ hg -R a --encoding utf-8 log
+  changeset:   1:58e7c90d67cb
+  branch:      æ
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     bar
+  
+  changeset:   0:867c11ce77b8
+  branch:      æ
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo
+  
+  $ kill `cat hg.pid`
+
+verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)
+
+  $ cat <<EOF > oldhg
+  > import sys
+  > from mercurial import ui, hg, commands
+  > 
+  > class StdoutWrapper(object):
+  >     def __init__(self, stdout):
+  >         self._file = stdout
+  > 
+  >     def write(self, data):
+  >         if data == '47\n':
+  >             # latin1 encoding is one %xx (3 bytes) shorter
+  >             data = '44\n'
+  >         elif data.startswith('%C3%A6 '):
+  >             # translate to latin1 encoding
+  >             data = '%%E6 %s' % data[7:]
+  >         self._file.write(data)
+  > 
+  >     def __getattr__(self, name):
+  >         return getattr(self._file, name)
+  > 
+  > sys.stdout = StdoutWrapper(sys.stdout)
+  > sys.stderr = StdoutWrapper(sys.stderr)
+  > 
+  > myui = ui.ui()
+  > repo = hg.repository(myui, 'a')
+  > commands.serve(myui, repo, stdio=True)
+  > EOF
+  $ echo baz >> b/foo
+  $ hg -R b ci -m baz
+  $ hg push -R b -e 'python oldhg' ssh://dummy/ --encoding latin1
+  pushing to ssh://dummy/
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
--- a/tests/test-http-clone-r	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-hg init remote
-cd remote
-echo "# creating 'remote'"
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3"
-hg mv afile adifferentfile
-hg commit -m "1.3m"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-echo "# Starting server"
-hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
-cd ..
-cat hg1.pid >> $DAEMON_PIDS
-
-echo "# clone remote via stream"
-for i in 0 1 2 3 4 5 6 7 8; do
-   hg clone -r "$i" http://localhost:$HGPORT/ test-"$i" 2>&1
-   if cd test-"$i"; then
-      hg verify
-      cd ..
-   fi
-done
-cd test-8
-hg pull ../test-7
-hg verify
-cd ..
-cd test-1
-hg pull -r 4 http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg verify
-hg pull http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-cd ..
-cd test-2
-hg pull -r 5 http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg verify
-hg pull http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg verify
-cd ..
-cat error.log
--- a/tests/test-http-clone-r.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-# creating 'remote'
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-# Starting server
-# clone remote via stream
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-pulling from http://localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 2 total revisions
-pulling from http://localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 6 changesets with 5 changes to 4 files
-(run 'hg update' to get a working copy)
-pulling from http://localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 0 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 5 changesets, 3 total revisions
-pulling from http://localhost:$HGPORT/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 4 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http-clone-r.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,273 @@
+
+  $ hg init remote
+  $ cd remote
+
+creating 'remote
+
+  $ cat >>afile <<EOF
+  > 0
+  > EOF
+  $ hg add afile
+  $ hg commit -m "0.0"
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "0.1"
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "0.2"
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg commit -m "0.3"
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "1.1"
+  created new head
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "1.2"
+  $ cat >fred <<EOF
+  > a line
+  > EOF
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg add fred
+  $ hg commit -m "1.3"
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+
+Starting server
+
+  $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
+  $ cd ..
+  $ cat hg1.pid >> $DAEMON_PIDS
+
+clone remote via stream
+
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >    hg clone -r "$i" http://localhost:$HGPORT/ test-"$i"
+  >    if cd test-"$i"; then
+  >       hg verify
+  >       cd ..
+  >    fi
+  > done
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+  $ cd test-8
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+  $ cd test-1
+  $ hg pull -r 4 http://localhost:$HGPORT/
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 2 total revisions
+  $ hg pull http://localhost:$HGPORT/
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 5 changes to 4 files
+  (run 'hg update' to get a working copy)
+  $ cd ..
+  $ cd test-2
+  $ hg pull -r 5 http://localhost:$HGPORT/
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 5 changesets, 3 total revisions
+  $ hg pull http://localhost:$HGPORT/
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 4 files
+  (run 'hg update' to get a working copy)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+  $ cat error.log
--- a/tests/test-http-proxy	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-hg init a
-cd a
-echo a > a
-hg ci -Ama -d '1123456789 0'
-hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-
-cd ..
-("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
-echo $! > proxy.pid)
-cat proxy.pid >> $DAEMON_PIDS
-sleep 2
-
-echo %% url for proxy, stream
-http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b | \
-  sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
-cd b
-hg verify
-cd ..
-
-echo %% url for proxy, pull
-http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
-cd b-pull
-hg verify
-cd ..
-
-echo %% host:port for proxy
-http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
-
-echo %% proxy url with user name and password
-http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
-
-echo %% url with user name and password
-http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
-
-echo %% bad host:port for proxy
-http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
-
-echo %% do not use the proxy if it is in the no list
-http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
-
-cat proxy.log | sed -e 's/^.*\] /XXX /' -e 's/:[0-9][0-9]*/:/'
-exit 0
--- a/tests/test-http-proxy.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-adding a
-%% url for proxy, stream
-streaming all changes
-XXX files to transfer, XXX bytes of data
-transferred XXX bytes in XXX seconds (XXX XB/sec)
-updating to branch default
-XXX files updated, XXX files merged, XXX files removed, XXX files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-%% url for proxy, pull
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-%% host:port for proxy
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-%% proxy url with user name and password
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-%% url with user name and password
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-%% bad host:port for proxy
-abort: error: Connection refused
-%% do not use the proxy if it is in the no list
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=capabilities HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=stream_out HTTP/1.1" - -
-XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
-XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
-XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
-XXX "GET http://localhost:/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=heads HTTP/1.1" - -
-XXX "GET http://localhost:/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - -
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http-proxy.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,116 @@
+
+  $ hg init a
+  $ cd a
+  $ echo a > a
+  $ hg ci -Ama -d '1123456789 0'
+  adding a
+  $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ cd ..
+  $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
+  $ echo $! > proxy.pid)
+  $ cat proxy.pid >> $DAEMON_PIDS
+  $ sleep 2
+
+url for proxy, stream
+
+  $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b
+  streaming all changes
+  3 files to transfer, 303 bytes of data
+  transferred * bytes in * seconds (*B/sec) (glob)
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd b
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  $ cd ..
+
+url for proxy, pull
+
+  $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd b-pull
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  $ cd ..
+
+host:port for proxy
+
+  $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+proxy url with user name and password
+
+  $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+url with user name and password
+
+  $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+bad host:port for proxy
+
+  $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
+  abort: error: Connection refused
+  [255]
+
+do not use the proxy if it is in the no list
+
+  $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat proxy.log
+  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=capabilities HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=stream_out HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=heads HTTP/1.1" - - (glob)
+  * - - [*] "GET http://localhost:*/?cmd=changegroup&roots=0000000000000000000000000000000000000000 HTTP/1.1" - - (glob)
+
--- a/tests/test-http.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-adding foo
-adding foo.d/bAr.hg.d/BaR
-adding foo.d/baR.d.hg/bAR
-adding foo.d/foo
-abort: cannot start server at ':$HGPORT1':
-% clone via stream
-streaming all changes
-XXX files to transfer, XXX bytes of data
-transferred XXX bytes in XXX seconds (XXX XB/sec)
-updating to branch default
-XXX files updated, XXX files merged, XXX files removed, XXX files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 1 changesets, 4 total revisions
-% try to clone via stream, should use pull instead
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 4 changes to 4 files
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% clone via pull
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 4 changes to 4 files
-updating to branch default
-4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 1 changesets, 4 total revisions
-adding bar
-% pull
-changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ 
-pulling from http://localhost:$HGPORT1/
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-http.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,88 @@
+
+  $ cp "$TESTDIR"/printenv.py .
+  $ hg init test
+  $ cd test
+  $ echo foo>foo
+  $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
+  $ echo foo>foo.d/foo
+  $ echo bar>foo.d/bAr.hg.d/BaR
+  $ echo bar>foo.d/baR.d.hg/bAR
+  $ hg commit -A -m 1
+  adding foo
+  adding foo.d/bAr.hg.d/BaR
+  adding foo.d/baR.d.hg/bAR
+  adding foo.d/foo
+  $ hg serve -p $HGPORT -d --pid-file=../hg1.pid
+  $ hg --config server.uncompressed=False serve -p $HGPORT1 -d --pid-file=../hg2.pid
+
+Test server address cannot be reused
+
+  $ hg serve -p $HGPORT1 2>&1
+  abort: cannot start server at ':*': Address already in use (glob)
+  [255]
+  $ cd ..
+  $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
+
+clone via stream
+
+  $ hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1
+  streaming all changes
+  6 files to transfer, 606 bytes of data
+  transferred * bytes in * seconds (*B/sec) (glob)
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg verify -R copy
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 1 changesets, 4 total revisions
+
+try to clone via stream, should use pull instead
+
+  $ hg clone --uncompressed http://localhost:$HGPORT1/ copy2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 4 changes to 4 files
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+clone via pull
+
+  $ hg clone http://localhost:$HGPORT1/ copy-pull
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 4 changes to 4 files
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg verify -R copy-pull
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 1 changesets, 4 total revisions
+  $ cd test
+  $ echo bar > bar
+  $ hg commit -A -d '1 0' -m 2
+  adding bar
+  $ cd ..
+
+pull
+
+  $ cd copy-pull
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
+  $ hg pull
+  changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:*/* (glob)
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ cd ..
--- a/tests/test-hup	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" fifo || exit 80
-
-hg init
-mkfifo p
-
-hg serve --stdio < p &
-P=$!
-(echo lock; echo addchangegroup; sleep 5) > p &
-Q=$!
-sleep 3
-kill -HUP $P
-wait
-echo .hg/* .hg/store/*
--- a/tests/test-hup.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-0
-0
-adding changesets
-transaction abort!
-rollback completed
-killed!
-.hg/00changelog.i .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hup.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,20 @@
+Test hangup signal in the middle of transaction
+
+  $ "$TESTDIR/hghave" fifo || exit 80
+  $ hg init
+  $ mkfifo p
+  $ hg serve --stdio < p &
+  $ P=$!
+  $ (echo lock; echo addchangegroup; sleep 5) > p &
+  $ Q=$!
+  $ sleep 3
+  0
+  0
+  adding changesets
+  $ kill -HUP $P
+  $ wait
+  transaction abort!
+  rollback completed
+  killed!
+  $ echo .hg/* .hg/store/*
+  .hg/00changelog.i .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a
--- a/tests/test-inotify	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init repo1
-cd repo1
-
-touch a b c d e
-mkdir dir
-mkdir dir/bar
-touch dir/x dir/y dir/bar/foo
-
-hg ci -Am m
-cd ..
-hg clone repo1 repo2
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-
-cd repo2
-echo b >> a
-# check that daemon started automatically works correctly
-# and make sure that inotify.pidfile works
-hg --config "inotify.pidfile=../hg2.pid" status
-
-# make sure that pidfile worked. Output should be silent.
-kill `cat ../hg2.pid`
-
-cd ../repo1
-echo % inserve
-hg inserve -d --pid-file=hg.pid
-cat hg.pid >> "$DAEMON_PIDS"
-
-# let the daemon finish its stuff
-sleep 1
-
-echo % cannot start, already bound
-hg inserve
-
-# issue907
-hg status
-echo % clean
-hg status -c
-echo % all
-hg status -A
-
-echo '% path patterns'
-echo x > dir/x
-hg status .
-hg status dir
-cd dir
-hg status .
-cd ..
-
-#issue 1375
-#Testing that we can remove a folder and then add a file with the same name
-echo % issue 1375
-
-mkdir h
-echo h > h/h
-hg ci -Am t
-hg rm h
-
-echo h >h
-hg add h
-
-hg status
-hg ci -m0
-
-# Test for issue1735: inotify watches files in .hg/merge
-hg st
-
-echo a > a
-
-hg ci -Am a
-hg st
-
-echo b >> a
-hg ci -m ab
-hg st
-
-echo c >> a
-hg st
-
-HGMERGE=internal:local hg up 0
-hg st
-
-HGMERGE=internal:local hg up
-hg st
-
-# Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
-mkdir 1844
-echo a > 1844/foo
-hg add 1844
-hg ci -m 'working'
-
-echo b >> 1844/foo
-hg ci 1844 -m 'broken'
-
-# Test for issue884: "Build products not ignored until .hgignore is touched"
-echo '^build$' > .hgignore
-hg add .hgignore
-hg ci .hgignore -m 'ignorelist'
-
-# Now, lets add some build products...
-mkdir build
-touch build/x
-touch build/y
-
-# build/x & build/y shouldn't appear in "hg st"
-hg st
-
-kill `cat hg.pid`
--- a/tests/test-inotify-debuginotify	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-
-echo % inserve
-hg inserve -d --pid-file=hg.pid
-cat hg.pid >> "$DAEMON_PIDS"
-
-# let the daemon finish its stuff
-sleep 1
-
-echo % empty
-hg debuginotify
-
-mkdir a
-sleep 1
-
-echo % only 'a'
-hg debuginotify
-
-rmdir a
-sleep 1
-
-echo % empty again
-hg debuginotify
-
-kill `cat hg.pid`
--- a/tests/test-inotify-debuginotify.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-% inserve
-% empty
-directories being watched:
-  /
-  .hg/
-% only a
-directories being watched:
-  /
-  .hg/
-  a/
-% empty again
-directories being watched:
-  /
-  .hg/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-debuginotify.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,41 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid
+  $ cat hg.pid >> "$DAEMON_PIDS"
+
+let the daemon finish its stuff
+
+  $ sleep 1
+
+empty
+
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+  $ mkdir a
+  $ sleep 1
+
+only 'a
+
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+    a/
+  $ rmdir a
+  $ sleep 1
+
+empty again
+
+  $ hg debuginotify
+  directories being watched:
+    /
+    .hg/
+  $ kill `cat hg.pid`
--- a/tests/test-inotify-dirty-dirstate	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-#!/bin/sh
-
-# issues when status queries are issued when dirstate is dirty
-
-"$TESTDIR/hghave" inotify || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-echo "fetch=" >> $HGRCPATH
-
-echo % issue1810: inotify and fetch
-mkdir test; cd test
-hg init
-hg inserve -d --pid-file=../hg.pid
-cat ../hg.pid >> "$DAEMON_PIDS"
-
-echo foo > foo
-hg add
-hg ci -m foo
-
-cd ..
-
-hg --config "inotify.pidfile=../hg2.pid" clone test test2
-cat ../hg2.pid >> "$DAEMON_PIDS"
-
-cd test2
-echo bar > bar
-hg add
-hg ci -m bar
-cd ../test
-echo spam > spam
-hg add
-hg ci -m spam
-cd ../test2
-hg st
-
-# abort, outstanding changes
-hg fetch -q
-hg st
-cd ..
-
-
-echo % issue1719: inotify and mq
-
-echo "mq=" >> $HGRCPATH
-
-hg init test-1719
-cd test-1719
-
-echo % inserve
-hg inserve -d --pid-file=../hg-test-1719.pid
-cat ../hg-test-1719.pid >> "$DAEMON_PIDS"
-
-echo content > file
-hg add file
-
-hg qnew -f test.patch
-
-hg status
-hg qpop
-
-echo % st should not output anything
-hg status
-
-hg qpush
-
-echo % st should not output anything
-hg status
-
-hg qrefresh
-hg status
--- a/tests/test-inotify-dirty-dirstate.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-% issue1810: inotify and fetch
-adding foo
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding bar
-adding spam
-% issue1719: inotify and mq
-% inserve
-popping test.patch
-patch queue now empty
-% st should not output anything
-applying test.patch
-now at: test.patch
-% st should not output anything
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-dirty-dirstate.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,71 @@
+issues when status queries are issued when dirstate is dirty
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+  $ echo "fetch=" >> $HGRCPATH
+
+issue1810: inotify and fetch
+
+  $ mkdir test; cd test
+  $ hg init
+  $ hg inserve -d --pid-file=../hg.pid
+  $ cat ../hg.pid >> "$DAEMON_PIDS"
+  $ echo foo > foo
+  $ hg add
+  adding foo
+  $ hg ci -m foo
+  $ cd ..
+  $ hg --config "inotify.pidfile=../hg2.pid" clone test test2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat ../hg2.pid >> "$DAEMON_PIDS"
+  $ cd test2
+  $ echo bar > bar
+  $ hg add
+  adding bar
+  $ hg ci -m bar
+  $ cd ../test
+  $ echo spam > spam
+  $ hg add
+  adding spam
+  $ hg ci -m spam
+  $ cd ../test2
+  $ hg st
+
+abort, outstanding changes
+
+  $ hg fetch -q
+  $ hg st
+  $ cd ..
+
+issue1719: inotify and mq
+
+  $ echo "mq=" >> $HGRCPATH
+  $ hg init test-1719
+  $ cd test-1719
+
+inserve
+
+  $ hg inserve -d --pid-file=../hg-test-1719.pid
+  $ cat ../hg-test-1719.pid >> "$DAEMON_PIDS"
+  $ echo content > file
+  $ hg add file
+  $ hg qnew -f test.patch
+  $ hg status
+  $ hg qpop
+  popping test.patch
+  patch queue now empty
+
+st should not output anything
+
+  $ hg status
+  $ hg qpush
+  applying test.patch
+  now at: test.patch
+
+st should not output anything
+
+  $ hg status
+  $ hg qrefresh
+  $ hg status
--- a/tests/test-inotify-issue1208	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-
-p="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-hg init $p
-cd $p
-
-echo % fail
-ln -sf doesnotexist .hg/inotify.sock
-hg st
-hg inserve
-rm .hg/inotify.sock
-
-echo % inserve
-hg inserve -d --pid-file=hg.pid
-cat hg.pid >> "$DAEMON_PIDS"
-echo % status
-hg status
-
-kill `cat hg.pid`
--- a/tests/test-inotify-issue1208.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-% fail
-abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
-inotify-client: could not start inotify server: child process failed to start
-abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
-% inserve
-% status
-? hg.pid
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-issue1208.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,29 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+  $ p="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+  $ hg init $p
+  $ cd $p
+
+fail
+
+  $ ln -sf doesnotexist .hg/inotify.sock
+  $ hg st
+  abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
+  inotify-client: could not start inotify server: child process failed to start
+  $ hg inserve
+  abort: inotify-server: cannot start: .hg/inotify.sock is a broken symlink
+  [255]
+  $ rm .hg/inotify.sock
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid
+  $ cat hg.pid >> "$DAEMON_PIDS"
+
+status
+
+  $ hg status
+  ? hg.pid
+  $ kill `cat hg.pid`
--- a/tests/test-inotify-issue1371	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init 
-
-touch a b c d e f
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-echo inserv1
-
-echo % inserve
-hg inserve -d --pid-file=hg.pid 2>&1
-cat hg.pid >> "$DAEMON_PIDS"
-
-hg ci -Am m
-
-
-# let the daemon finish its stuff
-sleep 1
-
-#Need to test all file opperations
-hg rm a
-rm b
-echo c >> c
-touch g
-hg add g
-hg mv e h
-hg status
-
-sleep 1
-echo "Are we able to kill the service? if not, the service died on some error"
-kill `cat hg.pid` 
-
--- a/tests/test-inotify-issue1371.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-inserv1
-% inserve
-adding a
-adding b
-adding c
-adding d
-adding e
-adding f
-adding hg.pid
-M c
-A g
-A h
-R a
-R e
-! b
-Are we able to kill the service? if not, the service died on some error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-issue1371.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,44 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init 
+  $ touch a b c d e f
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid 2>&1
+  $ cat hg.pid >> "$DAEMON_PIDS"
+  $ hg ci -Am m
+  adding a
+  adding b
+  adding c
+  adding d
+  adding e
+  adding f
+  adding hg.pid
+
+let the daemon finish its stuff
+
+  $ sleep 1
+
+eed to test all file opperations
+
+  $ hg rm a
+  $ rm b
+  $ echo c >> c
+  $ touch g
+  $ hg add g
+  $ hg mv e h
+  $ hg status
+  M c
+  A g
+  A h
+  R a
+  R e
+  ! b
+  $ sleep 1
+
+Are we able to kill the service? if not, the service died on some error
+
+  $ kill `cat hg.pid` 
--- a/tests/test-inotify-issue1542	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init
-
-touch a
-mkdir dir
-touch dir/b
-touch dir/c
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-
-hg add dir/c
-
-echo % inserve
-hg inserve -d --pid-file=hg.pid 2>&1
-cat hg.pid >> "$DAEMON_PIDS"
-
-hg st
-
-echo % moving dir out
-mv dir ../tmp-test-inotify-issue1542
-
-echo % status
-hg st
-
-sleep 1
-echo "Are we able to kill the service? if not, the service died on some error"
-kill `cat hg.pid`
-
--- a/tests/test-inotify-issue1542.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-% inserve
-A dir/c
-? a
-? dir/b
-? hg.pid
-% moving dir out
-% status
-! dir/c
-? a
-? hg.pid
-Are we able to kill the service? if not, the service died on some error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-issue1542.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,36 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init
+  $ touch a
+  $ mkdir dir
+  $ touch dir/b
+  $ touch dir/c
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+  $ hg add dir/c
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid 2>&1
+  $ cat hg.pid >> "$DAEMON_PIDS"
+  $ hg st
+  A dir/c
+  ? a
+  ? dir/b
+  ? hg.pid
+
+moving dir out
+
+  $ mv dir ../tmp-test-inotify-issue1542
+
+status
+
+  $ hg st
+  ! dir/c
+  ? a
+  ? hg.pid
+  $ sleep 1
+
+Are we able to kill the service? if not, the service died on some error
+
+  $ kill `cat hg.pid`
--- a/tests/test-inotify-issue1556	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init
-
-touch a b
-hg add a b
-rm b
-
-echo % status without inotify
-hg st
-
-echo "[extensions]" >> $HGRCPATH
-echo "inotify=" >> $HGRCPATH
-
-echo % inserve
-hg inserve -d --pid-file=hg.pid 2>&1
-cat hg.pid >> "$DAEMON_PIDS"
-
-echo % status
-hg st
-
-sleep 1
-echo "Are we able to kill the service? if not, the service died on some error"
-kill `cat hg.pid`
-
--- a/tests/test-inotify-issue1556.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-% status without inotify
-A a
-! b
-% inserve
-% status
-A a
-! b
-? hg.pid
-Are we able to kill the service? if not, the service died on some error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-issue1556.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,31 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init
+  $ touch a b
+  $ hg add a b
+  $ rm b
+
+status without inotify
+
+  $ hg st
+  A a
+  ! b
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid 2>&1
+  $ cat hg.pid >> "$DAEMON_PIDS"
+
+status
+
+  $ hg st
+  A a
+  ! b
+  ? hg.pid
+  $ sleep 1
+
+Are we able to kill the service? if not, the service died on some error
+
+  $ kill `cat hg.pid`
--- a/tests/test-inotify-lookup	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-"$TESTDIR/hghave" inotify || exit 80
-
-hg init
-echo "[extensions]" > .hg/hgrc
-echo "inotify=" >> .hg/hgrc
-hg inserve -d --pid-file .hg/inotify.pid
-
-echo a > a
-hg ci -Aqm0
-hg co -q null
-hg co -q
-hg st
-cat a
-
-kill `cat .hg/inotify.pid`
-
--- a/tests/test-inotify-lookup.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify-lookup.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,14 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init
+  $ echo "[extensions]" > .hg/hgrc
+  $ echo "inotify=" >> .hg/hgrc
+  $ hg inserve -d --pid-file .hg/inotify.pid
+  $ echo a > a
+  $ hg ci -Aqm0
+  $ hg co -q null
+  $ hg co -q
+  $ hg st
+  $ cat a
+  a
+  $ kill `cat .hg/inotify.pid`
--- a/tests/test-inotify.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-adding a
-adding b
-adding c
-adding d
-adding dir/bar/foo
-adding dir/x
-adding dir/y
-adding e
-updating to branch default
-8 files updated, 0 files merged, 0 files removed, 0 files unresolved
-M a
-% inserve
-% cannot start, already bound
-abort: inotify-server: cannot start: socket is already bound
-? hg.pid
-% clean
-C a
-C b
-C c
-C d
-C dir/bar/foo
-C dir/x
-C dir/y
-C e
-% all
-? hg.pid
-C a
-C b
-C c
-C d
-C dir/bar/foo
-C dir/x
-C dir/y
-C e
-% path patterns
-M dir/x
-? hg.pid
-M dir/x
-M x
-% issue 1375
-adding h/h
-adding hg.pid
-removing h/h
-A h
-R h/h
-M a
-1 files updated, 1 files merged, 2 files removed, 0 files unresolved
-M a
-3 files updated, 1 files merged, 0 files removed, 0 files unresolved
-M a
-adding 1844/foo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-inotify.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,160 @@
+
+  $ "$TESTDIR/hghave" inotify || exit 80
+  $ hg init repo1
+  $ cd repo1
+  $ touch a b c d e
+  $ mkdir dir
+  $ mkdir dir/bar
+  $ touch dir/x dir/y dir/bar/foo
+  $ hg ci -Am m
+  adding a
+  adding b
+  adding c
+  adding d
+  adding dir/bar/foo
+  adding dir/x
+  adding dir/y
+  adding e
+  $ cd ..
+  $ hg clone repo1 repo2
+  updating to branch default
+  8 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "inotify=" >> $HGRCPATH
+  $ cd repo2
+  $ echo b >> a
+
+check that daemon started automatically works correctly
+and make sure that inotify.pidfile works
+
+  $ hg --config "inotify.pidfile=../hg2.pid" status
+  M a
+
+make sure that pidfile worked. Output should be silent.
+
+  $ kill `cat ../hg2.pid`
+  $ cd ../repo1
+
+inserve
+
+  $ hg inserve -d --pid-file=hg.pid
+  $ cat hg.pid >> "$DAEMON_PIDS"
+
+let the daemon finish its stuff
+
+  $ sleep 1
+
+cannot start, already bound
+
+  $ hg inserve
+  abort: inotify-server: cannot start: socket is already bound
+  [255]
+
+issue907
+
+  $ hg status
+  ? hg.pid
+
+clean
+
+  $ hg status -c
+  C a
+  C b
+  C c
+  C d
+  C dir/bar/foo
+  C dir/x
+  C dir/y
+  C e
+
+all
+
+  $ hg status -A
+  ? hg.pid
+  C a
+  C b
+  C c
+  C d
+  C dir/bar/foo
+  C dir/x
+  C dir/y
+  C e
+
+path patterns
+
+  $ echo x > dir/x
+  $ hg status .
+  M dir/x
+  ? hg.pid
+  $ hg status dir
+  M dir/x
+  $ cd dir
+  $ hg status .
+  M x
+  $ cd ..
+
+issue 1375
+testing that we can remove a folder and then add a file with the same name
+issue 1375
+
+  $ mkdir h
+  $ echo h > h/h
+  $ hg ci -Am t
+  adding h/h
+  adding hg.pid
+  $ hg rm h
+  removing h/h
+  $ echo h >h
+  $ hg add h
+  $ hg status
+  A h
+  R h/h
+  $ hg ci -m0
+
+Test for issue1735: inotify watches files in .hg/merge
+
+  $ hg st
+  $ echo a > a
+  $ hg ci -Am a
+  $ hg st
+  $ echo b >> a
+  $ hg ci -m ab
+  $ hg st
+  $ echo c >> a
+  $ hg st
+  M a
+  $ HGMERGE=internal:local hg up 0
+  1 files updated, 1 files merged, 2 files removed, 0 files unresolved
+  $ hg st
+  M a
+  $ HGMERGE=internal:local hg up
+  3 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  $ hg st
+  M a
+
+Test for 1844: "hg ci folder" will not commit all changes beneath "folder"
+
+  $ mkdir 1844
+  $ echo a > 1844/foo
+  $ hg add 1844
+  adding 1844/foo
+  $ hg ci -m 'working'
+  $ echo b >> 1844/foo
+  $ hg ci 1844 -m 'broken'
+
+Test for issue884: "Build products not ignored until .hgignore is touched"
+
+  $ echo '^build$' > .hgignore
+  $ hg add .hgignore
+  $ hg ci .hgignore -m 'ignorelist'
+
+Now, lets add some build products...
+
+  $ mkdir build
+  $ touch build/x
+  $ touch build/y
+
+build/x & build/y shouldn't appear in "hg st"
+
+  $ hg st
+  $ kill `cat hg.pid`
--- a/tests/test-keyword.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-keyword.t	Mon Sep 27 10:47:36 2010 -0500
@@ -375,10 +375,48 @@
 
   $ hg status -A a
   C a
+  $ rm msg
 
-  $ rm msg
-  $ hg rollback
+rollback and revert expansion
+
+  $ cat a
+  expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
+  foo
+  do not process $Id:
+  xxx $
+  bar
+  $ hg --verbose rollback
   rolling back to revision 2 (undo commit)
+  overwriting a expanding keywords
+  $ hg status a
+  M a
+  $ cat a
+  expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
+  foo
+  do not process $Id:
+  xxx $
+  bar
+  $ echo '$Id$' > y
+  $ echo '$Id$' > z
+  $ hg add y
+  $ hg commit -Am "rollback only" z
+  $ cat z
+  $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
+  $ hg --verbose rollback
+  rolling back to revision 2 (undo commit)
+  overwriting z shrinking keywords
+
+Only z should be overwritten
+
+  $ hg status a y z
+  M a
+  A y
+  A z
+  $ cat z
+  $Id$
+  $ hg forget y z
+  $ rm y z
+
   $ hg update -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
@@ -878,7 +916,7 @@
   foobranch
   expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
 
-Switch of expansion
+Turn off expansion
 
   $ hg -q rollback
   $ hg -q update -C
--- a/tests/test-mactext	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-cat > unix2mac.py <<EOF
-import sys
-
-for path in sys.argv[1:]:
-    data = file(path, 'rb').read()
-    data = data.replace('\n', '\r')
-    file(path, 'wb').write(data)
-EOF
-
-cat > print.py <<EOF
-import sys
-print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
-EOF
-
-hg init
-echo '[hooks]' >> .hg/hgrc
-echo 'pretxncommit.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc
-echo 'pretxnchangegroup.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc
-cat .hg/hgrc
-echo
-
-echo hello > f
-hg add f
-hg ci -m 1
-echo
-
-python unix2mac.py f
-hg ci -m 2
-hg cat f | python print.py
-cat f | python print.py
--- a/tests/test-mactext.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-[hooks]
-pretxncommit.cr = python:hgext.win32text.forbidcr
-pretxnchangegroup.cr = python:hgext.win32text.forbidcr
-
-
-Attempt to commit or push text file(s) using CR line endings
-in dea860dc51ec: f
-transaction abort!
-rollback completed
-abort: pretxncommit.cr hook failed
-hello<LF>
-hello<CR>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mactext.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,40 @@
+
+  $ cat > unix2mac.py <<EOF
+  > import sys
+  > 
+  > for path in sys.argv[1:]:
+  >     data = file(path, 'rb').read()
+  >     data = data.replace('\n', '\r')
+  >     file(path, 'wb').write(data)
+  > EOF
+  $ cat > print.py <<EOF
+  > import sys
+  > print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
+  > EOF
+  $ hg init
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'pretxncommit.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc
+  $ echo 'pretxnchangegroup.cr = python:hgext.win32text.forbidcr' >> .hg/hgrc
+  $ cat .hg/hgrc
+  [hooks]
+  pretxncommit.cr = python:hgext.win32text.forbidcr
+  pretxnchangegroup.cr = python:hgext.win32text.forbidcr
+  $ echo
+  
+  $ echo hello > f
+  $ hg add f
+  $ hg ci -m 1
+  $ echo
+  
+  $ python unix2mac.py f
+  $ hg ci -m 2
+  Attempt to commit or push text file(s) using CR line endings
+  in dea860dc51ec: f
+  transaction abort!
+  rollback completed
+  abort: pretxncommit.cr hook failed
+  [255]
+  $ hg cat f | python print.py
+  hello<LF>
+  $ cat f | python print.py
+  hello<CR>
--- a/tests/test-merge-symlinks	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-cat > echo.py <<EOF
-#!/usr/bin/env python
-import os, sys
-try:
-    import msvcrt
-    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
-    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
-except ImportError:
-    pass
-
-for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
-    print k, os.environ[k]
-EOF
-
-# Create 2 heads containing the same file, once as
-# a file, once as a link. Bundle was generated with:
-#
-# hg init t
-# cd t
-# echo a > a
-# hg ci -qAm t0 -d '0 0'
-# echo l > l
-# hg ci -qAm t1 -d '1 0'
-# hg up -C 0
-# ln -s a l
-# hg ci -qAm t2 -d '2 0'
-# echo l2 > l2
-# hg ci -qAm t3 -d '3 0'
-
-hg init t
-cd t
-hg -q pull "$TESTDIR/test-merge-symlinks.hg"
-hg up -C 3
-
-# Merge them and display *_ISLINK vars
-echo % merge heads
-HGMERGE="python ../echo.py" hg merge
-
-# Test working directory symlink bit calculation wrt copies,
-# especially on non-supporting systems.
-echo % merge working directory
-hg up -C 2
-hg copy l l2
-HGMERGE="python ../echo.py" hg up 3
--- a/tests/test-merge-symlinks.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% merge heads
-HG_FILE l
-HG_MY_ISLINK 1
-HG_OTHER_ISLINK 0
-HG_BASE_ISLINK 0
-merging l
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-% merge working directory
-1 files updated, 0 files merged, 1 files removed, 0 files unresolved
-HG_FILE l2
-HG_MY_ISLINK 1
-HG_OTHER_ISLINK 0
-HG_BASE_ISLINK 0
-merging l2
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-symlinks.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,62 @@
+
+  $ cat > echo.py <<EOF
+  > #!/usr/bin/env python
+  > import os, sys
+  > try:
+  >     import msvcrt
+  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+  >     msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+  > except ImportError:
+  >     pass
+  > 
+  > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
+  >     print k, os.environ[k]
+  > EOF
+
+Create 2 heads containing the same file, once as
+a file, once as a link. Bundle was generated with:
+
+# hg init t
+# cd t
+# echo a > a
+# hg ci -qAm t0 -d '0 0'
+# echo l > l
+# hg ci -qAm t1 -d '1 0'
+# hg up -C 0
+# ln -s a l
+# hg ci -qAm t2 -d '2 0'
+# echo l2 > l2
+# hg ci -qAm t3 -d '3 0'
+
+  $ hg init t
+  $ cd t
+  $ hg -q pull "$TESTDIR/test-merge-symlinks.hg"
+  $ hg up -C 3
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Merge them and display *_ISLINK vars
+merge heads
+
+  $ HGMERGE="python ../echo.py" hg merge
+  HG_FILE l
+  HG_MY_ISLINK 1
+  HG_OTHER_ISLINK 0
+  HG_BASE_ISLINK 0
+  merging l
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+
+Test working directory symlink bit calculation wrt copies,
+especially on non-supporting systems.
+merge working directory
+
+  $ hg up -C 2
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg copy l l2
+  $ HGMERGE="python ../echo.py" hg up 3
+  HG_FILE l2
+  HG_MY_ISLINK 1
+  HG_OTHER_ISLINK 0
+  HG_BASE_ISLINK 0
+  merging l2
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-merge-tools	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-#!/bin/sh
-
-# test merge-tools configuration - mostly exercising filemerge.py
-
-unset HGMERGE # make sure HGMERGE doesn't interfere with the test
-
-hg init
-
-echo "# revision 0"
-echo "revision 0" > f
-echo "space" >> f
-hg commit -Am "revision 0"
-
-echo "# revision 1"
-echo "revision 1" > f
-echo "space" >> f
-hg commit -Am "revision 1"
-
-hg update 0 > /dev/null
-echo "# revision 2"
-echo "revision 2" > f
-echo "space" >> f
-hg commit -Am "revision 2"
-
-hg update 0 > /dev/null
-echo "# revision 3 - simple to merge"
-echo "revision 3" >> f
-hg commit -Am "revision 3"
-
-
-echo "[merge-tools]" > .hg/hgrc
-echo
-
-beforemerge() {
-  cat .hg/hgrc
-  echo "# hg update -C 1"
-  hg update -C 1 > /dev/null
-}
-
-aftermerge() {
-  echo "# cat f"
-  cat f
-  echo "# hg stat"
-  hg stat
-  rm -f f.orig
-  echo
-}
-
-domerge() {
-  beforemerge
-  echo "# hg merge $*"
-  hg merge $*
-  aftermerge
-}
-
-echo
-echo Tool selection
-echo
-
-echo "# default is internal merge:"
-beforemerge
-echo "# hg merge -r 2"
-# override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
-# running from a devel copy, not a temp installation
-PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
-aftermerge
-
-echo "# simplest hgrc using false for merge:"
-echo "false.whatever=" >> .hg/hgrc
-domerge -r 2
-
-echo "# true with higher .priority gets precedence:"
-echo "true.priority=1" >> .hg/hgrc
-domerge -r 2
-
-echo "# unless lowered on command line:"
-domerge -r 2 --config merge-tools.true.priority=-7
-
-echo "# or false set higher on command line:"
-domerge -r 2 --config merge-tools.false.priority=117
-
-echo "# or true.executable not found in PATH:"
-domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
-
-echo "# or true.executable with bogus path:"
-domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
-
-echo "# but true.executable set to cat found in PATH works:"
-echo "true.executable=cat" >> .hg/hgrc
-domerge -r 2
-
-echo "# and true.executable set to cat with path works:"
-domerge -r 2 --config merge-tools.true.executable=cat
-
-echo
-echo Tool selection and merge-patterns
-echo
-
-echo "# merge-patterns specifies new tool false:"
-domerge -r 2 --config merge-patterns.f=false
-
-echo "# merge-patterns specifies executable not found in PATH and gets warning:"
-domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
-
-echo "# merge-patterns specifies executable with bogus path and gets warning:"
-domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
-
-echo
-echo ui.merge overrules priority
-echo
-
-echo "# ui.merge specifies false:"
-domerge -r 2 --config ui.merge=false
-
-echo "# ui.merge specifies internal:fail:"
-domerge -r 2 --config ui.merge=internal:fail
-
-echo "# ui.merge specifies internal:local:"
-domerge -r 2 --config ui.merge=internal:local
-
-echo "# ui.merge specifies internal:other:"
-domerge -r 2 --config ui.merge=internal:other
-
-echo "# ui.merge specifies internal:prompt:"
-domerge -r 2 --config ui.merge=internal:prompt
-
-echo "# ui.merge specifies internal:dump:"
-domerge -r 2 --config ui.merge=internal:dump
-echo f.base:
-cat f.base
-echo f.local:
-cat f.local
-echo f.other:
-cat f.other
-rm f.base f.local f.other
-echo
-
-echo "# ui.merge specifies internal:other but is overruled by pattern for false:"
-domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
-
-echo
-echo Premerge
-echo
-
-echo "# Default is silent simplemerge:"
-domerge -r 3
-
-echo "# .premerge=True is same:"
-domerge -r 3 --config merge-tools.true.premerge=True
-
-echo "# .premerge=False executes merge-tool:"
-domerge -r 3 --config merge-tools.true.premerge=False
-
-
-echo
-echo Tool execution
-echo
-
-echo '# set tools.args explicit to include $base $local $other $output:' # default '$local $base $other'
-beforemerge
-hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
-  | sed 's,==> .* <==,==> ... <==,g'
-aftermerge
-
-echo '# Merge with "echo mergeresult > $local":'
-beforemerge
-hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
-aftermerge
-
-echo '# - and $local is the file f:'
-beforemerge
-hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
-aftermerge
-
-echo '# Merge with "echo mergeresult > $output" - the variable is a bit magic:'
-beforemerge
-hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
-aftermerge
-
-echo '# Merge using tool with a path that must be quoted:'
-beforemerge
-cat <<EOF > 'my merge tool'
-#!/bin/sh
-cat "\$1" "\$2" "\$3" > "\$4"
-EOF
-chmod +x 'my merge tool'
-hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output'
-rm -f 'my merge tool'
-aftermerge
-
-
-echo
-echo Merge post-processing
-echo
-
-echo "# cat is a bad merge-tool and doesn't change:"
-domerge -y -r 2 --config merge-tools.true.checkchanged=1
--- a/tests/test-merge-tools.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,547 +0,0 @@
-# revision 0
-adding f
-# revision 1
-# revision 2
-created new head
-# revision 3 - simple to merge
-created new head
-
-
-Tool selection
-
-# default is internal merge:
-[merge-tools]
-# hg update -C 1
-# hg merge -r 2
-merging f
-warning: conflicts during merge.
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-<<<<<<< local
-revision 1
-=======
-revision 2
->>>>>>> other
-space
-# hg stat
-M f
-? f.orig
-
-# simplest hgrc using false for merge:
-[merge-tools]
-false.whatever=
-# hg update -C 1
-# hg merge -r 2
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# true with higher .priority gets precedence:
-[merge-tools]
-false.whatever=
-true.priority=1
-# hg update -C 1
-# hg merge -r 2
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# unless lowered on command line:
-[merge-tools]
-false.whatever=
-true.priority=1
-# hg update -C 1
-# hg merge -r 2 --config merge-tools.true.priority=-7
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# or false set higher on command line:
-[merge-tools]
-false.whatever=
-true.priority=1
-# hg update -C 1
-# hg merge -r 2 --config merge-tools.false.priority=117
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# or true.executable not found in PATH:
-[merge-tools]
-false.whatever=
-true.priority=1
-# hg update -C 1
-# hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# or true.executable with bogus path:
-[merge-tools]
-false.whatever=
-true.priority=1
-# hg update -C 1
-# hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# but true.executable set to cat found in PATH works:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2
-revision 1
-space
-revision 0
-space
-revision 2
-space
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# and true.executable set to cat with path works:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config merge-tools.true.executable=cat
-revision 1
-space
-revision 0
-space
-revision 2
-space
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-
-Tool selection and merge-patterns
-
-# merge-patterns specifies new tool false:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config merge-patterns.f=false
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# merge-patterns specifies executable not found in PATH and gets warning:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
-couldn't find merge tool true specified for f
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# merge-patterns specifies executable with bogus path and gets warning:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
-couldn't find merge tool true specified for f
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-
-ui.merge overrules priority
-
-# ui.merge specifies false:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=false
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-# ui.merge specifies internal:fail:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:fail
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# ui.merge specifies internal:local:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:local
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# ui.merge specifies internal:other:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:other
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 2
-space
-# hg stat
-M f
-
-# ui.merge specifies internal:prompt:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:prompt
- no tool found to merge f
-keep (l)ocal or take (o)ther? l
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# ui.merge specifies internal:dump:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:dump
-merging f
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.base
-? f.local
-? f.orig
-? f.other
-
-f.base:
-revision 0
-space
-f.local:
-revision 1
-space
-f.other:
-revision 2
-space
-
-# ui.merge specifies internal:other but is overruled by pattern for false:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
-merging f
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
-
-Premerge
-
-# Default is silent simplemerge:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 3
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-revision 3
-# hg stat
-M f
-
-# .premerge=True is same:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 3 --config merge-tools.true.premerge=True
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-revision 3
-# hg stat
-M f
-
-# .premerge=False executes merge-tool:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -r 3 --config merge-tools.true.premerge=False
-revision 1
-space
-revision 0
-space
-revision 0
-space
-revision 3
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-
-Tool execution
-
-# set tools.args explicit to include $base $local $other $output:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-==> ... <==
-revision 0
-space
-
-==> ... <==
-revision 1
-space
-
-==> ... <==
-revision 2
-space
-
-==> ... <==
-revision 1
-space
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 1
-space
-# hg stat
-M f
-
-# Merge with "echo mergeresult > $local":
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-mergeresult
-# hg stat
-M f
-
-# - and $local is the file f:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-mergeresult
-# hg stat
-M f
-
-# Merge with "echo mergeresult > $output" - the variable is a bit magic:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-mergeresult
-# hg stat
-M f
-
-# Merge using tool with a path that must be quoted:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-merging f
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-# cat f
-revision 0
-space
-revision 1
-space
-revision 2
-space
-# hg stat
-M f
-
-
-Merge post-processing
-
-# cat is a bad merge-tool and doesn't change:
-[merge-tools]
-false.whatever=
-true.priority=1
-true.executable=cat
-# hg update -C 1
-# hg merge -y -r 2 --config merge-tools.true.checkchanged=1
-revision 1
-space
-revision 0
-space
-revision 2
-space
-merging f
- output file f appears unchanged
-was merge successful (yn)? n
-merging f failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-# cat f
-revision 1
-space
-# hg stat
-M f
-? f.orig
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-tools.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,735 @@
+test merge-tools configuration - mostly exercising filemerge.py
+
+  $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
+  $ hg init
+
+revision 0
+
+  $ echo "revision 0" > f
+  $ echo "space" >> f
+  $ hg commit -Am "revision 0"
+  adding f
+
+revision 1
+
+  $ echo "revision 1" > f
+  $ echo "space" >> f
+  $ hg commit -Am "revision 1"
+  $ hg update 0 > /dev/null
+
+revision 2
+
+  $ echo "revision 2" > f
+  $ echo "space" >> f
+  $ hg commit -Am "revision 2"
+  created new head
+  $ hg update 0 > /dev/null
+
+revision 3 - simple to merge
+
+  $ echo "revision 3" >> f
+  $ hg commit -Am "revision 3"
+  created new head
+  $ echo "[merge-tools]" > .hg/hgrc
+  $ echo
+  
+  $ beforemerge() {
+  >   cat .hg/hgrc
+  >   echo "# hg update -C 1"
+  >   hg update -C 1 > /dev/null
+  > }
+  $ aftermerge() {
+  >   echo "# cat f"
+  >   cat f
+  >   echo "# hg stat"
+  >   hg stat
+  >   rm -f f.orig
+  >   echo
+  > }
+  $ domerge() {
+  >   beforemerge
+  >   echo "# hg merge $*"
+  >   hg merge $*
+  >   aftermerge
+  > }
+  $ echo
+  
+
+Tool selection
+
+  $ echo
+  
+
+default is internal merge:
+
+  $ beforemerge
+  [merge-tools]
+  # hg update -C 1
+
+hg merge -r 2
+override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
+running from a devel copy, not a temp installation
+
+  $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
+  merging f
+  warning: conflicts during merge.
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  [1]
+  $ aftermerge
+  # cat f
+  <<<<<<< local
+  revision 1
+  =======
+  revision 2
+  >>>>>>> other
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+simplest hgrc using false for merge:
+
+  $ echo "false.whatever=" >> .hg/hgrc
+  $ domerge -r 2
+  [merge-tools]
+  false.whatever=
+  # hg update -C 1
+  # hg merge -r 2
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+true with higher .priority gets precedence:
+
+  $ echo "true.priority=1" >> .hg/hgrc
+  $ domerge -r 2
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  # hg update -C 1
+  # hg merge -r 2
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+
+unless lowered on command line:
+
+  $ domerge -r 2 --config merge-tools.true.priority=-7
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  # hg update -C 1
+  # hg merge -r 2 --config merge-tools.true.priority=-7
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+or false set higher on command line:
+
+  $ domerge -r 2 --config merge-tools.false.priority=117
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  # hg update -C 1
+  # hg merge -r 2 --config merge-tools.false.priority=117
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+or true.executable not found in PATH:
+
+  $ domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  # hg update -C 1
+  # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+or true.executable with bogus path:
+
+  $ domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  # hg update -C 1
+  # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+but true.executable set to cat found in PATH works:
+
+  $ echo "true.executable=cat" >> .hg/hgrc
+  $ domerge -r 2
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2
+  revision 1
+  space
+  revision 0
+  space
+  revision 2
+  space
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+
+and true.executable set to cat with path works:
+
+  $ domerge -r 2 --config merge-tools.true.executable=cat
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config merge-tools.true.executable=cat
+  revision 1
+  space
+  revision 0
+  space
+  revision 2
+  space
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+  $ echo
+  
+
+Tool selection and merge-patterns
+
+  $ echo
+  
+
+merge-patterns specifies new tool false:
+
+  $ domerge -r 2 --config merge-patterns.f=false
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config merge-patterns.f=false
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+merge-patterns specifies executable not found in PATH and gets warning:
+
+  $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
+  couldn't find merge tool true specified for f
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+merge-patterns specifies executable with bogus path and gets warning:
+
+  $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
+  couldn't find merge tool true specified for f
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+  $ echo
+  
+
+ui.merge overrules priority
+
+  $ echo
+  
+
+ui.merge specifies false:
+
+  $ domerge -r 2 --config ui.merge=false
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=false
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+
+ui.merge specifies internal:fail:
+
+  $ domerge -r 2 --config ui.merge=internal:fail
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:fail
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+
+ui.merge specifies internal:local:
+
+  $ domerge -r 2 --config ui.merge=internal:local
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:local
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+
+ui.merge specifies internal:other:
+
+  $ domerge -r 2 --config ui.merge=internal:other
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:other
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 2
+  space
+  # hg stat
+  M f
+  
+
+ui.merge specifies internal:prompt:
+
+  $ domerge -r 2 --config ui.merge=internal:prompt
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:prompt
+   no tool found to merge f
+  keep (l)ocal or take (o)ther? l
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+
+ui.merge specifies internal:dump:
+
+  $ domerge -r 2 --config ui.merge=internal:dump
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:dump
+  merging f
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.base
+  ? f.local
+  ? f.orig
+  ? f.other
+  
+
+f.base:
+
+  $ cat f.base
+  revision 0
+  space
+
+f.local:
+
+  $ cat f.local
+  revision 1
+  space
+
+f.other:
+
+  $ cat f.other
+  revision 2
+  space
+  $ rm f.base f.local f.other
+  $ echo
+  
+
+ui.merge specifies internal:other but is overruled by pattern for false:
+
+  $ domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
+  merging f
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
+  $ echo
+  
+
+Premerge
+
+  $ echo
+  
+
+Default is silent simplemerge:
+
+  $ domerge -r 3
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 3
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  revision 3
+  # hg stat
+  M f
+  
+
+.premerge=True is same:
+
+  $ domerge -r 3 --config merge-tools.true.premerge=True
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 3 --config merge-tools.true.premerge=True
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  revision 3
+  # hg stat
+  M f
+  
+
+.premerge=False executes merge-tool:
+
+  $ domerge -r 3 --config merge-tools.true.premerge=False
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -r 3 --config merge-tools.true.premerge=False
+  revision 1
+  space
+  revision 0
+  space
+  revision 0
+  space
+  revision 3
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+  $ echo
+  
+
+Tool execution
+
+  $ echo
+  
+  $ echo '# set tools.args explicit to include $base $local $other $output:' # default '$local $base $other'
+  # set tools.args explicit to include $base $local $other $output:
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
+  >   | sed 's,==> .* <==,==> ... <==,g'
+  ==> ... <==
+  revision 0
+  space
+  
+  ==> ... <==
+  revision 1
+  space
+  
+  ==> ... <==
+  revision 2
+  space
+  
+  ==> ... <==
+  revision 1
+  space
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  
+  $ echo '# Merge with "echo mergeresult > $local":'
+  # Merge with "echo mergeresult > $local":
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  mergeresult
+  # hg stat
+  M f
+  
+  $ echo '# - and $local is the file f:'
+  # - and $local is the file f:
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  mergeresult
+  # hg stat
+  M f
+  
+  $ echo '# Merge with "echo mergeresult > $output" - the variable is a bit magic:'
+  # Merge with "echo mergeresult > $output" - the variable is a bit magic:
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ aftermerge
+  # cat f
+  mergeresult
+  # hg stat
+  M f
+  
+
+Merge using tool with a path that must be quoted:
+
+  $ beforemerge
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  $ cat <<EOF > 'my merge tool'
+  > #!/bin/sh
+  > cat "\$1" "\$2" "\$3" > "\$4"
+  > EOF
+  $ chmod +x 'my merge tool'
+  $ hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output'
+  merging f
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ rm -f 'my merge tool'
+  $ aftermerge
+  # cat f
+  revision 0
+  space
+  revision 1
+  space
+  revision 2
+  space
+  # hg stat
+  M f
+  
+  $ echo
+  
+
+Merge post-processing
+
+  $ echo
+  
+
+cat is a bad merge-tool and doesn't change:
+
+  $ domerge -y -r 2 --config merge-tools.true.checkchanged=1
+  [merge-tools]
+  false.whatever=
+  true.priority=1
+  true.executable=cat
+  # hg update -C 1
+  # hg merge -y -r 2 --config merge-tools.true.checkchanged=1
+  revision 1
+  space
+  revision 0
+  space
+  revision 2
+  space
+  merging f
+   output file f appears unchanged
+  was merge successful (yn)? n
+  merging f failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  # cat f
+  revision 1
+  space
+  # hg stat
+  M f
+  ? f.orig
+  
--- a/tests/test-mq-header-date	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=true" >> $HGRCPATH
-
-
-catpatch() {
-    cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
-                                   -e "s/^\(# Parent \).*/\1/"
-}
-
-catlog() {
-    catpatch $1
-    hg log --template "{rev}: {desc} - {author}\n"
-}
-
-catlogd() {
-    catpatch $1
-    hg log --template "{rev}: {desc} - {author} - {date}\n"
-}
-
-drop() {
-    hg qpop
-    hg qdel $1.patch
-}
-
-runtest() {
-    echo ==== init
-    hg init a
-    cd a
-    hg qinit
-
-
-    echo ==== qnew -d
-    hg qnew -d '3 0' 1.patch
-    catlogd 1
-
-    echo ==== qref
-    echo "1" >1
-    hg add
-    hg qref
-    catlogd 1
-
-    echo ==== qref -d
-    hg qref -d '4 0'
-    catlogd 1
-
-
-    echo ==== qnew
-    hg qnew 2.patch
-    echo "2" >2
-    hg add
-    hg qref
-    catlog 2
-
-    echo ==== qref -d
-    hg qref -d '5 0'
-    catlog 2
-
-    drop 2
-
-
-    echo ==== qnew -d -m
-    hg qnew -d '6 0' -m "Three" 3.patch
-    catlogd 3
-
-    echo ==== qref
-    echo "3" >3
-    hg add
-    hg qref
-    catlogd 3
-
-    echo ==== qref -m
-    hg qref -m "Drei"
-    catlogd 3
-
-    echo ==== qref -d
-    hg qref -d '7 0'
-    catlogd 3
-
-    echo ==== qref -d -m
-    hg qref -d '8 0' -m "Three (again)"
-    catlogd 3
-
-
-    echo ==== qnew -m
-    hg qnew -m "Four" 4.patch
-    echo "4" >4
-    hg add
-    hg qref
-    catlog 4
-
-    echo ==== qref -d
-    hg qref -d '9 0'
-    catlog 4
-
-    drop 4
-
-
-    echo ==== qnew with HG header
-    hg qnew --config 'mq.plain=true' 5.patch
-    hg qpop
-    echo "# HG changeset patch" >>.hg/patches/5.patch
-    echo "# Date 10 0" >>.hg/patches/5.patch
-    hg qpush 2>&1 | grep 'Now at'
-    catlogd 5
-
-    echo ==== hg qref
-    echo "5" >5
-    hg add
-    hg qref
-    catlogd 5
-
-    echo ==== hg qref -d
-    hg qref -d '11 0'
-    catlogd 5
-
-
-    echo ==== qnew with plain header
-    hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
-    hg qpop
-    hg qpush 2>&1 | grep 'now at'
-    catlog 6
-
-    echo ==== hg qref
-    echo "6" >6
-    hg add
-    hg qref
-    catlogd 6
-
-    echo ==== hg qref -d
-    hg qref -d '13 0'
-    catlogd 6
-
-    drop 6
-    
-
-    echo ==== qnew -u
-    hg qnew -u jane 6.patch
-    echo "6" >6
-    hg add
-    hg qref
-    catlog 6
-
-    echo ==== qref -d
-    hg qref -d '12 0'
-    catlog 6
-
-    drop 6
-
-
-    echo ==== qnew -d
-    hg qnew -d '13 0' 7.patch
-    echo "7" >7
-    hg add
-    hg qref
-    catlog 7
-
-    echo ==== qref -u
-    hg qref -u john
-    catlogd 7
-
-
-    echo ==== qnew
-    hg qnew 8.patch
-    echo "8" >8
-    hg add
-    hg qref
-    catlog 8
-
-    echo ==== qref -u -d
-    hg qref -u john -d '14 0'
-    catlog 8
-
-    drop 8
-
-
-    echo ==== qnew -m
-    hg qnew -m "Nine" 9.patch
-    echo "9" >9
-    hg add
-    hg qref
-    catlog 9
-
-    echo ==== qref -u -d
-    hg qref -u john -d '15 0'
-    catlog 9
-
-    drop 9
-
-
-    echo ==== "qpop -a / qpush -a"
-    hg qpop -a
-    hg qpush -a
-    hg log --template "{rev}: {desc} - {author} - {date}\n"
-}
-
-
-echo ======= plain headers
-
-echo "[mq]" >> $HGRCPATH
-echo "plain=true" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-
-echo ======= hg headers
-
-echo "plain=false" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
--- a/tests/test-mq-header-date.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-======= plain headers
-==== init
-==== qnew -d
-Date: 3 0
-
-0: [mq]: 1.patch - test - 3.00
-==== qref
-adding 1
-Date: 3 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 3.00
-==== qref -d
-Date: 4 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 2
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-==== qref -d
-Date: 5 0
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-popping 2.patch
-now at: 1.patch
-==== qnew -d -m
-Date: 6 0
-
-Three
-
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref
-adding 3
-Date: 6 0
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -m
-Date: 6 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d
-Date: 7 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 7.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d -m
-Date: 8 0
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew -m
-adding 4
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-Date: 9 0
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 4.patch
-now at: 3.patch
-==== qnew with HG header
-popping 5.patch
-now at: 3.patch
-# HG changeset patch
-# Date 10 0
-2: imported patch 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref
-adding 5
-# HG changeset patch
-# Parent 
-# Date 10 0
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-# HG changeset patch
-# Parent 
-# Date 11 0
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-Date: 12 0
-
-3: imported patch 6.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== hg qref
-adding 6
-Date: 12 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 12.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-Date: 13 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-popping 6.patch
-now at: 5.patch
-==== qnew -u
-adding 6
-From: jane
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-Date: 12 0
-From: jane
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 6.patch
-now at: 5.patch
-==== qnew -d
-adding 7
-Date: 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u
-From: john
-Date: 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - john - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 8
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-Date: 14 0
-From: john
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 8.patch
-now at: 7.patch
-==== qnew -m
-adding 9
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-Date: 15 0
-From: john
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 9.patch
-now at: 7.patch
-==== qpop -a / qpush -a
-popping 7.patch
-popping 5.patch
-popping 3.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 3.patch
-applying 5.patch
-applying 7.patch
-now at: 7.patch
-3: imported patch 7.patch - john - 13.00
-2: imported patch 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: imported patch 1.patch - test - 4.00
-======= hg headers
-==== init
-==== qnew -d
-# HG changeset patch
-# Parent 
-# Date 3 0
-
-0: [mq]: 1.patch - test - 3.00
-==== qref
-adding 1
-# HG changeset patch
-# Parent 
-# Date 3 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 3.00
-==== qref -d
-# HG changeset patch
-# Parent 
-# Date 4 0
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# Date 5 0
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - test
-popping 2.patch
-now at: 1.patch
-==== qnew -d -m
-# HG changeset patch
-# Parent 
-# Date 6 0
-
-Three
-
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref
-adding 3
-# HG changeset patch
-# Parent 
-# Date 6 0
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -m
-# HG changeset patch
-# Parent 
-# Date 6 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 6.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d
-# HG changeset patch
-# Parent 
-# Date 7 0
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Drei - test - 7.00
-0: [mq]: 1.patch - test - 4.00
-==== qref -d -m
-# HG changeset patch
-# Parent 
-# Date 8 0
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew -m
-adding 4
-# HG changeset patch
-# Parent 
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# Date 9 0
-# Parent 
-Four
-
-diff -r ... 4
---- /dev/null
-+++ b/4
-@@ -0,0 +1,1 @@
-+4
-2: Four - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 4.patch
-now at: 3.patch
-==== qnew with HG header
-popping 5.patch
-now at: 3.patch
-# HG changeset patch
-# Date 10 0
-2: imported patch 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref
-adding 5
-# HG changeset patch
-# Parent 
-# Date 10 0
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 10.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-# HG changeset patch
-# Parent 
-# Date 11 0
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-Date: 12 0
-
-3: imported patch 6.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== hg qref
-adding 6
-Date: 12 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 12.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== hg qref -d
-Date: 13 0
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - test - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-popping 6.patch
-now at: 5.patch
-==== qnew -u
-adding 6
-# HG changeset patch
-# Parent 
-# User jane
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -d
-# HG changeset patch
-# Date 12 0
-# Parent 
-# User jane
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-3: [mq]: 6.patch - jane
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 6.patch
-now at: 5.patch
-==== qnew -d
-adding 7
-# HG changeset patch
-# Parent 
-# Date 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - test
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# User john
-# Parent 
-# Date 13 0
-
-diff -r ... 7
---- /dev/null
-+++ b/7
-@@ -0,0 +1,1 @@
-+7
-3: [mq]: 7.patch - john - 13.00
-2: [mq]: 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: [mq]: 1.patch - test - 4.00
-==== qnew
-adding 8
-# HG changeset patch
-# Parent 
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-# HG changeset patch
-# Date 14 0
-# User john
-# Parent 
-
-diff -r ... 8
---- /dev/null
-+++ b/8
-@@ -0,0 +1,1 @@
-+8
-4: [mq]: 8.patch - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 8.patch
-now at: 7.patch
-==== qnew -m
-adding 9
-# HG changeset patch
-# Parent 
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - test
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-==== qref -u -d
-# HG changeset patch
-# Date 15 0
-# User john
-# Parent 
-Nine
-
-diff -r ... 9
---- /dev/null
-+++ b/9
-@@ -0,0 +1,1 @@
-+9
-4: Nine - john
-3: [mq]: 7.patch - john
-2: [mq]: 5.patch - test
-1: Three (again) - test
-0: [mq]: 1.patch - test
-popping 9.patch
-now at: 7.patch
-==== qpop -a / qpush -a
-popping 7.patch
-popping 5.patch
-popping 3.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 3.patch
-applying 5.patch
-applying 7.patch
-now at: 7.patch
-3: imported patch 7.patch - john - 13.00
-2: imported patch 5.patch - test - 11.00
-1: Three (again) - test - 8.00
-0: imported patch 1.patch - test - 4.00
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-header-date.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,902 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=true" >> $HGRCPATH
+  $ catpatch() {
+  >     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
+  >                                    -e "s/^\(# Parent \).*/\1/"
+  > }
+  $ catlog() {
+  >     catpatch $1
+  >     hg log --template "{rev}: {desc} - {author}\n"
+  > }
+  $ catlogd() {
+  >     catpatch $1
+  >     hg log --template "{rev}: {desc} - {author} - {date}\n"
+  > }
+  $ drop() {
+  >     hg qpop
+  >     hg qdel $1.patch
+  > }
+  $ runtest() {
+  >     echo ==== init
+  >     hg init a
+  >     cd a
+  >     hg qinit
+  > 
+  > 
+  >     echo ==== qnew -d
+  >     hg qnew -d '3 0' 1.patch
+  >     catlogd 1
+  > 
+  >     echo ==== qref
+  >     echo "1" >1
+  >     hg add
+  >     hg qref
+  >     catlogd 1
+  > 
+  >     echo ==== qref -d
+  >     hg qref -d '4 0'
+  >     catlogd 1
+  > 
+  > 
+  >     echo ==== qnew
+  >     hg qnew 2.patch
+  >     echo "2" >2
+  >     hg add
+  >     hg qref
+  >     catlog 2
+  > 
+  >     echo ==== qref -d
+  >     hg qref -d '5 0'
+  >     catlog 2
+  > 
+  >     drop 2
+  > 
+  > 
+  >     echo ==== qnew -d -m
+  >     hg qnew -d '6 0' -m "Three" 3.patch
+  >     catlogd 3
+  > 
+  >     echo ==== qref
+  >     echo "3" >3
+  >     hg add
+  >     hg qref
+  >     catlogd 3
+  > 
+  >     echo ==== qref -m
+  >     hg qref -m "Drei"
+  >     catlogd 3
+  > 
+  >     echo ==== qref -d
+  >     hg qref -d '7 0'
+  >     catlogd 3
+  > 
+  >     echo ==== qref -d -m
+  >     hg qref -d '8 0' -m "Three (again)"
+  >     catlogd 3
+  > 
+  > 
+  >     echo ==== qnew -m
+  >     hg qnew -m "Four" 4.patch
+  >     echo "4" >4
+  >     hg add
+  >     hg qref
+  >     catlog 4
+  > 
+  >     echo ==== qref -d
+  >     hg qref -d '9 0'
+  >     catlog 4
+  > 
+  >     drop 4
+  > 
+  > 
+  >     echo ==== qnew with HG header
+  >     hg qnew --config 'mq.plain=true' 5.patch
+  >     hg qpop
+  >     echo "# HG changeset patch" >>.hg/patches/5.patch
+  >     echo "# Date 10 0" >>.hg/patches/5.patch
+  >     hg qpush 2>&1 | grep 'Now at'
+  >     catlogd 5
+  > 
+  >     echo ==== hg qref
+  >     echo "5" >5
+  >     hg add
+  >     hg qref
+  >     catlogd 5
+  > 
+  >     echo ==== hg qref -d
+  >     hg qref -d '11 0'
+  >     catlogd 5
+  > 
+  > 
+  >     echo ==== qnew with plain header
+  >     hg qnew --config 'mq.plain=true' -d '12 0' 6.patch
+  >     hg qpop
+  >     hg qpush 2>&1 | grep 'now at'
+  >     catlog 6
+  > 
+  >     echo ==== hg qref
+  >     echo "6" >6
+  >     hg add
+  >     hg qref
+  >     catlogd 6
+  > 
+  >     echo ==== hg qref -d
+  >     hg qref -d '13 0'
+  >     catlogd 6
+  > 
+  >     drop 6
+  >     
+  > 
+  >     echo ==== qnew -u
+  >     hg qnew -u jane 6.patch
+  >     echo "6" >6
+  >     hg add
+  >     hg qref
+  >     catlog 6
+  > 
+  >     echo ==== qref -d
+  >     hg qref -d '12 0'
+  >     catlog 6
+  > 
+  >     drop 6
+  > 
+  > 
+  >     echo ==== qnew -d
+  >     hg qnew -d '13 0' 7.patch
+  >     echo "7" >7
+  >     hg add
+  >     hg qref
+  >     catlog 7
+  > 
+  >     echo ==== qref -u
+  >     hg qref -u john
+  >     catlogd 7
+  > 
+  > 
+  >     echo ==== qnew
+  >     hg qnew 8.patch
+  >     echo "8" >8
+  >     hg add
+  >     hg qref
+  >     catlog 8
+  > 
+  >     echo ==== qref -u -d
+  >     hg qref -u john -d '14 0'
+  >     catlog 8
+  > 
+  >     drop 8
+  > 
+  > 
+  >     echo ==== qnew -m
+  >     hg qnew -m "Nine" 9.patch
+  >     echo "9" >9
+  >     hg add
+  >     hg qref
+  >     catlog 9
+  > 
+  >     echo ==== qref -u -d
+  >     hg qref -u john -d '15 0'
+  >     catlog 9
+  > 
+  >     drop 9
+  > 
+  > 
+  >     echo ==== "qpop -a / qpush -a"
+  >     hg qpop -a
+  >     hg qpush -a
+  >     hg log --template "{rev}: {desc} - {author} - {date}\n"
+  > }
+
+======= plain headers
+
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "plain=true" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  ==== init
+  ==== qnew -d
+  Date: 3 0
+  
+  0: [mq]: 1.patch - test - 3.00
+  ==== qref
+  adding 1
+  Date: 3 0
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test - 3.00
+  ==== qref -d
+  Date: 4 0
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew
+  adding 2
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  Date: 5 0
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - test
+  popping 2.patch
+  now at: 1.patch
+  ==== qnew -d -m
+  Date: 6 0
+  
+  Three
+  
+  1: Three - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref
+  adding 3
+  Date: 6 0
+  
+  Three
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Three - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -m
+  Date: 6 0
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Drei - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -d
+  Date: 7 0
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Drei - test - 7.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -d -m
+  Date: 8 0
+  
+  Three (again)
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew -m
+  adding 4
+  Four
+  
+  diff -r ... 4
+  --- /dev/null
+  +++ b/4
+  @@ -0,0 +1,1 @@
+  +4
+  2: Four - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  Date: 9 0
+  Four
+  
+  diff -r ... 4
+  --- /dev/null
+  +++ b/4
+  @@ -0,0 +1,1 @@
+  +4
+  2: Four - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 4.patch
+  now at: 3.patch
+  ==== qnew with HG header
+  popping 5.patch
+  now at: 3.patch
+  # HG changeset patch
+  # Date 10 0
+  2: imported patch 5.patch - test - 10.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref
+  adding 5
+  # HG changeset patch
+  # Parent 
+  # Date 10 0
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  2: [mq]: 5.patch - test - 10.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref -d
+  # HG changeset patch
+  # Parent 
+  # Date 11 0
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew with plain header
+  popping 6.patch
+  now at: 5.patch
+  now at: 6.patch
+  Date: 12 0
+  
+  3: imported patch 6.patch - test
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== hg qref
+  adding 6
+  Date: 12 0
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - test - 12.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref -d
+  Date: 13 0
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - test - 13.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  popping 6.patch
+  now at: 5.patch
+  ==== qnew -u
+  adding 6
+  From: jane
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - jane
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  Date: 12 0
+  From: jane
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - jane
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 6.patch
+  now at: 5.patch
+  ==== qnew -d
+  adding 7
+  Date: 13 0
+  
+  diff -r ... 7
+  --- /dev/null
+  +++ b/7
+  @@ -0,0 +1,1 @@
+  +7
+  3: [mq]: 7.patch - test
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u
+  From: john
+  Date: 13 0
+  
+  diff -r ... 7
+  --- /dev/null
+  +++ b/7
+  @@ -0,0 +1,1 @@
+  +7
+  3: [mq]: 7.patch - john - 13.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew
+  adding 8
+  diff -r ... 8
+  --- /dev/null
+  +++ b/8
+  @@ -0,0 +1,1 @@
+  +8
+  4: [mq]: 8.patch - test
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u -d
+  Date: 14 0
+  From: john
+  
+  diff -r ... 8
+  --- /dev/null
+  +++ b/8
+  @@ -0,0 +1,1 @@
+  +8
+  4: [mq]: 8.patch - john
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 8.patch
+  now at: 7.patch
+  ==== qnew -m
+  adding 9
+  Nine
+  
+  diff -r ... 9
+  --- /dev/null
+  +++ b/9
+  @@ -0,0 +1,1 @@
+  +9
+  4: Nine - test
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u -d
+  Date: 15 0
+  From: john
+  Nine
+  
+  diff -r ... 9
+  --- /dev/null
+  +++ b/9
+  @@ -0,0 +1,1 @@
+  +9
+  4: Nine - john
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 9.patch
+  now at: 7.patch
+  ==== qpop -a / qpush -a
+  popping 7.patch
+  popping 5.patch
+  popping 3.patch
+  popping 1.patch
+  patch queue now empty
+  applying 1.patch
+  applying 3.patch
+  applying 5.patch
+  applying 7.patch
+  now at: 7.patch
+  3: imported patch 7.patch - john - 13.00
+  2: imported patch 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: imported patch 1.patch - test - 4.00
+  $ rm -r sandbox
+
+======= hg headers
+
+  $ echo "plain=false" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  ==== init
+  ==== qnew -d
+  # HG changeset patch
+  # Parent 
+  # Date 3 0
+  
+  0: [mq]: 1.patch - test - 3.00
+  ==== qref
+  adding 1
+  # HG changeset patch
+  # Parent 
+  # Date 3 0
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test - 3.00
+  ==== qref -d
+  # HG changeset patch
+  # Parent 
+  # Date 4 0
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew
+  adding 2
+  # HG changeset patch
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  # HG changeset patch
+  # Date 5 0
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - test
+  popping 2.patch
+  now at: 1.patch
+  ==== qnew -d -m
+  # HG changeset patch
+  # Parent 
+  # Date 6 0
+  
+  Three
+  
+  1: Three - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref
+  adding 3
+  # HG changeset patch
+  # Parent 
+  # Date 6 0
+  
+  Three
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Three - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -m
+  # HG changeset patch
+  # Parent 
+  # Date 6 0
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Drei - test - 6.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -d
+  # HG changeset patch
+  # Parent 
+  # Date 7 0
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Drei - test - 7.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qref -d -m
+  # HG changeset patch
+  # Parent 
+  # Date 8 0
+  
+  Three (again)
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew -m
+  adding 4
+  # HG changeset patch
+  # Parent 
+  Four
+  
+  diff -r ... 4
+  --- /dev/null
+  +++ b/4
+  @@ -0,0 +1,1 @@
+  +4
+  2: Four - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  # HG changeset patch
+  # Date 9 0
+  # Parent 
+  Four
+  
+  diff -r ... 4
+  --- /dev/null
+  +++ b/4
+  @@ -0,0 +1,1 @@
+  +4
+  2: Four - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 4.patch
+  now at: 3.patch
+  ==== qnew with HG header
+  popping 5.patch
+  now at: 3.patch
+  # HG changeset patch
+  # Date 10 0
+  2: imported patch 5.patch - test - 10.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref
+  adding 5
+  # HG changeset patch
+  # Parent 
+  # Date 10 0
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  2: [mq]: 5.patch - test - 10.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref -d
+  # HG changeset patch
+  # Parent 
+  # Date 11 0
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew with plain header
+  popping 6.patch
+  now at: 5.patch
+  now at: 6.patch
+  Date: 12 0
+  
+  3: imported patch 6.patch - test
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== hg qref
+  adding 6
+  Date: 12 0
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - test - 12.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== hg qref -d
+  Date: 13 0
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - test - 13.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  popping 6.patch
+  now at: 5.patch
+  ==== qnew -u
+  adding 6
+  # HG changeset patch
+  # Parent 
+  # User jane
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - jane
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -d
+  # HG changeset patch
+  # Date 12 0
+  # Parent 
+  # User jane
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  3: [mq]: 6.patch - jane
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 6.patch
+  now at: 5.patch
+  ==== qnew -d
+  adding 7
+  # HG changeset patch
+  # Parent 
+  # Date 13 0
+  
+  diff -r ... 7
+  --- /dev/null
+  +++ b/7
+  @@ -0,0 +1,1 @@
+  +7
+  3: [mq]: 7.patch - test
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u
+  # HG changeset patch
+  # User john
+  # Parent 
+  # Date 13 0
+  
+  diff -r ... 7
+  --- /dev/null
+  +++ b/7
+  @@ -0,0 +1,1 @@
+  +7
+  3: [mq]: 7.patch - john - 13.00
+  2: [mq]: 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: [mq]: 1.patch - test - 4.00
+  ==== qnew
+  adding 8
+  # HG changeset patch
+  # Parent 
+  
+  diff -r ... 8
+  --- /dev/null
+  +++ b/8
+  @@ -0,0 +1,1 @@
+  +8
+  4: [mq]: 8.patch - test
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u -d
+  # HG changeset patch
+  # Date 14 0
+  # User john
+  # Parent 
+  
+  diff -r ... 8
+  --- /dev/null
+  +++ b/8
+  @@ -0,0 +1,1 @@
+  +8
+  4: [mq]: 8.patch - john
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 8.patch
+  now at: 7.patch
+  ==== qnew -m
+  adding 9
+  # HG changeset patch
+  # Parent 
+  Nine
+  
+  diff -r ... 9
+  --- /dev/null
+  +++ b/9
+  @@ -0,0 +1,1 @@
+  +9
+  4: Nine - test
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  ==== qref -u -d
+  # HG changeset patch
+  # Date 15 0
+  # User john
+  # Parent 
+  Nine
+  
+  diff -r ... 9
+  --- /dev/null
+  +++ b/9
+  @@ -0,0 +1,1 @@
+  +9
+  4: Nine - john
+  3: [mq]: 7.patch - john
+  2: [mq]: 5.patch - test
+  1: Three (again) - test
+  0: [mq]: 1.patch - test
+  popping 9.patch
+  now at: 7.patch
+  ==== qpop -a / qpush -a
+  popping 7.patch
+  popping 5.patch
+  popping 3.patch
+  popping 1.patch
+  patch queue now empty
+  applying 1.patch
+  applying 3.patch
+  applying 5.patch
+  applying 7.patch
+  now at: 7.patch
+  3: imported patch 7.patch - john - 13.00
+  2: imported patch 5.patch - test - 11.00
+  1: Three (again) - test - 8.00
+  0: imported patch 1.patch - test - 4.00
+  $ rm -r sandbox
--- a/tests/test-mq-header-from	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "nodates=true" >> $HGRCPATH
-
-
-catlog() {
-    cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
-                                   -e "s/^\(# Parent \).*/\1/"
-    hg log --template "{rev}: {desc} - {author}\n"
-}
-
-runtest() {
-    echo ==== init
-    hg init a
-    cd a
-    hg qinit
-
-
-    echo ==== qnew -U
-    hg qnew -U 1.patch
-    catlog 1
-
-    echo ==== qref
-    echo "1" >1
-    hg add
-    hg qref
-    catlog 1
-
-    echo ==== qref -u
-    hg qref -u mary
-    catlog 1
-
-    echo ==== qnew
-    hg qnew 2.patch
-    echo "2" >2
-    hg add
-    hg qref
-    catlog 2
-
-    echo ==== qref -u
-    hg qref -u jane
-    catlog 2
-
-
-    echo ==== qnew -U -m
-    hg qnew -U -m "Three" 3.patch
-    catlog 3
-
-    echo ==== qref
-    echo "3" >3
-    hg add
-    hg qref
-    catlog 3
-
-    echo ==== qref -m
-    hg qref -m "Drei"
-    catlog 3
-
-    echo ==== qref -u
-    hg qref -u mary
-    catlog 3
-
-    echo ==== qref -u -m
-    hg qref -u maria -m "Three (again)"
-    catlog 3
-
-    echo ==== qnew -m
-    hg qnew -m "Four" 4.patch
-    echo "4" >4of t
-    hg add
-    hg qref
-    catlog 4
-
-    echo ==== qref -u
-    hg qref -u jane
-    catlog 4
-
-
-    echo ==== qnew with HG header
-    hg qnew --config 'mq.plain=true' 5.patch
-    hg qpop
-    echo "# HG changeset patch" >>.hg/patches/5.patch
-    echo "# User johndoe" >>.hg/patches/5.patch
-    hg qpush 2>&1 | grep 'now at'
-    catlog 5
-
-    echo ==== hg qref
-    echo "5" >5
-    hg add
-    hg qref
-    catlog 5
-
-    echo ==== hg qref -U
-    hg qref -U
-    catlog 5
-
-    echo ==== hg qref -u
-    hg qref -u johndeere
-    catlog 5
-
-
-    echo ==== qnew with plain header
-    hg qnew --config 'mq.plain=true' -U 6.patch
-    hg qpop
-    hg qpush 2>&1 | grep 'now at'
-    catlog 6
-
-    echo ==== hg qref
-    echo "6" >6
-    hg add
-    hg qref
-    catlog 6
-
-    echo ==== hg qref -U
-    hg qref -U
-    catlog 6
-
-    echo ==== hg qref -u
-    hg qref -u johndeere
-    catlog 6
-
-
-    echo ==== "qpop -a / qpush -a"
-    hg qpop -a
-    hg qpush -a
-    hg log --template "{rev}: {desc} - {author}\n"
-}
-
-
-echo ======= plain headers
-
-echo "[mq]" >> $HGRCPATH
-echo "plain=true" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-
-echo ======= hg headers
-
-echo "plain=false" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-runtest
--- a/tests/test-mq-header-from.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,829 +0,0 @@
-======= plain headers
-==== init
-==== qnew -U
-From: test
-
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-From: test
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-From: mary
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-From: jane
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-From: test
-
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-From: test
-
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-From: test
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-From: mary
-
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-From: maria
-
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-From: jane
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# Parent 
-# User johndoe
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# Parent 
-# User test
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# Parent 
-# User johndeere
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
-======= hg headers
-==== init
-==== qnew -U
-# HG changeset patch
-# Parent 
-# User test
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-# HG changeset patch
-# Parent 
-# User test
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# Parent 
-# User mary
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-# HG changeset patch
-# Parent 
-# User test
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-# HG changeset patch
-# Parent 
-# User test
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-# HG changeset patch
-# Parent 
-# User test
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# Parent 
-# User mary
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-# HG changeset patch
-# Parent 
-# User maria
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-# HG changeset patch
-# Parent 
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# Parent 
-# User johndoe
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# Parent 
-# User test
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# Parent 
-# User johndeere
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
-==== init
-==== qnew -U
-# HG changeset patch
-# Parent 
-# User test
-0: [mq]: 1.patch - test
-==== qref
-adding 1
-# HG changeset patch
-# Parent 
-# User test
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - test
-==== qref -u
-# HG changeset patch
-# Parent 
-# User mary
-
-diff -r ... 1
---- /dev/null
-+++ b/1
-@@ -0,0 +1,1 @@
-+1
-0: [mq]: 1.patch - mary
-==== qnew
-adding 2
-# HG changeset patch
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - test
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-
-diff -r ... 2
---- /dev/null
-+++ b/2
-@@ -0,0 +1,1 @@
-+2
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -U -m
-# HG changeset patch
-# Parent 
-# User test
-Three
-
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref
-adding 3
-# HG changeset patch
-# Parent 
-# User test
-Three
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -m
-# HG changeset patch
-# Parent 
-# User test
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - test
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# Parent 
-# User mary
-Drei
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Drei - mary
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u -m
-# HG changeset patch
-# Parent 
-# User maria
-Three (again)
-
-diff -r ... 3
---- /dev/null
-+++ b/3
-@@ -0,0 +1,1 @@
-+3
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew -m
-adding 4of
-# HG changeset patch
-# Parent 
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - test
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qref -u
-# HG changeset patch
-# User jane
-# Parent 
-Four
-
-diff -r ... 4of
---- /dev/null
-+++ b/4of
-@@ -0,0 +1,1 @@
-+4 t
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with HG header
-popping 5.patch
-now at: 4.patch
-now at: 5.patch
-# HG changeset patch
-# User johndoe
-4: imported patch 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 5
-# HG changeset patch
-# Parent 
-# User johndoe
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndoe
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-# HG changeset patch
-# Parent 
-# User test
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - test
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-# HG changeset patch
-# Parent 
-# User johndeere
-
-diff -r ... 5
---- /dev/null
-+++ b/5
-@@ -0,0 +1,1 @@
-+5
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qnew with plain header
-popping 6.patch
-now at: 5.patch
-now at: 6.patch
-From: test
-
-5: imported patch 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref
-adding 6
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -U
-From: test
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - test
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== hg qref -u
-From: johndeere
-
-diff -r ... 6
---- /dev/null
-+++ b/6
-@@ -0,0 +1,1 @@
-+6
-5: [mq]: 6.patch - johndeere
-4: [mq]: 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: [mq]: 2.patch - jane
-0: [mq]: 1.patch - mary
-==== qpop -a / qpush -a
-popping 6.patch
-popping 5.patch
-popping 4.patch
-popping 3.patch
-popping 2.patch
-popping 1.patch
-patch queue now empty
-applying 1.patch
-applying 2.patch
-applying 3.patch
-applying 4.patch
-applying 5.patch
-applying 6.patch
-now at: 6.patch
-5: imported patch 6.patch - johndeere
-4: imported patch 5.patch - johndeere
-3: Four - jane
-2: Three (again) - maria
-1: imported patch 2.patch - jane
-0: imported patch 1.patch - mary
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-header-from.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,969 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "nodates=true" >> $HGRCPATH
+  $ catlog() {
+  >     cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \
+  >                                    -e "s/^\(# Parent \).*/\1/"
+  >     hg log --template "{rev}: {desc} - {author}\n"
+  > }
+  $ runtest() {
+  >     echo ==== init
+  >     hg init a
+  >     cd a
+  >     hg qinit
+  > 
+  > 
+  >     echo ==== qnew -U
+  >     hg qnew -U 1.patch
+  >     catlog 1
+  > 
+  >     echo ==== qref
+  >     echo "1" >1
+  >     hg add
+  >     hg qref
+  >     catlog 1
+  > 
+  >     echo ==== qref -u
+  >     hg qref -u mary
+  >     catlog 1
+  > 
+  >     echo ==== qnew
+  >     hg qnew 2.patch
+  >     echo "2" >2
+  >     hg add
+  >     hg qref
+  >     catlog 2
+  > 
+  >     echo ==== qref -u
+  >     hg qref -u jane
+  >     catlog 2
+  > 
+  > 
+  >     echo ==== qnew -U -m
+  >     hg qnew -U -m "Three" 3.patch
+  >     catlog 3
+  > 
+  >     echo ==== qref
+  >     echo "3" >3
+  >     hg add
+  >     hg qref
+  >     catlog 3
+  > 
+  >     echo ==== qref -m
+  >     hg qref -m "Drei"
+  >     catlog 3
+  > 
+  >     echo ==== qref -u
+  >     hg qref -u mary
+  >     catlog 3
+  > 
+  >     echo ==== qref -u -m
+  >     hg qref -u maria -m "Three (again)"
+  >     catlog 3
+  > 
+  >     echo ==== qnew -m
+  >     hg qnew -m "Four" 4.patch
+  >     echo "4" >4of t
+  >     hg add
+  >     hg qref
+  >     catlog 4
+  > 
+  >     echo ==== qref -u
+  >     hg qref -u jane
+  >     catlog 4
+  > 
+  > 
+  >     echo ==== qnew with HG header
+  >     hg qnew --config 'mq.plain=true' 5.patch
+  >     hg qpop
+  >     echo "# HG changeset patch" >>.hg/patches/5.patch
+  >     echo "# User johndoe" >>.hg/patches/5.patch
+  >     hg qpush 2>&1 | grep 'now at'
+  >     catlog 5
+  > 
+  >     echo ==== hg qref
+  >     echo "5" >5
+  >     hg add
+  >     hg qref
+  >     catlog 5
+  > 
+  >     echo ==== hg qref -U
+  >     hg qref -U
+  >     catlog 5
+  > 
+  >     echo ==== hg qref -u
+  >     hg qref -u johndeere
+  >     catlog 5
+  > 
+  > 
+  >     echo ==== qnew with plain header
+  >     hg qnew --config 'mq.plain=true' -U 6.patch
+  >     hg qpop
+  >     hg qpush 2>&1 | grep 'now at'
+  >     catlog 6
+  > 
+  >     echo ==== hg qref
+  >     echo "6" >6
+  >     hg add
+  >     hg qref
+  >     catlog 6
+  > 
+  >     echo ==== hg qref -U
+  >     hg qref -U
+  >     catlog 6
+  > 
+  >     echo ==== hg qref -u
+  >     hg qref -u johndeere
+  >     catlog 6
+  > 
+  > 
+  >     echo ==== "qpop -a / qpush -a"
+  >     hg qpop -a
+  >     hg qpush -a
+  >     hg log --template "{rev}: {desc} - {author}\n"
+  > }
+
+======= plain headers
+
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "plain=true" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  ==== init
+  ==== qnew -U
+  From: test
+  
+  0: [mq]: 1.patch - test
+  ==== qref
+  adding 1
+  From: test
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test
+  ==== qref -u
+  From: mary
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - mary
+  ==== qnew
+  adding 2
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  From: jane
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -U -m
+  From: test
+  
+  Three
+  
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref
+  adding 3
+  From: test
+  
+  Three
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -m
+  From: test
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  From: mary
+  
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - mary
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u -m
+  From: maria
+  
+  Three (again)
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -m
+  adding 4of
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - test
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  From: jane
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with HG header
+  popping 5.patch
+  now at: 4.patch
+  now at: 5.patch
+  # HG changeset patch
+  # User johndoe
+  4: imported patch 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 5
+  # HG changeset patch
+  # Parent 
+  # User johndoe
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  # HG changeset patch
+  # Parent 
+  # User test
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - test
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  # HG changeset patch
+  # Parent 
+  # User johndeere
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with plain header
+  popping 6.patch
+  now at: 5.patch
+  now at: 6.patch
+  From: test
+  
+  5: imported patch 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 6
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  From: johndeere
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - johndeere
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qpop -a / qpush -a
+  popping 6.patch
+  popping 5.patch
+  popping 4.patch
+  popping 3.patch
+  popping 2.patch
+  popping 1.patch
+  patch queue now empty
+  applying 1.patch
+  applying 2.patch
+  applying 3.patch
+  applying 4.patch
+  applying 5.patch
+  applying 6.patch
+  now at: 6.patch
+  5: imported patch 6.patch - johndeere
+  4: imported patch 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: imported patch 2.patch - jane
+  0: imported patch 1.patch - mary
+  $ rm -r sandbox
+
+======= hg headers
+
+  $ echo "plain=false" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  ==== init
+  ==== qnew -U
+  # HG changeset patch
+  # Parent 
+  # User test
+  0: [mq]: 1.patch - test
+  ==== qref
+  adding 1
+  # HG changeset patch
+  # Parent 
+  # User test
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test
+  ==== qref -u
+  # HG changeset patch
+  # Parent 
+  # User mary
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - mary
+  ==== qnew
+  adding 2
+  # HG changeset patch
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # User jane
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -U -m
+  # HG changeset patch
+  # Parent 
+  # User test
+  Three
+  
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref
+  adding 3
+  # HG changeset patch
+  # Parent 
+  # User test
+  Three
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -m
+  # HG changeset patch
+  # Parent 
+  # User test
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # Parent 
+  # User mary
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - mary
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u -m
+  # HG changeset patch
+  # Parent 
+  # User maria
+  Three (again)
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -m
+  adding 4of
+  # HG changeset patch
+  # Parent 
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - test
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # User jane
+  # Parent 
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with HG header
+  popping 5.patch
+  now at: 4.patch
+  now at: 5.patch
+  # HG changeset patch
+  # User johndoe
+  4: imported patch 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 5
+  # HG changeset patch
+  # Parent 
+  # User johndoe
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  # HG changeset patch
+  # Parent 
+  # User test
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - test
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  # HG changeset patch
+  # Parent 
+  # User johndeere
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with plain header
+  popping 6.patch
+  now at: 5.patch
+  now at: 6.patch
+  From: test
+  
+  5: imported patch 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 6
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  From: johndeere
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - johndeere
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qpop -a / qpush -a
+  popping 6.patch
+  popping 5.patch
+  popping 4.patch
+  popping 3.patch
+  popping 2.patch
+  popping 1.patch
+  patch queue now empty
+  applying 1.patch
+  applying 2.patch
+  applying 3.patch
+  applying 4.patch
+  applying 5.patch
+  applying 6.patch
+  now at: 6.patch
+  5: imported patch 6.patch - johndeere
+  4: imported patch 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: imported patch 2.patch - jane
+  0: imported patch 1.patch - mary
+  $ rm -r sandbox
+  $ runtest
+  ==== init
+  ==== qnew -U
+  # HG changeset patch
+  # Parent 
+  # User test
+  0: [mq]: 1.patch - test
+  ==== qref
+  adding 1
+  # HG changeset patch
+  # Parent 
+  # User test
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - test
+  ==== qref -u
+  # HG changeset patch
+  # Parent 
+  # User mary
+  
+  diff -r ... 1
+  --- /dev/null
+  +++ b/1
+  @@ -0,0 +1,1 @@
+  +1
+  0: [mq]: 1.patch - mary
+  ==== qnew
+  adding 2
+  # HG changeset patch
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - test
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # User jane
+  # Parent 
+  
+  diff -r ... 2
+  --- /dev/null
+  +++ b/2
+  @@ -0,0 +1,1 @@
+  +2
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -U -m
+  # HG changeset patch
+  # Parent 
+  # User test
+  Three
+  
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref
+  adding 3
+  # HG changeset patch
+  # Parent 
+  # User test
+  Three
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -m
+  # HG changeset patch
+  # Parent 
+  # User test
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - test
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # Parent 
+  # User mary
+  Drei
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Drei - mary
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u -m
+  # HG changeset patch
+  # Parent 
+  # User maria
+  Three (again)
+  
+  diff -r ... 3
+  --- /dev/null
+  +++ b/3
+  @@ -0,0 +1,1 @@
+  +3
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew -m
+  adding 4of
+  # HG changeset patch
+  # Parent 
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - test
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qref -u
+  # HG changeset patch
+  # User jane
+  # Parent 
+  Four
+  
+  diff -r ... 4of
+  --- /dev/null
+  +++ b/4of
+  @@ -0,0 +1,1 @@
+  +4 t
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with HG header
+  popping 5.patch
+  now at: 4.patch
+  now at: 5.patch
+  # HG changeset patch
+  # User johndoe
+  4: imported patch 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 5
+  # HG changeset patch
+  # Parent 
+  # User johndoe
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndoe
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  # HG changeset patch
+  # Parent 
+  # User test
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - test
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  # HG changeset patch
+  # Parent 
+  # User johndeere
+  
+  diff -r ... 5
+  --- /dev/null
+  +++ b/5
+  @@ -0,0 +1,1 @@
+  +5
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qnew with plain header
+  popping 6.patch
+  now at: 5.patch
+  now at: 6.patch
+  From: test
+  
+  5: imported patch 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref
+  adding 6
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -U
+  From: test
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - test
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== hg qref -u
+  From: johndeere
+  
+  diff -r ... 6
+  --- /dev/null
+  +++ b/6
+  @@ -0,0 +1,1 @@
+  +6
+  5: [mq]: 6.patch - johndeere
+  4: [mq]: 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: [mq]: 2.patch - jane
+  0: [mq]: 1.patch - mary
+  ==== qpop -a / qpush -a
+  popping 6.patch
+  popping 5.patch
+  popping 4.patch
+  popping 3.patch
+  popping 2.patch
+  popping 1.patch
+  patch queue now empty
+  applying 1.patch
+  applying 2.patch
+  applying 3.patch
+  applying 4.patch
+  applying 5.patch
+  applying 6.patch
+  now at: 6.patch
+  5: imported patch 6.patch - johndeere
+  4: imported patch 5.patch - johndeere
+  3: Four - jane
+  2: Three (again) - maria
+  1: imported patch 2.patch - jane
+  0: imported patch 1.patch - mary
--- a/tests/test-mq-qclone-http	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-#! /bin/sh
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-mkdir webdir
-cd webdir
-
-hg init a
-hg --cwd a qinit -c
-echo a > a/a
-hg --cwd a ci -A -m a
-echo b > a/b
-hg --cwd a addremove
-hg --cwd a qnew -f b.patch
-hg --cwd a qcommit -m b.patch
-
-hg --cwd a log --template "{desc}\n"
-hg --cwd a/.hg/patches log --template "{desc}\n"
-
-root=`pwd`
-
-cd ..
-
-echo % test with recursive collection
-
-cat > collections.conf <<EOF
-[paths]
-/=$root/**
-EOF
-
-hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
-    -A access-paths.log -E error-paths-1.log
-cat hg.pid >> $DAEMON_PIDS
-
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
-
-hg qclone http://localhost:$HGPORT/a b
-hg --cwd b log --template "{desc}\n"
-hg --cwd b qpush -a
-hg --cwd b log --template "{desc}\n"
-
-echo % test with normal collection
-
-cat > collections1.conf <<EOF
-[paths]
-/=$root/*
-EOF
-
-hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
-    -A access-paths.log -E error-paths-1.log
-cat hg.pid >> $DAEMON_PIDS
-
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
-
-hg qclone http://localhost:$HGPORT1/a c
-hg --cwd c log --template "{desc}\n"
-hg --cwd c qpush -a
-hg --cwd c log --template "{desc}\n"
-
-echo % test with old-style collection
-
-cat > collections2.conf <<EOF
-[collections]
-$root=$root
-EOF
-
-hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
-    -A access-paths.log -E error-paths-1.log
-cat hg.pid >> $DAEMON_PIDS
-
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
-
-hg qclone http://localhost:$HGPORT2/a d
-hg --cwd d log --template "{desc}\n"
-hg --cwd d qpush -a
-hg --cwd d log --template "{desc}\n"
-
-echo '% test --mq works and uses correct repository config'
-hg --cwd d outgoing --mq | sed "s|$HGPORT2|\$HGPORT2|"
-hg --cwd d log --mq --template '{rev} {desc|firstline}\n'
--- a/tests/test-mq-qclone-http.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-adding a
-adding b
-[mq]: b.patch
-a
-b.patch
-% test with recursive collection
-200 Script output follows
-
-
-/a/
-/a/.hg/patches/
-
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-applying b.patch
-now at: b.patch
-imported patch b.patch
-a
-% test with normal collection
-200 Script output follows
-
-
-/a/
-/a/.hg/patches/
-
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-applying b.patch
-now at: b.patch
-imported patch b.patch
-a
-% test with old-style collection
-200 Script output follows
-
-
-/a/
-/a/.hg/patches/
-
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 3 changes to 3 files
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-applying b.patch
-now at: b.patch
-imported patch b.patch
-a
-% test --mq works and uses correct repository config
-comparing with http://localhost:$HGPORT2/a/.hg/patches
-searching for changes
-no changes found
-0 b.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qclone-http.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,149 @@
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ mkdir webdir
+  $ cd webdir
+  $ hg init a
+  $ hg --cwd a qinit -c
+  $ echo a > a/a
+  $ hg --cwd a ci -A -m a
+  adding a
+  $ echo b > a/b
+  $ hg --cwd a addremove
+  adding b
+  $ hg --cwd a qnew -f b.patch
+  $ hg --cwd a qcommit -m b.patch
+  $ hg --cwd a log --template "{desc}\n"
+  [mq]: b.patch
+  a
+  $ hg --cwd a/.hg/patches log --template "{desc}\n"
+  b.patch
+  $ root=`pwd`
+  $ cd ..
+
+test with recursive collection
+
+  $ cat > collections.conf <<EOF
+  > [paths]
+  > /=$root/**
+  > EOF
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
+  >     -A access-paths.log -E error-paths-1.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
+  200 Script output follows
+  
+  
+  /a/
+  /a/.hg/patches/
+  
+  $ hg qclone http://localhost:$HGPORT/a b
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd b log --template "{desc}\n"
+  a
+  $ hg --cwd b qpush -a
+  applying b.patch
+  now at: b.patch
+  $ hg --cwd b log --template "{desc}\n"
+  imported patch b.patch
+  a
+
+test with normal collection
+
+  $ cat > collections1.conf <<EOF
+  > [paths]
+  > /=$root/*
+  > EOF
+  $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
+  >     -A access-paths.log -E error-paths-1.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
+  200 Script output follows
+  
+  
+  /a/
+  /a/.hg/patches/
+  
+  $ hg qclone http://localhost:$HGPORT1/a c
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd c log --template "{desc}\n"
+  a
+  $ hg --cwd c qpush -a
+  applying b.patch
+  now at: b.patch
+  $ hg --cwd c log --template "{desc}\n"
+  imported patch b.patch
+  a
+
+test with old-style collection
+
+  $ cat > collections2.conf <<EOF
+  > [collections]
+  > $root=$root
+  > EOF
+  $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
+  >     -A access-paths.log -E error-paths-1.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
+  200 Script output follows
+  
+  
+  /a/
+  /a/.hg/patches/
+  
+  $ hg qclone http://localhost:$HGPORT2/a d
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 3 changes to 3 files
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg --cwd d log --template "{desc}\n"
+  a
+  $ hg --cwd d qpush -a
+  applying b.patch
+  now at: b.patch
+  $ hg --cwd d log --template "{desc}\n"
+  imported patch b.patch
+  a
+
+test --mq works and uses correct repository config
+
+  $ hg --cwd d outgoing --mq
+  comparing with http://localhost:*/a/.hg/patches (glob)
+  searching for changes
+  no changes found
+  [1]
+  $ hg --cwd d log --mq --template '{rev} {desc|firstline}\n'
+  0 b.patch
--- a/tests/test-mq-qimport	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-#!/bin/sh
-
-cat > writelines.py <<EOF
-import sys
-path = sys.argv[1]
-args = sys.argv[2:]
-assert (len(args) % 2) == 0
-
-f = file(path, 'wb')
-for i in xrange(len(args)/2):
-   count, s = args[2*i:2*i+2]
-   count = int(count)
-   s = s.decode('string_escape')
-   f.write(s*count)
-f.close()
-
-EOF
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-echo "[diff]" >> $HGRCPATH
-echo "git=1" >> $HGRCPATH
-
-hg init repo
-cd repo
-
-echo % qimport non-existing-file
-hg qimport non-existing-file
-
-echo % import email
-hg qimport --push -n email - <<EOF
-From: Username in email <test@example.net>
-Subject: [PATCH] Message in email
-Date: Fri, 02 Jan 1970 00:00:00 +0000
-
-Text before patch.
-
-# HG changeset patch
-# User Username in patch <test@example.net>
-# Date 0 0
-# Node ID 1a706973a7d84cb549823634a821d9bdf21c6220
-# Parent  0000000000000000000000000000000000000000
-First line of commit message.
-
-More text in commit message.
---- confuse the diff detection
-
-diff --git a/x b/x
-new file mode 100644
---- /dev/null
-+++ b/x
-@@ -0,0 +1,1 @@
-+new file
-Text after patch.
-
-EOF
-
-echo % hg tip -v
-hg tip -v
-hg qpop
-hg qdelete email
-
-echo % import URL
-echo foo >> foo
-hg add foo
-hg diff > $HGTMP/url.diff
-hg revert --no-backup foo
-rm foo
-# Under unix: file:///foobar/blah
-# Under windows: file:///c:/foobar/blah
-patchurl=`echo "$HGTMP"/url.diff | tr '\\\\' /`
-expr "$patchurl" : "\/" > /dev/null
-if [ $? -ne 0 ]; then
-    patchurl="/$patchurl"
-fi
-hg qimport file://"$patchurl"
-hg qun
-
-echo % import patch that already exists
-echo foo2 >> foo
-hg add foo
-hg diff > ../url.diff
-hg revert --no-backup foo
-rm foo
-hg qimport ../url.diff
-hg qpush
-cat foo
-hg qpop
-echo % qimport -f
-hg qimport -f ../url.diff
-hg qpush
-cat foo
-hg qpop
-
-echo % build diff with CRLF
-python ../writelines.py b 5 'a\n' 5 'a\r\n'
-hg ci -Am addb
-python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
-hg diff > b.diff
-hg up -C
-echo % qimport CRLF diff
-hg qimport b.diff
-hg qpush
-
-echo % try to import --push
-echo another >> b
-hg diff > another.diff
-hg up -C
-hg qimport --push another.diff
-hg qfin -a
-hg qimport -rtip -P
-
-hg qpop -a
-hg qdel -k 2.diff
-echo % qimport -e
-hg qimport -e 2.diff
-hg qdel -k 2.diff
-echo % qimport -e --name newname oldexisitingpatch
-hg qimport -e --name this-name-is-better 2.diff
-hg qser
-echo % qimport -e --name without --force
-cp .hg/patches/this-name-is-better .hg/patches/3.diff
-hg qimport -e --name this-name-is-better 3.diff
-hg qser
-echo % qimport -e --name with --force
-hg qimport --force -e --name this-name-is-better 3.diff
-hg qser
--- a/tests/test-mq-qimport-fail-cleanup	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#!/bin/sh
-#failed qimport of patches from files should cleanup by recording successfully
-#imported patches in series file.
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init repo
-cd repo
-
-echo a > a
-hg ci -Am'add a'
-
-cat >b.patch<<EOF
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+b
-EOF
-
-echo
-echo '#empty series'
-hg qseries
-
-echo
-echo '#qimport valid patch followed by invalid patch'
-hg qimport b.patch fakepatch
-
-echo
-echo '#valid patches before fail added to series'
-hg qseries
--- a/tests/test-mq-qimport-fail-cleanup.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-adding a
-
-#empty series
-
-#qimport valid patch followed by invalid patch
-adding b.patch to series file
-abort: unable to read file fakepatch
-
-#valid patches before fail added to series
-b.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qimport-fail-cleanup.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,40 @@
+Failed qimport of patches from files should cleanup by recording successfully
+imported patches in series file.
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ hg init repo
+  $ cd repo
+  $ echo a > a
+  $ hg ci -Am'add a'
+  adding a
+  $ cat >b.patch<<EOF
+  > diff --git a/a b/a
+  > --- a/a
+  > +++ b/a
+  > @@ -1,1 +1,2 @@
+  >  a
+  > +b
+  > EOF
+  $ echo
+  
+
+empty series
+
+  $ hg qseries
+  $ echo
+  
+
+qimport valid patch followed by invalid patch
+
+  $ hg qimport b.patch fakepatch
+  adding b.patch to series file
+  abort: unable to read file fakepatch
+  [255]
+  $ echo
+  
+
+valid patches before fail added to series
+
+  $ hg qseries
+  b.patch
--- a/tests/test-mq-qimport.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-% qimport non-existing-file
-abort: unable to read file non-existing-file
-% import email
-adding email to series file
-applying email
-now at: email
-% hg tip -v
-changeset:   0:1a706973a7d8
-tag:         email
-tag:         qbase
-tag:         qtip
-tag:         tip
-user:        Username in patch <test@example.net>
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       x
-description:
-First line of commit message.
-
-More text in commit message.
-
-
-popping email
-patch queue now empty
-% import URL
-adding url.diff to series file
-url.diff
-% import patch that already exists
-abort: patch "url.diff" already exists
-applying url.diff
-now at: url.diff
-foo
-popping url.diff
-patch queue now empty
-% qimport -f
-adding url.diff to series file
-applying url.diff
-now at: url.diff
-foo2
-popping url.diff
-patch queue now empty
-% build diff with CRLF
-adding b
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% qimport CRLF diff
-adding b.diff to series file
-applying b.diff
-now at: b.diff
-% try to import --push
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-adding another.diff to series file
-applying another.diff
-now at: another.diff
-patch b.diff finalized without changeset message
-patch another.diff finalized without changeset message
-popping 2.diff
-patch queue now empty
-% qimport -e
-adding 2.diff to series file
-% qimport -e --name newname oldexisitingpatch
-renaming 2.diff to this-name-is-better
-adding this-name-is-better to series file
-this-name-is-better
-url.diff
-% qimport -e --name without --force
-abort: patch "this-name-is-better" already exists
-this-name-is-better
-url.diff
-% qimport -e --name with --force
-renaming 3.diff to this-name-is-better
-adding this-name-is-better to series file
-this-name-is-better
-url.diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qimport.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,203 @@
+
+  $ cat > writelines.py <<EOF
+  > import sys
+  > path = sys.argv[1]
+  > args = sys.argv[2:]
+  > assert (len(args) % 2) == 0
+  > 
+  > f = file(path, 'wb')
+  > for i in xrange(len(args)/2):
+  >    count, s = args[2*i:2*i+2]
+  >    count = int(count)
+  >    s = s.decode('string_escape')
+  >    f.write(s*count)
+  > f.close()
+  > 
+  > EOF
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ echo "[diff]" >> $HGRCPATH
+  $ echo "git=1" >> $HGRCPATH
+  $ hg init repo
+  $ cd repo
+
+qimport non-existing-file
+
+  $ hg qimport non-existing-file
+  abort: unable to read file non-existing-file
+  [255]
+
+import email
+
+  $ hg qimport --push -n email - <<EOF
+  > From: Username in email <test@example.net>
+  > Subject: [PATCH] Message in email
+  > Date: Fri, 02 Jan 1970 00:00:00 +0000
+  > 
+  > Text before patch.
+  > 
+  > # HG changeset patch
+  > # User Username in patch <test@example.net>
+  > # Date 0 0
+  > # Node ID 1a706973a7d84cb549823634a821d9bdf21c6220
+  > # Parent  0000000000000000000000000000000000000000
+  > First line of commit message.
+  > 
+  > More text in commit message.
+  > --- confuse the diff detection
+  > 
+  > diff --git a/x b/x
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/x
+  > @@ -0,0 +1,1 @@
+  > +new file
+  > Text after patch.
+  > 
+  > EOF
+  adding email to series file
+  applying email
+  now at: email
+
+hg tip -v
+
+  $ hg tip -v
+  changeset:   0:1a706973a7d8
+  tag:         email
+  tag:         qbase
+  tag:         qtip
+  tag:         tip
+  user:        Username in patch <test@example.net>
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       x
+  description:
+  First line of commit message.
+  
+  More text in commit message.
+  
+  
+  $ hg qpop
+  popping email
+  patch queue now empty
+  $ hg qdelete email
+
+import URL
+
+  $ echo foo >> foo
+  $ hg add foo
+  $ hg diff > $HGTMP/url.diff
+  $ hg revert --no-backup foo
+  $ rm foo
+
+Under unix: file:///foobar/blah
+Under windows: file:///c:/foobar/blah
+
+  $ patchurl=`echo "$HGTMP"/url.diff | tr '\\\\' /`
+  $ expr "$patchurl" : "\/" > /dev/null || patchurl="/$patchurl"
+  $ hg qimport file://"$patchurl"
+  adding url.diff to series file
+  $ hg qun
+  url.diff
+
+import patch that already exists
+
+  $ echo foo2 >> foo
+  $ hg add foo
+  $ hg diff > ../url.diff
+  $ hg revert --no-backup foo
+  $ rm foo
+  $ hg qimport ../url.diff
+  abort: patch "url.diff" already exists
+  [255]
+  $ hg qpush
+  applying url.diff
+  now at: url.diff
+  $ cat foo
+  foo
+  $ hg qpop
+  popping url.diff
+  patch queue now empty
+
+qimport -f
+
+  $ hg qimport -f ../url.diff
+  adding url.diff to series file
+  $ hg qpush
+  applying url.diff
+  now at: url.diff
+  $ cat foo
+  foo2
+  $ hg qpop
+  popping url.diff
+  patch queue now empty
+
+build diff with CRLF
+
+  $ python ../writelines.py b 5 'a\n' 5 'a\r\n'
+  $ hg ci -Am addb
+  adding b
+  $ python ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n'
+  $ hg diff > b.diff
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+qimport CRLF diff
+
+  $ hg qimport b.diff
+  adding b.diff to series file
+  $ hg qpush
+  applying b.diff
+  now at: b.diff
+
+try to import --push
+
+  $ echo another >> b
+  $ hg diff > another.diff
+  $ hg up -C
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg qimport --push another.diff
+  adding another.diff to series file
+  applying another.diff
+  now at: another.diff
+  $ hg qfin -a
+  patch b.diff finalized without changeset message
+  patch another.diff finalized without changeset message
+  $ hg qimport -rtip -P
+  $ hg qpop -a
+  popping 2.diff
+  patch queue now empty
+  $ hg qdel -k 2.diff
+
+qimport -e
+
+  $ hg qimport -e 2.diff
+  adding 2.diff to series file
+  $ hg qdel -k 2.diff
+
+qimport -e --name newname oldexisitingpatch
+
+  $ hg qimport -e --name this-name-is-better 2.diff
+  renaming 2.diff to this-name-is-better
+  adding this-name-is-better to series file
+  $ hg qser
+  this-name-is-better
+  url.diff
+
+qimport -e --name without --force
+
+  $ cp .hg/patches/this-name-is-better .hg/patches/3.diff
+  $ hg qimport -e --name this-name-is-better 3.diff
+  abort: patch "this-name-is-better" already exists
+  [255]
+  $ hg qser
+  this-name-is-better
+  url.diff
+
+qimport -e --name with --force
+
+  $ hg qimport --force -e --name this-name-is-better 3.diff
+  renaming 3.diff to this-name-is-better
+  adding this-name-is-better to series file
+  $ hg qser
+  this-name-is-better
+  url.diff
--- a/tests/test-mq-qnew	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-#!/bin/sh
-
-catpatch() {
-    cat $1 | sed -e "s/^\(# Parent \).*/\1/"
-}
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-runtest() {
-    hg init mq
-    cd mq
-
-    echo a > a
-    hg ci -Ama
-
-    echo '% qnew should refuse bad patch names'
-    hg qnew series
-    hg qnew status
-    hg qnew guards
-    hg qnew .hgignore
-    hg qnew .mqfoo
-    hg qnew 'foo#bar'
-    hg qnew 'foo:bar'
-
-    hg qinit -c
-
-    echo '% qnew with name containing slash'
-    hg qnew foo/bar.patch
-    hg qseries
-    hg qpop
-    hg qdelete foo/bar.patch
-
-    echo '% qnew with uncommitted changes'
-    echo a > somefile
-    hg add somefile
-    hg qnew uncommitted.patch
-    hg st
-    hg qseries
-
-    echo '% qnew implies add'
-    hg -R .hg/patches st
-
-    echo '% qnew missing'
-    hg qnew missing.patch missing
-
-    echo '% qnew -m'
-    hg qnew -m 'foo bar' mtest.patch
-    catpatch .hg/patches/mtest.patch
-
-    echo '% qnew twice'
-    hg qnew first.patch
-    hg qnew first.patch
-
-    touch ../first.patch
-    hg qimport ../first.patch
-
-    echo '% qnew -f from a subdirectory'
-    hg qpop -a
-    mkdir d
-    cd d
-    echo b > b
-    hg ci -Am t
-    echo b >> b
-    hg st
-    hg qnew -g -f p
-    catpatch ../.hg/patches/p
-
-    echo '% qnew -u with no username configured'
-    HGUSER= hg qnew -u blue red
-    catpatch ../.hg/patches/red
-
-    echo '% qnew -e -u with no username configured'
-    HGUSER= hg qnew -e -u chartreuse fucsia
-    catpatch ../.hg/patches/fucsia
-
-    echo '% fail when trying to import a merge'
-    hg init merge
-    cd merge
-    touch a
-    hg ci -Am null
-    echo a >> a
-    hg ci -m a
-    hg up -r 0
-    echo b >> a
-    hg ci -m b
-    hg merge -f 1
-    hg resolve --mark a
-    hg qnew -f merge
-
-    cd ../../..
-    rm -r mq
-}
-
-
-echo '%%% plain headers'
-
-echo "[mq]" >> $HGRCPATH
-echo "plain=true" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-
-echo '%%% hg headers'
-
-echo "plain=false" >> $HGRCPATH
-
-mkdir sandbox
-(cd sandbox ; runtest)
-rm -r sandbox
-
-
-exit 0
--- a/tests/test-mq-qnew.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-%%% plain headers
-adding a
-% qnew should refuse bad patch names
-abort: "series" cannot be used as the name of a patch
-abort: "status" cannot be used as the name of a patch
-abort: "guards" cannot be used as the name of a patch
-abort: ".hgignore" cannot be used as the name of a patch
-abort: ".mqfoo" cannot be used as the name of a patch
-abort: "foo#bar" cannot be used as the name of a patch
-abort: "foo:bar" cannot be used as the name of a patch
-% qnew with name containing slash
-foo/bar.patch
-popping foo/bar.patch
-patch queue now empty
-% qnew with uncommitted changes
-uncommitted.patch
-% qnew implies add
-A .hgignore
-A series
-A uncommitted.patch
-% qnew missing
-abort: missing: No such file or directory
-% qnew -m
-foo bar
-
-% qnew twice
-abort: patch "first.patch" already exists
-abort: patch "first.patch" already exists
-% qnew -f from a subdirectory
-popping first.patch
-popping mtest.patch
-popping uncommitted.patch
-patch queue now empty
-adding d/b
-M d/b
-diff --git a/d/b b/d/b
---- a/d/b
-+++ b/d/b
-@@ -1,1 +1,2 @@
- b
-+b
-% qnew -u with no username configured
-From: blue
-
-% qnew -e -u with no username configured
-From: chartreuse
-
-% fail when trying to import a merge
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-warning: conflicts during merge.
-merging a failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-abort: cannot manage merge changesets
-%%% hg headers
-adding a
-% qnew should refuse bad patch names
-abort: "series" cannot be used as the name of a patch
-abort: "status" cannot be used as the name of a patch
-abort: "guards" cannot be used as the name of a patch
-abort: ".hgignore" cannot be used as the name of a patch
-abort: ".mqfoo" cannot be used as the name of a patch
-abort: "foo#bar" cannot be used as the name of a patch
-abort: "foo:bar" cannot be used as the name of a patch
-% qnew with name containing slash
-foo/bar.patch
-popping foo/bar.patch
-patch queue now empty
-% qnew with uncommitted changes
-uncommitted.patch
-% qnew implies add
-A .hgignore
-A series
-A uncommitted.patch
-% qnew missing
-abort: missing: No such file or directory
-% qnew -m
-# HG changeset patch
-# Parent 
-foo bar
-
-% qnew twice
-abort: patch "first.patch" already exists
-abort: patch "first.patch" already exists
-% qnew -f from a subdirectory
-popping first.patch
-popping mtest.patch
-popping uncommitted.patch
-patch queue now empty
-adding d/b
-M d/b
-# HG changeset patch
-# Parent 
-diff --git a/d/b b/d/b
---- a/d/b
-+++ b/d/b
-@@ -1,1 +1,2 @@
- b
-+b
-% qnew -u with no username configured
-# HG changeset patch
-# Parent 
-# User blue
-% qnew -e -u with no username configured
-# HG changeset patch
-# Parent 
-# User chartreuse
-% fail when trying to import a merge
-adding a
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-merging a
-warning: conflicts during merge.
-merging a failed!
-0 files updated, 0 files merged, 0 files removed, 1 files unresolved
-use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-abort: cannot manage merge changesets
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qnew.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,223 @@
+
+  $ catpatch() {
+  >     cat $1 | sed -e "s/^\(# Parent \).*/\1/"
+  > }
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ runtest() {
+  >     hg init mq
+  >     cd mq
+  > 
+  >     echo a > a
+  >     hg ci -Ama
+  > 
+  >     echo '% qnew should refuse bad patch names'
+  >     hg qnew series
+  >     hg qnew status
+  >     hg qnew guards
+  >     hg qnew .hgignore
+  >     hg qnew .mqfoo
+  >     hg qnew 'foo#bar'
+  >     hg qnew 'foo:bar'
+  > 
+  >     hg qinit -c
+  > 
+  >     echo '% qnew with name containing slash'
+  >     hg qnew foo/bar.patch
+  >     hg qseries
+  >     hg qpop
+  >     hg qdelete foo/bar.patch
+  > 
+  >     echo '% qnew with uncommitted changes'
+  >     echo a > somefile
+  >     hg add somefile
+  >     hg qnew uncommitted.patch
+  >     hg st
+  >     hg qseries
+  > 
+  >     echo '% qnew implies add'
+  >     hg -R .hg/patches st
+  > 
+  >     echo '% qnew missing'
+  >     hg qnew missing.patch missing
+  > 
+  >     echo '% qnew -m'
+  >     hg qnew -m 'foo bar' mtest.patch
+  >     catpatch .hg/patches/mtest.patch
+  > 
+  >     echo '% qnew twice'
+  >     hg qnew first.patch
+  >     hg qnew first.patch
+  > 
+  >     touch ../first.patch
+  >     hg qimport ../first.patch
+  > 
+  >     echo '% qnew -f from a subdirectory'
+  >     hg qpop -a
+  >     mkdir d
+  >     cd d
+  >     echo b > b
+  >     hg ci -Am t
+  >     echo b >> b
+  >     hg st
+  >     hg qnew -g -f p
+  >     catpatch ../.hg/patches/p
+  > 
+  >     echo '% qnew -u with no username configured'
+  >     HGUSER= hg qnew -u blue red
+  >     catpatch ../.hg/patches/red
+  > 
+  >     echo '% qnew -e -u with no username configured'
+  >     HGUSER= hg qnew -e -u chartreuse fucsia
+  >     catpatch ../.hg/patches/fucsia
+  > 
+  >     echo '% fail when trying to import a merge'
+  >     hg init merge
+  >     cd merge
+  >     touch a
+  >     hg ci -Am null
+  >     echo a >> a
+  >     hg ci -m a
+  >     hg up -r 0
+  >     echo b >> a
+  >     hg ci -m b
+  >     hg merge -f 1
+  >     hg resolve --mark a
+  >     hg qnew -f merge
+  > 
+  >     cd ../../..
+  >     rm -r mq
+  > }
+
+plain headers
+
+  $ echo "[mq]" >> $HGRCPATH
+  $ echo "plain=true" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  adding a
+  % qnew should refuse bad patch names
+  abort: "series" cannot be used as the name of a patch
+  abort: "status" cannot be used as the name of a patch
+  abort: "guards" cannot be used as the name of a patch
+  abort: ".hgignore" cannot be used as the name of a patch
+  abort: ".mqfoo" cannot be used as the name of a patch
+  abort: "foo#bar" cannot be used as the name of a patch
+  abort: "foo:bar" cannot be used as the name of a patch
+  % qnew with name containing slash
+  foo/bar.patch
+  popping foo/bar.patch
+  patch queue now empty
+  % qnew with uncommitted changes
+  uncommitted.patch
+  % qnew implies add
+  A .hgignore
+  A series
+  A uncommitted.patch
+  % qnew missing
+  abort: missing: No such file or directory
+  % qnew -m
+  foo bar
+  
+  % qnew twice
+  abort: patch "first.patch" already exists
+  abort: patch "first.patch" already exists
+  % qnew -f from a subdirectory
+  popping first.patch
+  popping mtest.patch
+  popping uncommitted.patch
+  patch queue now empty
+  adding d/b
+  M d/b
+  diff --git a/d/b b/d/b
+  --- a/d/b
+  +++ b/d/b
+  @@ -1,1 +1,2 @@
+   b
+  +b
+  % qnew -u with no username configured
+  From: blue
+  
+  % qnew -e -u with no username configured
+  From: chartreuse
+  
+  % fail when trying to import a merge
+  adding a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  merging a
+  warning: conflicts during merge.
+  merging a failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  abort: cannot manage merge changesets
+  $ rm -r sandbox
+
+hg headers
+
+  $ echo "plain=false" >> $HGRCPATH
+  $ mkdir sandbox
+  $ (cd sandbox ; runtest)
+  adding a
+  % qnew should refuse bad patch names
+  abort: "series" cannot be used as the name of a patch
+  abort: "status" cannot be used as the name of a patch
+  abort: "guards" cannot be used as the name of a patch
+  abort: ".hgignore" cannot be used as the name of a patch
+  abort: ".mqfoo" cannot be used as the name of a patch
+  abort: "foo#bar" cannot be used as the name of a patch
+  abort: "foo:bar" cannot be used as the name of a patch
+  % qnew with name containing slash
+  foo/bar.patch
+  popping foo/bar.patch
+  patch queue now empty
+  % qnew with uncommitted changes
+  uncommitted.patch
+  % qnew implies add
+  A .hgignore
+  A series
+  A uncommitted.patch
+  % qnew missing
+  abort: missing: No such file or directory
+  % qnew -m
+  # HG changeset patch
+  # Parent 
+  foo bar
+  
+  % qnew twice
+  abort: patch "first.patch" already exists
+  abort: patch "first.patch" already exists
+  % qnew -f from a subdirectory
+  popping first.patch
+  popping mtest.patch
+  popping uncommitted.patch
+  patch queue now empty
+  adding d/b
+  M d/b
+  # HG changeset patch
+  # Parent 
+  diff --git a/d/b b/d/b
+  --- a/d/b
+  +++ b/d/b
+  @@ -1,1 +1,2 @@
+   b
+  +b
+  % qnew -u with no username configured
+  # HG changeset patch
+  # Parent 
+  # User blue
+  % qnew -e -u with no username configured
+  # HG changeset patch
+  # Parent 
+  # User chartreuse
+  % fail when trying to import a merge
+  adding a
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  merging a
+  warning: conflicts during merge.
+  merging a failed!
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
+  abort: cannot manage merge changesets
+  $ rm -r sandbox
--- a/tests/test-mq-qpush-fail	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-# Test that qpush cleans things up if it doesn't complete
-
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-hg init repo
-cd repo
-
-echo foo > foo
-hg ci -Am 'add foo'
-
-touch untracked-file
-echo 'syntax: glob' > .hgignore
-echo '.hgignore' >> .hgignore
-
-hg qinit
-
-echo '% test qpush on empty series'
-hg qpush
-
-hg qnew patch1
-echo >> foo
-hg qrefresh -m 'patch 1'
-
-hg qnew patch2
-echo bar > bar
-hg add bar
-hg qrefresh -m 'patch 2'
-
-hg qnew --config 'mq.plain=true' bad-patch
-echo >> foo
-hg qrefresh
-
-hg qpop -a
-
-python -c 'print "\xe9"' > message
-cat .hg/patches/bad-patch >> message
-mv message .hg/patches/bad-patch
-
-hg qpush -a && echo 'qpush succeded?!'
-
-hg parents
-
-echo '% bar should be gone; other unknown/ignored files should still be around'
-hg status -A
-
-echo '% preparing qpush of a missing patch'
-hg qpop -a
-hg qpush
-rm .hg/patches/patch2
-echo '% now we expect the push to fail, but it should NOT complain about patch1'
-hg qpush
-
-echo '% preparing qpush of missing patch with no patch applied'
-hg qpop -a
-rm .hg/patches/patch1
-echo '% qpush should fail the same way as below'
-hg qpush
-
-true # happy ending
--- a/tests/test-mq-qpush-fail.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-adding foo
-% test qpush on empty series
-no patches in series
-popping bad-patch
-popping patch2
-popping patch1
-patch queue now empty
-applying patch1
-applying patch2
-applying bad-patch
-transaction abort!
-rollback completed
-cleaning up working directory...done
-abort: decoding near 'é': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
-changeset:   0:bbd179dfa0a7
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-% bar should be gone; other unknown/ignored files should still be around
-? untracked-file
-I .hgignore
-C foo
-% preparing qpush of a missing patch
-no patches applied
-applying patch1
-now at: patch1
-% now we expect the push to fail, but it should NOT complain about patch1
-applying patch2
-unable to read patch2
-now at: patch1
-% preparing qpush of missing patch with no patch applied
-popping patch1
-patch queue now empty
-% qpush should fail the same way as below
-applying patch1
-unable to read patch1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qpush-fail.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,90 @@
+Test that qpush cleans things up if it doesn't complete
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ hg init repo
+  $ cd repo
+  $ echo foo > foo
+  $ hg ci -Am 'add foo'
+  adding foo
+  $ touch untracked-file
+  $ echo 'syntax: glob' > .hgignore
+  $ echo '.hgignore' >> .hgignore
+  $ hg qinit
+
+test qpush on empty series
+
+  $ hg qpush
+  no patches in series
+  $ hg qnew patch1
+  $ echo >> foo
+  $ hg qrefresh -m 'patch 1'
+  $ hg qnew patch2
+  $ echo bar > bar
+  $ hg add bar
+  $ hg qrefresh -m 'patch 2'
+  $ hg qnew --config 'mq.plain=true' bad-patch
+  $ echo >> foo
+  $ hg qrefresh
+  $ hg qpop -a
+  popping bad-patch
+  popping patch2
+  popping patch1
+  patch queue now empty
+  $ python -c 'print "\xe9"' > message
+  $ cat .hg/patches/bad-patch >> message
+  $ mv message .hg/patches/bad-patch
+  $ hg qpush -a && echo 'qpush succeded?!'
+  applying patch1
+  applying patch2
+  applying bad-patch
+  transaction abort!
+  rollback completed
+  cleaning up working directory...done
+  abort: decoding near 'é': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
+  [255]
+  $ hg parents
+  changeset:   0:bbd179dfa0a7
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+
+bar should be gone; other unknown/ignored files should still be around
+
+  $ hg status -A
+  ? untracked-file
+  I .hgignore
+  C foo
+
+preparing qpush of a missing patch
+
+  $ hg qpop -a
+  no patches applied
+  $ hg qpush
+  applying patch1
+  now at: patch1
+  $ rm .hg/patches/patch2
+
+now we expect the push to fail, but it should NOT complain about patch1
+
+  $ hg qpush
+  applying patch2
+  unable to read patch2
+  now at: patch1
+  [1]
+
+preparing qpush of missing patch with no patch applied
+
+  $ hg qpop -a
+  popping patch1
+  patch queue now empty
+  $ rm .hg/patches/patch1
+
+qpush should fail the same way as below
+
+  $ hg qpush
+  applying patch1
+  unable to read patch1
+  [1]
--- a/tests/test-mq-qrefresh-replace-log-message	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-# Environement setup for MQ
-echo "[extensions]" >> $HGRCPATH
-echo "mq=" >> $HGRCPATH
-
-#Repo init
-hg init
-hg qinit
-
-echo =======================
-echo "Should fail if no patches applied"
-hg qrefresh
-hg qrefresh -e
-
-hg qnew -m "First commit message" first-patch
-echo aaaa > file
-hg add file
-hg qrefresh
-echo =======================
-echo "Should display 'First commit message'"
-hg log -l1 -v | sed -n '/description/,$p'
-echo
-
-# Testing changing message with -m
-echo bbbb > file
-hg qrefresh -m "Second commit message"
-echo =======================
-echo "Should display 'Second commit message'"
-hg log -l1 -v | sed -n '/description/,$p'
-echo
-
-
-# Testing changing message with -l
-echo "Third commit message" > logfile
-echo " This is the 3rd log message" >> logfile
-echo bbbb > file
-hg qrefresh -l logfile
-echo =======================
-printf "Should display 'Third commit message\\\n This is the 3rd log message'\n"
-hg log -l1 -v | sed -n '/description/,$p'
-echo
-
-# Testing changing message with -l-
-hg qnew -m "First commit message" second-patch
-echo aaaa > file2
-hg add file2
-echo bbbb > file2
-(echo "Fifth commit message"
-echo " This is the 5th log message" >> logfile) |\
-hg qrefresh -l-
-echo =======================
-printf "Should display 'Fifth commit message\\\n This is the 5th log message'\n"
-hg log -l1 -v | sed -n '/description/,$p'
-echo
--- a/tests/test-mq-qrefresh-replace-log-message.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-=======================
-Should fail if no patches applied
-no patches applied
-no patches applied
-=======================
-Should display 'First commit message'
-description:
-First commit message
-
-
-
-=======================
-Should display 'Second commit message'
-description:
-Second commit message
-
-
-
-=======================
-Should display 'Third commit message\n This is the 3rd log message'
-description:
-Third commit message
- This is the 3rd log message
-
-
-
-=======================
-Should display 'Fifth commit message\n This is the 5th log message'
-description:
-Fifth commit message
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-qrefresh-replace-log-message.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,61 @@
+Environement setup for MQ
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "mq=" >> $HGRCPATH
+  $ hg init
+  $ hg qinit
+
+Should fail if no patches applied
+
+  $ hg qrefresh
+  no patches applied
+  [1]
+  $ hg qrefresh -e
+  no patches applied
+  [1]
+  $ hg qnew -m "First commit message" first-patch
+  $ echo aaaa > file
+  $ hg add file
+  $ hg qrefresh
+
+Should display 'First commit message'
+
+  $ hg log -l1 --template "{desc}\n"
+  First commit message
+
+Testing changing message with -m
+
+  $ echo bbbb > file
+  $ hg qrefresh -m "Second commit message"
+
+Should display 'Second commit message'
+
+  $ hg log -l1 --template "{desc}\n"
+  Second commit message
+
+Testing changing message with -l
+
+  $ echo "Third commit message" > logfile
+  $ echo " This is the 3rd log message" >> logfile
+  $ echo bbbb > file
+  $ hg qrefresh -l logfile
+
+Should display 'Third commit message\\\n This is the 3rd log message'
+
+  $ hg log -l1 --template "{desc}\n"
+  Third commit message
+   This is the 3rd log message
+
+Testing changing message with -l-
+
+  $ hg qnew -m "First commit message" second-patch
+  $ echo aaaa > file2
+  $ hg add file2
+  $ echo bbbb > file2
+  $ (echo "Fifth commit message"; echo " This is the 5th log message") | hg qrefresh -l-
+
+Should display 'Fifth commit message\\\n This is the 5th log message'
+
+  $ hg log -l1 --template "{desc}\n"
+  Fifth commit message
+   This is the 5th log message
--- a/tests/test-mv-cp-st-diff	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-#!/bin/sh
-
-add()
-{
-    echo $2 >> $1
-}
-
-hg init t
-cd t
-
-# set up a boring main branch
-add a a
-hg add a
-mkdir x
-add x/x x
-hg add x/x
-hg ci -m0
-
-add a m1
-hg ci -m1
-
-add a m2
-add x/y y1
-hg add x/y
-hg ci -m2
-cd ..
-
-show()
-{
-    echo "- $2: $1"
-    hg st -C $1
-    echo
-    hg diff --git $1
-    echo
-}
-
-count=0
-# make a new branch and get diff/status output
-# $1 - first commit
-# $2 - second commit
-# $3 - working dir action
-# $4 - test description
-tb()
-{
-    hg clone t t2 ; cd t2
-    hg co -q -C 0
-
-    add a $count
-    count=`expr $count + 1`
-    hg ci -m "t0"
-    $1
-    hg ci -m "t1"
-    $2
-    hg ci -m "t2"
-    $3
-
-    echo "** $4 **"
-    echo "** $1 / $2 / $3"
-    show "" "working to parent"
-    show "--rev 0" "working to root"
-    show "--rev 2" "working to branch"
-    show "--rev 0 --rev ." "root to parent"
-    show "--rev . --rev 0" "parent to root"
-    show "--rev 2 --rev ." "branch to parent"
-    show "--rev . --rev 2" "parent to branch"
-    echo
-    cd ..
-    rm -rf t2
-}
-
-
-tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
-tb "add a a1" "add a a2" "hg cp a b" "copy in working dir" 
-tb "hg mv a b" "add b b1" "add b w" "single rename"
-tb "hg cp a b" "add b b1" "add a w" "single copy"
-tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
-tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
-tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
-
-tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
-
-# Cannot implement unrelated branch with tb
-echo '% testing copies with unrelated branch'
-hg init unrelated
-cd unrelated
-add a a
-hg ci -Am adda
-hg mv a b
-hg ci -m movea
-hg up -C null
-add a a
-hg ci -Am addunrelateda
-echo '% unrelated branch diff'
-hg diff --git -r 2 -r 1
-cd ..
--- a/tests/test-mv-cp-st-diff.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1254 +0,0 @@
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** rename in working dir **
-** add a a1 / add a a2 / hg mv a b
-- working to parent: 
-A b
-  a
-R a
-
-diff --git a/a b/b
-rename from a
-rename to b
-
-- working to root: --rev 0
-A b
-  a
-R a
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,1 +1,4 @@
- a
-+0
-+a1
-+a2
-
-- working to branch: --rev 2
-A b
-  a
-R a
-R x/y
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+0
-+a1
-+a2
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,4 @@
- a
-+0
-+a1
-+a2
-
-- parent to root: --rev . --rev 0
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,4 +1,1 @@
- a
--0
--a1
--a2
-
-- branch to parent: --rev 2 --rev .
-M a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+0
-+a1
-+a2
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-M a
-A x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,4 +1,3 @@
- a
--0
--a1
--a2
-+m1
-+m2
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** copy in working dir **
-** add a a1 / add a a2 / hg cp a b
-- working to parent: 
-A b
-  a
-
-diff --git a/a b/b
-copy from a
-copy to b
-
-- working to root: --rev 0
-M a
-A b
-  a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,4 @@
- a
-+1
-+a1
-+a2
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,1 +1,4 @@
- a
-+1
-+a1
-+a2
-
-- working to branch: --rev 2
-M a
-A b
-  a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+1
-+a1
-+a2
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+1
-+a1
-+a2
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,4 @@
- a
-+1
-+a1
-+a2
-
-- parent to root: --rev . --rev 0
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,4 +1,1 @@
- a
--1
--a1
--a2
-
-- branch to parent: --rev 2 --rev .
-M a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+1
-+a1
-+a2
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-M a
-A x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,4 +1,3 @@
- a
--1
--a1
--a2
-+m1
-+m2
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** single rename **
-** hg mv a b / add b b1 / add b w
-- working to parent: 
-M b
-
-diff --git a/b b/b
---- a/b
-+++ b/b
-@@ -1,3 +1,4 @@
- a
- 2
- b1
-+w
-
-- working to root: --rev 0
-A b
-  a
-R a
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,1 +1,4 @@
- a
-+2
-+b1
-+w
-
-- working to branch: --rev 2
-A b
-  a
-R a
-R x/y
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,3 +1,4 @@
- a
--m1
--m2
-+2
-+b1
-+w
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-A b
-  a
-R a
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,1 +1,3 @@
- a
-+2
-+b1
-
-- parent to root: --rev . --rev 0
-A a
-  b
-R b
-
-diff --git a/b b/a
-rename from b
-rename to a
---- a/b
-+++ b/a
-@@ -1,3 +1,1 @@
- a
--2
--b1
-
-- branch to parent: --rev 2 --rev .
-A b
-  a
-R a
-R x/y
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+2
-+b1
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-A a
-  b
-A x/y
-R b
-
-diff --git a/b b/a
-rename from b
-rename to a
---- a/b
-+++ b/a
-@@ -1,3 +1,3 @@
- a
--2
--b1
-+m1
-+m2
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** single copy **
-** hg cp a b / add b b1 / add a w
-- working to parent: 
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,3 @@
- a
- 3
-+w
-
-- working to root: --rev 0
-M a
-A b
-  a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,3 @@
- a
-+3
-+w
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,1 +1,3 @@
- a
-+3
-+b1
-
-- working to branch: --rev 2
-M a
-A b
-  a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+3
-+w
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+3
-+b1
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-M a
-A b
-  a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+3
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,1 +1,3 @@
- a
-+3
-+b1
-
-- parent to root: --rev . --rev 0
-M a
-R b
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,1 @@
- a
--3
-diff --git a/b b/b
-deleted file mode 100644
---- a/b
-+++ /dev/null
-@@ -1,3 +0,0 @@
--a
--3
--b1
-
-- branch to parent: --rev 2 --rev .
-M a
-A b
-  a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+3
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+3
-+b1
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-M a
-A x/y
-R b
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,3 @@
- a
--3
-+m1
-+m2
-diff --git a/b b/b
-deleted file mode 100644
---- a/b
-+++ /dev/null
-@@ -1,3 +0,0 @@
--a
--3
--b1
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** rename chain **
-** hg mv a b / hg mv b c / hg mv c d
-- working to parent: 
-A d
-  c
-R c
-
-diff --git a/c b/d
-rename from c
-rename to d
-
-- working to root: --rev 0
-A d
-  a
-R a
-
-diff --git a/a b/d
-rename from a
-rename to d
---- a/a
-+++ b/d
-@@ -1,1 +1,2 @@
- a
-+4
-
-- working to branch: --rev 2
-A d
-  a
-R a
-R x/y
-
-diff --git a/a b/d
-rename from a
-rename to d
---- a/a
-+++ b/d
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+4
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-A c
-  a
-R a
-
-diff --git a/a b/c
-rename from a
-rename to c
---- a/a
-+++ b/c
-@@ -1,1 +1,2 @@
- a
-+4
-
-- parent to root: --rev . --rev 0
-A a
-  c
-R c
-
-diff --git a/c b/a
-rename from c
-rename to a
---- a/c
-+++ b/a
-@@ -1,2 +1,1 @@
- a
--4
-
-- branch to parent: --rev 2 --rev .
-A c
-  a
-R a
-R x/y
-
-diff --git a/a b/c
-rename from a
-rename to c
---- a/a
-+++ b/c
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+4
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-A a
-  c
-A x/y
-R c
-
-diff --git a/c b/a
-rename from c
-rename to a
---- a/c
-+++ b/a
-@@ -1,2 +1,3 @@
- a
--4
-+m1
-+m2
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** copy chain **
-** hg cp a b / hg cp b c / hg cp c d
-- working to parent: 
-A d
-  c
-
-diff --git a/c b/d
-copy from c
-copy to d
-
-- working to root: --rev 0
-M a
-A b
-  a
-A c
-  a
-A d
-  a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+5
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,1 +1,2 @@
- a
-+5
-diff --git a/a b/c
-copy from a
-copy to c
---- a/a
-+++ b/c
-@@ -1,1 +1,2 @@
- a
-+5
-diff --git a/a b/d
-copy from a
-copy to d
---- a/a
-+++ b/d
-@@ -1,1 +1,2 @@
- a
-+5
-
-- working to branch: --rev 2
-M a
-A b
-  a
-A c
-  a
-A d
-  a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/a b/c
-copy from a
-copy to c
---- a/a
-+++ b/c
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/a b/d
-copy from a
-copy to d
---- a/a
-+++ b/d
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-M a
-A b
-  a
-A c
-  a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+5
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,1 +1,2 @@
- a
-+5
-diff --git a/a b/c
-copy from a
-copy to c
---- a/a
-+++ b/c
-@@ -1,1 +1,2 @@
- a
-+5
-
-- parent to root: --rev . --rev 0
-M a
-R b
-R c
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,1 @@
- a
--5
-diff --git a/b b/b
-deleted file mode 100644
---- a/b
-+++ /dev/null
-@@ -1,2 +0,0 @@
--a
--5
-diff --git a/c b/c
-deleted file mode 100644
---- a/c
-+++ /dev/null
-@@ -1,2 +0,0 @@
--a
--5
-
-- branch to parent: --rev 2 --rev .
-M a
-A b
-  a
-A c
-  a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/a b/b
-copy from a
-copy to b
---- a/a
-+++ b/b
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/a b/c
-copy from a
-copy to c
---- a/a
-+++ b/c
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+5
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-M a
-A x/y
-R b
-R c
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,3 @@
- a
--5
-+m1
-+m2
-diff --git a/b b/b
-deleted file mode 100644
---- a/b
-+++ /dev/null
-@@ -1,2 +0,0 @@
--a
--5
-diff --git a/c b/c
-deleted file mode 100644
---- a/c
-+++ /dev/null
-@@ -1,2 +0,0 @@
--a
--5
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-** circular rename **
-** add a a1 / hg mv a b / hg mv b a
-- working to parent: 
-A a
-  b
-R b
-
-diff --git a/b b/a
-rename from b
-rename to a
-
-- working to root: --rev 0
-M a
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,3 @@
- a
-+6
-+a1
-
-- working to branch: --rev 2
-M a
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+6
-+a1
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- root to parent: --rev 0 --rev .
-A b
-  a
-R a
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,1 +1,3 @@
- a
-+6
-+a1
-
-- parent to root: --rev . --rev 0
-A a
-  b
-R b
-
-diff --git a/b b/a
-rename from b
-rename to a
---- a/b
-+++ b/a
-@@ -1,3 +1,1 @@
- a
--6
--a1
-
-- branch to parent: --rev 2 --rev .
-A b
-  a
-R a
-R x/y
-
-diff --git a/a b/b
-rename from a
-rename to b
---- a/a
-+++ b/b
-@@ -1,3 +1,3 @@
- a
--m1
--m2
-+6
-+a1
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-
-- parent to branch: --rev . --rev 2
-A a
-  b
-A x/y
-R b
-
-diff --git a/b b/a
-rename from b
-rename to a
---- a/b
-+++ b/a
-@@ -1,3 +1,3 @@
- a
--6
--a1
-+m1
-+m2
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-updating to branch default
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-moving x/x to y/x
-** directory move **
-** hg mv x y / add y/x x1 / add y/x x2
-- working to parent: 
-M y/x
-
-diff --git a/y/x b/y/x
---- a/y/x
-+++ b/y/x
-@@ -1,2 +1,3 @@
- x
- x1
-+x2
-
-- working to root: --rev 0
-M a
-A y/x
-  x/x
-R x/x
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+7
-diff --git a/x/x b/y/x
-rename from x/x
-rename to y/x
---- a/x/x
-+++ b/y/x
-@@ -1,1 +1,3 @@
- x
-+x1
-+x2
-
-- working to branch: --rev 2
-M a
-A y/x
-  x/x
-R x/x
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+7
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-diff --git a/x/x b/y/x
-rename from x/x
-rename to y/x
---- a/x/x
-+++ b/y/x
-@@ -1,1 +1,3 @@
- x
-+x1
-+x2
-
-- root to parent: --rev 0 --rev .
-M a
-A y/x
-  x/x
-R x/x
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,1 +1,2 @@
- a
-+7
-diff --git a/x/x b/y/x
-rename from x/x
-rename to y/x
---- a/x/x
-+++ b/y/x
-@@ -1,1 +1,2 @@
- x
-+x1
-
-- parent to root: --rev . --rev 0
-M a
-A x/x
-  y/x
-R y/x
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,1 @@
- a
--7
-diff --git a/y/x b/x/x
-rename from y/x
-rename to x/x
---- a/y/x
-+++ b/x/x
-@@ -1,2 +1,1 @@
- x
--x1
-
-- branch to parent: --rev 2 --rev .
-M a
-A y/x
-  x/x
-R x/x
-R x/y
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,3 +1,2 @@
- a
--m1
--m2
-+7
-diff --git a/x/y b/x/y
-deleted file mode 100644
---- a/x/y
-+++ /dev/null
-@@ -1,1 +0,0 @@
--y1
-diff --git a/x/x b/y/x
-rename from x/x
-rename to y/x
---- a/x/x
-+++ b/y/x
-@@ -1,1 +1,2 @@
- x
-+x1
-
-- parent to branch: --rev . --rev 2
-M a
-A x/x
-  y/x
-A x/y
-R y/x
-
-diff --git a/a b/a
---- a/a
-+++ b/a
-@@ -1,2 +1,3 @@
- a
--7
-+m1
-+m2
-diff --git a/y/x b/x/x
-rename from y/x
-rename to x/x
---- a/y/x
-+++ b/x/x
-@@ -1,2 +1,1 @@
- x
--x1
-diff --git a/x/y b/x/y
-new file mode 100644
---- /dev/null
-+++ b/x/y
-@@ -0,0 +1,1 @@
-+y1
-
-
-% testing copies with unrelated branch
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-adding a
-created new head
-% unrelated branch diff
-diff --git a/a b/a
-deleted file mode 100644
---- a/a
-+++ /dev/null
-@@ -1,1 +0,0 @@
--a
-diff --git a/b b/b
-new file mode 100644
---- /dev/null
-+++ b/b
-@@ -0,0 +1,1 @@
-+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mv-cp-st-diff.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,1344 @@
+
+  $ add()
+  > {
+  >     echo $2 >> $1
+  > }
+  $ hg init t
+  $ cd t
+
+set up a boring main branch
+
+  $ add a a
+  $ hg add a
+  $ mkdir x
+  $ add x/x x
+  $ hg add x/x
+  $ hg ci -m0
+  $ add a m1
+  $ hg ci -m1
+  $ add a m2
+  $ add x/y y1
+  $ hg add x/y
+  $ hg ci -m2
+  $ cd ..
+  $ show()
+  > {
+  >     echo "- $2: $1"
+  >     hg st -C $1
+  >     echo
+  >     hg diff --git $1
+  >     echo
+  > }
+  $ count=0
+
+make a new branch and get diff/status output
+$1 - first commit
+$2 - second commit
+$3 - working dir action
+$4 - test description
+
+  $ tb()
+  > {
+  >     hg clone t t2 ; cd t2
+  >     hg co -q -C 0
+  > 
+  >     add a $count
+  >     count=`expr $count + 1`
+  >     hg ci -m "t0"
+  >     $1
+  >     hg ci -m "t1"
+  >     $2
+  >     hg ci -m "t2"
+  >     $3
+  > 
+  >     echo "** $4 **"
+  >     echo "** $1 / $2 / $3"
+  >     show "" "working to parent"
+  >     show "--rev 0" "working to root"
+  >     show "--rev 2" "working to branch"
+  >     show "--rev 0 --rev ." "root to parent"
+  >     show "--rev . --rev 0" "parent to root"
+  >     show "--rev 2 --rev ." "branch to parent"
+  >     show "--rev . --rev 2" "parent to branch"
+  >     echo
+  >     cd ..
+  >     rm -rf t2
+  > }
+  $ tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** rename in working dir **
+  ** add a a1 / add a a2 / hg mv a b
+  - working to parent: 
+  A b
+    a
+  R a
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  
+  - working to root: --rev 0
+  A b
+    a
+  R a
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,4 @@
+   a
+  +0
+  +a1
+  +a2
+  
+  - working to branch: --rev 2
+  A b
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +0
+  +a1
+  +a2
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,4 @@
+   a
+  +0
+  +a1
+  +a2
+  
+  - parent to root: --rev . --rev 0
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,4 +1,1 @@
+   a
+  -0
+  -a1
+  -a2
+  
+  - branch to parent: --rev 2 --rev .
+  M a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +0
+  +a1
+  +a2
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  M a
+  A x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,4 +1,3 @@
+   a
+  -0
+  -a1
+  -a2
+  +m1
+  +m2
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "add a a1" "add a a2" "hg cp a b" "copy in working dir" 
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** copy in working dir **
+  ** add a a1 / add a a2 / hg cp a b
+  - working to parent: 
+  A b
+    a
+  
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  
+  - working to root: --rev 0
+  M a
+  A b
+    a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,4 @@
+   a
+  +1
+  +a1
+  +a2
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,4 @@
+   a
+  +1
+  +a1
+  +a2
+  
+  - working to branch: --rev 2
+  M a
+  A b
+    a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +1
+  +a1
+  +a2
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +1
+  +a1
+  +a2
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,4 @@
+   a
+  +1
+  +a1
+  +a2
+  
+  - parent to root: --rev . --rev 0
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,4 +1,1 @@
+   a
+  -1
+  -a1
+  -a2
+  
+  - branch to parent: --rev 2 --rev .
+  M a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +1
+  +a1
+  +a2
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  M a
+  A x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,4 +1,3 @@
+   a
+  -1
+  -a1
+  -a2
+  +m1
+  +m2
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "hg mv a b" "add b b1" "add b w" "single rename"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** single rename **
+  ** hg mv a b / add b b1 / add b w
+  - working to parent: 
+  M b
+  
+  diff --git a/b b/b
+  --- a/b
+  +++ b/b
+  @@ -1,3 +1,4 @@
+   a
+   2
+   b1
+  +w
+  
+  - working to root: --rev 0
+  A b
+    a
+  R a
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,4 @@
+   a
+  +2
+  +b1
+  +w
+  
+  - working to branch: --rev 2
+  A b
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,4 @@
+   a
+  -m1
+  -m2
+  +2
+  +b1
+  +w
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  A b
+    a
+  R a
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,3 @@
+   a
+  +2
+  +b1
+  
+  - parent to root: --rev . --rev 0
+  A a
+    b
+  R b
+  
+  diff --git a/b b/a
+  rename from b
+  rename to a
+  --- a/b
+  +++ b/a
+  @@ -1,3 +1,1 @@
+   a
+  -2
+  -b1
+  
+  - branch to parent: --rev 2 --rev .
+  A b
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +2
+  +b1
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  A a
+    b
+  A x/y
+  R b
+  
+  diff --git a/b b/a
+  rename from b
+  rename to a
+  --- a/b
+  +++ b/a
+  @@ -1,3 +1,3 @@
+   a
+  -2
+  -b1
+  +m1
+  +m2
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "hg cp a b" "add b b1" "add a w" "single copy"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** single copy **
+  ** hg cp a b / add b b1 / add a w
+  - working to parent: 
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+   3
+  +w
+  
+  - working to root: --rev 0
+  M a
+  A b
+    a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,3 @@
+   a
+  +3
+  +w
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,3 @@
+   a
+  +3
+  +b1
+  
+  - working to branch: --rev 2
+  M a
+  A b
+    a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +3
+  +w
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +3
+  +b1
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  M a
+  A b
+    a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +3
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,3 @@
+   a
+  +3
+  +b1
+  
+  - parent to root: --rev . --rev 0
+  M a
+  R b
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,1 @@
+   a
+  -3
+  diff --git a/b b/b
+  deleted file mode 100644
+  --- a/b
+  +++ /dev/null
+  @@ -1,3 +0,0 @@
+  -a
+  -3
+  -b1
+  
+  - branch to parent: --rev 2 --rev .
+  M a
+  A b
+    a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +3
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +3
+  +b1
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  M a
+  A x/y
+  R b
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+  -3
+  +m1
+  +m2
+  diff --git a/b b/b
+  deleted file mode 100644
+  --- a/b
+  +++ /dev/null
+  @@ -1,3 +0,0 @@
+  -a
+  -3
+  -b1
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** rename chain **
+  ** hg mv a b / hg mv b c / hg mv c d
+  - working to parent: 
+  A d
+    c
+  R c
+  
+  diff --git a/c b/d
+  rename from c
+  rename to d
+  
+  - working to root: --rev 0
+  A d
+    a
+  R a
+  
+  diff --git a/a b/d
+  rename from a
+  rename to d
+  --- a/a
+  +++ b/d
+  @@ -1,1 +1,2 @@
+   a
+  +4
+  
+  - working to branch: --rev 2
+  A d
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/d
+  rename from a
+  rename to d
+  --- a/a
+  +++ b/d
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +4
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  A c
+    a
+  R a
+  
+  diff --git a/a b/c
+  rename from a
+  rename to c
+  --- a/a
+  +++ b/c
+  @@ -1,1 +1,2 @@
+   a
+  +4
+  
+  - parent to root: --rev . --rev 0
+  A a
+    c
+  R c
+  
+  diff --git a/c b/a
+  rename from c
+  rename to a
+  --- a/c
+  +++ b/a
+  @@ -1,2 +1,1 @@
+   a
+  -4
+  
+  - branch to parent: --rev 2 --rev .
+  A c
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/c
+  rename from a
+  rename to c
+  --- a/a
+  +++ b/c
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +4
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  A a
+    c
+  A x/y
+  R c
+  
+  diff --git a/c b/a
+  rename from c
+  rename to a
+  --- a/c
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+  -4
+  +m1
+  +m2
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** copy chain **
+  ** hg cp a b / hg cp b c / hg cp c d
+  - working to parent: 
+  A d
+    c
+  
+  diff --git a/c b/d
+  copy from c
+  copy to d
+  
+  - working to root: --rev 0
+  M a
+  A b
+    a
+  A c
+    a
+  A d
+    a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  diff --git a/a b/c
+  copy from a
+  copy to c
+  --- a/a
+  +++ b/c
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  diff --git a/a b/d
+  copy from a
+  copy to d
+  --- a/a
+  +++ b/d
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  
+  - working to branch: --rev 2
+  M a
+  A b
+    a
+  A c
+    a
+  A d
+    a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/a b/c
+  copy from a
+  copy to c
+  --- a/a
+  +++ b/c
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/a b/d
+  copy from a
+  copy to d
+  --- a/a
+  +++ b/d
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  M a
+  A b
+    a
+  A c
+    a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  diff --git a/a b/c
+  copy from a
+  copy to c
+  --- a/a
+  +++ b/c
+  @@ -1,1 +1,2 @@
+   a
+  +5
+  
+  - parent to root: --rev . --rev 0
+  M a
+  R b
+  R c
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,1 @@
+   a
+  -5
+  diff --git a/b b/b
+  deleted file mode 100644
+  --- a/b
+  +++ /dev/null
+  @@ -1,2 +0,0 @@
+  -a
+  -5
+  diff --git a/c b/c
+  deleted file mode 100644
+  --- a/c
+  +++ /dev/null
+  @@ -1,2 +0,0 @@
+  -a
+  -5
+  
+  - branch to parent: --rev 2 --rev .
+  M a
+  A b
+    a
+  A c
+    a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/a b/b
+  copy from a
+  copy to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/a b/c
+  copy from a
+  copy to c
+  --- a/a
+  +++ b/c
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +5
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  M a
+  A x/y
+  R b
+  R c
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+  -5
+  +m1
+  +m2
+  diff --git a/b b/b
+  deleted file mode 100644
+  --- a/b
+  +++ /dev/null
+  @@ -1,2 +0,0 @@
+  -a
+  -5
+  diff --git a/c b/c
+  deleted file mode 100644
+  --- a/c
+  +++ /dev/null
+  @@ -1,2 +0,0 @@
+  -a
+  -5
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  ** circular rename **
+  ** add a a1 / hg mv a b / hg mv b a
+  - working to parent: 
+  A a
+    b
+  R b
+  
+  diff --git a/b b/a
+  rename from b
+  rename to a
+  
+  - working to root: --rev 0
+  M a
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,3 @@
+   a
+  +6
+  +a1
+  
+  - working to branch: --rev 2
+  M a
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +6
+  +a1
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - root to parent: --rev 0 --rev .
+  A b
+    a
+  R a
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,1 +1,3 @@
+   a
+  +6
+  +a1
+  
+  - parent to root: --rev . --rev 0
+  A a
+    b
+  R b
+  
+  diff --git a/b b/a
+  rename from b
+  rename to a
+  --- a/b
+  +++ b/a
+  @@ -1,3 +1,1 @@
+   a
+  -6
+  -a1
+  
+  - branch to parent: --rev 2 --rev .
+  A b
+    a
+  R a
+  R x/y
+  
+  diff --git a/a b/b
+  rename from a
+  rename to b
+  --- a/a
+  +++ b/b
+  @@ -1,3 +1,3 @@
+   a
+  -m1
+  -m2
+  +6
+  +a1
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  
+  - parent to branch: --rev . --rev 2
+  A a
+    b
+  A x/y
+  R b
+  
+  diff --git a/b b/a
+  rename from b
+  rename to a
+  --- a/b
+  +++ b/a
+  @@ -1,3 +1,3 @@
+   a
+  -6
+  -a1
+  +m1
+  +m2
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+  $ tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  created new head
+  moving x/x to y/x
+  ** directory move **
+  ** hg mv x y / add y/x x1 / add y/x x2
+  - working to parent: 
+  M y/x
+  
+  diff --git a/y/x b/y/x
+  --- a/y/x
+  +++ b/y/x
+  @@ -1,2 +1,3 @@
+   x
+   x1
+  +x2
+  
+  - working to root: --rev 0
+  M a
+  A y/x
+    x/x
+  R x/x
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +7
+  diff --git a/x/x b/y/x
+  rename from x/x
+  rename to y/x
+  --- a/x/x
+  +++ b/y/x
+  @@ -1,1 +1,3 @@
+   x
+  +x1
+  +x2
+  
+  - working to branch: --rev 2
+  M a
+  A y/x
+    x/x
+  R x/x
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +7
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  diff --git a/x/x b/y/x
+  rename from x/x
+  rename to y/x
+  --- a/x/x
+  +++ b/y/x
+  @@ -1,1 +1,3 @@
+   x
+  +x1
+  +x2
+  
+  - root to parent: --rev 0 --rev .
+  M a
+  A y/x
+    x/x
+  R x/x
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,1 +1,2 @@
+   a
+  +7
+  diff --git a/x/x b/y/x
+  rename from x/x
+  rename to y/x
+  --- a/x/x
+  +++ b/y/x
+  @@ -1,1 +1,2 @@
+   x
+  +x1
+  
+  - parent to root: --rev . --rev 0
+  M a
+  A x/x
+    y/x
+  R y/x
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,1 @@
+   a
+  -7
+  diff --git a/y/x b/x/x
+  rename from y/x
+  rename to x/x
+  --- a/y/x
+  +++ b/x/x
+  @@ -1,2 +1,1 @@
+   x
+  -x1
+  
+  - branch to parent: --rev 2 --rev .
+  M a
+  A y/x
+    x/x
+  R x/x
+  R x/y
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,3 +1,2 @@
+   a
+  -m1
+  -m2
+  +7
+  diff --git a/x/y b/x/y
+  deleted file mode 100644
+  --- a/x/y
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -y1
+  diff --git a/x/x b/y/x
+  rename from x/x
+  rename to y/x
+  --- a/x/x
+  +++ b/y/x
+  @@ -1,1 +1,2 @@
+   x
+  +x1
+  
+  - parent to branch: --rev . --rev 2
+  M a
+  A x/x
+    y/x
+  A x/y
+  R y/x
+  
+  diff --git a/a b/a
+  --- a/a
+  +++ b/a
+  @@ -1,2 +1,3 @@
+   a
+  -7
+  +m1
+  +m2
+  diff --git a/y/x b/x/x
+  rename from y/x
+  rename to x/x
+  --- a/y/x
+  +++ b/x/x
+  @@ -1,2 +1,1 @@
+   x
+  -x1
+  diff --git a/x/y b/x/y
+  new file mode 100644
+  --- /dev/null
+  +++ b/x/y
+  @@ -0,0 +1,1 @@
+  +y1
+  
+  
+
+Cannot implement unrelated branch with tb
+testing copies with unrelated branch
+
+  $ hg init unrelated
+  $ cd unrelated
+  $ add a a
+  $ hg ci -Am adda
+  adding a
+  $ hg mv a b
+  $ hg ci -m movea
+  $ hg up -C null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ add a a
+  $ hg ci -Am addunrelateda
+  adding a
+  created new head
+
+unrelated branch diff
+
+  $ hg diff --git -r 2 -r 1
+  diff --git a/a b/a
+  deleted file mode 100644
+  --- a/a
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -a
+  diff --git a/b b/b
+  new file mode 100644
+  --- /dev/null
+  +++ b/b
+  @@ -0,0 +1,1 @@
+  +a
+  $ cd ..
--- a/tests/test-newcgi	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-#!/bin/sh
-# This tests if CGI files from after d0db3462d568 but
-# before d74fc8dec2b4 still work.
-
-hg init test
-
-cat >hgweb.cgi <<HGWEB
-#!/usr/bin/env python
-#
-# An example CGI script to use hgweb, edit as necessary
-
-import cgitb
-cgitb.enable()
-
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb
-from mercurial.hgweb import wsgicgi
-from mercurial.hgweb.request import wsgiapplication
-
-def make_web_app():
-	return hgweb("test", "Empty test repository")
-
-wsgicgi.launch(wsgiapplication(make_web_app))
-HGWEB
-chmod 755 hgweb.cgi
-
-cat >hgweb.config <<HGWEBDIRCONF
-[paths]
-test = test
-HGWEBDIRCONF
-
-cat >hgwebdir.cgi <<HGWEBDIR
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-import cgitb
-cgitb.enable()
-
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgwebdir
-from mercurial.hgweb import wsgicgi
-from mercurial.hgweb.request import wsgiapplication
-
-def make_web_app():
-	return hgwebdir("hgweb.config")
-
-wsgicgi.launch(wsgiapplication(make_web_app))
-HGWEBDIR
-chmod 755 hgwebdir.cgi
-
-DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
-GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
-HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
-HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
-HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
-HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
-HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
-HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
-HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
-HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
-HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
-PATH_INFO="/"; export PATH_INFO
-PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
-QUERY_STRING=""; export QUERY_STRING
-REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
-REMOTE_PORT="44703"; export REMOTE_PORT
-REQUEST_METHOD="GET"; export REQUEST_METHOD
-REQUEST_URI="/test/"; export REQUEST_URI
-SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
-SCRIPT_NAME="/test"; export SCRIPT_NAME
-SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
-SCRIPT_URL="/test/"; export SCRIPT_URL
-SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
-SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
-SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
-SERVER_PORT="80"; export SERVER_PORT
-SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
-SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>\; export SERVER_SIGNATURE
-"
-SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
-python hgweb.cgi >page1 2>&1 ; echo $?
-python hgwebdir.cgi >page2 2>&1 ; echo $?
-PATH_INFO="/test/"
-PATH_TRANSLATED="/var/something/test.cgi"
-REQUEST_URI="/test/test/"
-SCRIPT_URI="http://hg.omnifarious.org/test/test/"
-SCRIPT_URL="/test/test/"
-python hgwebdir.cgi >page3 2>&1 ; echo $?
-fgrep -i error page1 page2 page3 && exit 1
-exit 0
--- a/tests/test-newcgi.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-0
-0
-0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-newcgi.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,93 @@
+This tests if CGI files from after d0db3462d568 but
+before d74fc8dec2b4 still work.
+
+  $ hg init test
+  $ cat >hgweb.cgi <<HGWEB
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to use hgweb, edit as necessary
+  > 
+  > import cgitb
+  > cgitb.enable()
+  > 
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgweb
+  > from mercurial.hgweb import wsgicgi
+  > from mercurial.hgweb.request import wsgiapplication
+  > 
+  > def make_web_app():
+  > 	return hgweb("test", "Empty test repository")
+  > 
+  > wsgicgi.launch(wsgiapplication(make_web_app))
+  > HGWEB
+
+  $ chmod 755 hgweb.cgi
+
+  $ cat >hgweb.config <<HGWEBDIRCONF
+  > [paths]
+  > test = test
+  > HGWEBDIRCONF
+
+  $ cat >hgwebdir.cgi <<HGWEBDIR
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to export multiple hgweb repos, edit as necessary
+  > 
+  > import cgitb
+  > cgitb.enable()
+  > 
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgwebdir
+  > from mercurial.hgweb import wsgicgi
+  > from mercurial.hgweb.request import wsgiapplication
+  > 
+  > def make_web_app():
+  > 	return hgwebdir("hgweb.config")
+  > 
+  > wsgicgi.launch(wsgiapplication(make_web_app))
+  > HGWEBDIR
+
+  $ chmod 755 hgwebdir.cgi
+
+  $ DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
+  $ GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
+  $ HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
+  $ HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
+  $ HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
+  $ HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
+  $ HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
+  $ HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
+  $ HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
+  $ HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
+  $ HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
+  $ PATH_INFO="/"; export PATH_INFO
+  $ PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
+  $ QUERY_STRING=""; export QUERY_STRING
+  $ REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
+  $ REMOTE_PORT="44703"; export REMOTE_PORT
+  $ REQUEST_METHOD="GET"; export REQUEST_METHOD
+  $ REQUEST_URI="/test/"; export REQUEST_URI
+  $ SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
+  $ SCRIPT_NAME="/test"; export SCRIPT_NAME
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
+  $ SCRIPT_URL="/test/"; export SCRIPT_URL
+  $ SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
+  $ SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
+  $ SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
+  $ SERVER_PORT="80"; export SERVER_PORT
+  $ SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
+  $ SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>"; export SERVER_SIGNATURE
+  $ SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
+
+  $ python hgweb.cgi > page1
+  $ python hgwebdir.cgi > page2
+
+  $ PATH_INFO="/test/"
+  $ PATH_TRANSLATED="/var/something/test.cgi"
+  $ REQUEST_URI="/test/test/"
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
+  $ SCRIPT_URL="/test/test/"
+  $ python hgwebdir.cgi > page3
+
+  $ grep -i error page1 page2 page3
+  [1]
--- a/tests/test-newercgi	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-#!/bin/sh
-# This is a rudimentary test of the CGI files as of d74fc8dec2b4.
-
-hg init test
-
-cat >hgweb.cgi <<HGWEB
-#!/usr/bin/env python
-#
-# An example CGI script to use hgweb, edit as necessary
-
-import cgitb
-cgitb.enable()
-
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb
-from mercurial.hgweb import wsgicgi
-
-application = hgweb("test", "Empty test repository")
-wsgicgi.launch(application)
-HGWEB
-chmod 755 hgweb.cgi
-
-cat >hgweb.config <<HGWEBDIRCONF
-[paths]
-test = test
-HGWEBDIRCONF
-
-cat >hgwebdir.cgi <<HGWEBDIR
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-import cgitb
-cgitb.enable()
-
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgwebdir
-from mercurial.hgweb import wsgicgi
-
-application = hgwebdir("hgweb.config")
-wsgicgi.launch(application)
-HGWEBDIR
-chmod 755 hgwebdir.cgi
-
-DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
-GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
-HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
-HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
-HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
-HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
-HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
-HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
-HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
-HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
-HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
-PATH_INFO="/"; export PATH_INFO
-PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
-QUERY_STRING=""; export QUERY_STRING
-REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
-REMOTE_PORT="44703"; export REMOTE_PORT
-REQUEST_METHOD="GET"; export REQUEST_METHOD
-REQUEST_URI="/test/"; export REQUEST_URI
-SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
-SCRIPT_NAME="/test"; export SCRIPT_NAME
-SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
-SCRIPT_URL="/test/"; export SCRIPT_URL
-SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
-SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
-SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
-SERVER_PORT="80"; export SERVER_PORT
-SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
-SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>\; export SERVER_SIGNATURE
-"
-SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
-python hgweb.cgi >page1 2>&1 ; echo $?
-python hgwebdir.cgi >page2 2>&1 ; echo $?
-PATH_INFO="/test/"
-PATH_TRANSLATED="/var/something/test.cgi"
-REQUEST_URI="/test/test/"
-SCRIPT_URI="http://hg.omnifarious.org/test/test/"
-SCRIPT_URL="/test/test/"
-python hgwebdir.cgi >page3 2>&1 ; echo $?
-fgrep -i error page1 page2 page3 && exit 1
-exit 0
--- a/tests/test-newercgi.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-0
-0
-0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-newercgi.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,88 @@
+This is a rudimentary test of the CGI files as of d74fc8dec2b4.
+
+  $ hg init test
+
+  $ cat >hgweb.cgi <<HGWEB
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to use hgweb, edit as necessary
+  > 
+  > import cgitb
+  > cgitb.enable()
+  > 
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgweb
+  > from mercurial.hgweb import wsgicgi
+  > 
+  > application = hgweb("test", "Empty test repository")
+  > wsgicgi.launch(application)
+  > HGWEB
+
+  $ chmod 755 hgweb.cgi
+
+  $ cat >hgweb.config <<HGWEBDIRCONF
+  > [paths]
+  > test = test
+  > HGWEBDIRCONF
+
+  $ cat >hgwebdir.cgi <<HGWEBDIR
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to export multiple hgweb repos, edit as necessary
+  > 
+  > import cgitb
+  > cgitb.enable()
+  > 
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgwebdir
+  > from mercurial.hgweb import wsgicgi
+  > 
+  > application = hgwebdir("hgweb.config")
+  > wsgicgi.launch(application)
+  > HGWEBDIR
+
+  $ chmod 755 hgwebdir.cgi
+
+  $ DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
+  $ GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
+  $ HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
+  $ HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
+  $ HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
+  $ HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
+  $ HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
+  $ HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
+  $ HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
+  $ HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
+  $ HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
+  $ PATH_INFO="/"; export PATH_INFO
+  $ PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
+  $ QUERY_STRING=""; export QUERY_STRING
+  $ REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
+  $ REMOTE_PORT="44703"; export REMOTE_PORT
+  $ REQUEST_METHOD="GET"; export REQUEST_METHOD
+  $ REQUEST_URI="/test/"; export REQUEST_URI
+  $ SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
+  $ SCRIPT_NAME="/test"; export SCRIPT_NAME
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
+  $ SCRIPT_URL="/test/"; export SCRIPT_URL
+  $ SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
+  $ SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
+  $ SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
+  $ SERVER_PORT="80"; export SERVER_PORT
+  $ SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
+  $ SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>"; export SERVER_SIGNATURE
+  $ SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
+
+  $ python hgweb.cgi > page1
+  $ python hgwebdir.cgi > page2
+
+  $ PATH_INFO="/test/"
+  $ PATH_TRANSLATED="/var/something/test.cgi"
+  $ REQUEST_URI="/test/test/"
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
+  $ SCRIPT_URL="/test/test/"
+
+  $ python hgwebdir.cgi > page3
+
+  $ grep -i error page1 page2 page3
+  [1]
--- a/tests/test-notify	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-notify=
-
-[hooks]
-incoming.notify = python:hgext.notify.hook
-
-[notify]
-sources = pull
-diffstat = False
-
-[usersubs]
-foo@bar = *
-
-[reposubs]
-* = baz
-EOF
-
-hg help notify
-hg init a
-echo a > a/a
-echo % commit
-hg --traceback --cwd a commit -Ama -d '0 0'
-
-echo % clone
-hg --traceback clone a b
-
-echo a >> a/a
-echo % commit
-hg --traceback --cwd a commit -Amb -d '1 0'
-
-# on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
-cat <<EOF >> $HGRCPATH
-[notify]
-maxsubject = 200
-EOF
-
-# the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
-# of the very long subject line
-echo '% pull (minimal config)'
-hg --traceback --cwd b pull ../a 2>&1 |
-  python -c 'import sys,re; print re.sub("([n:])\\n[\\t ]", "\\1 ", sys.stdin.read()),' |
-  sed -e 's/\(Message-Id:\).*/\1/' \
-  -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
-  -e 's/^details: .*test-notify/details: test-notify/' \
-  -e 's/^Date:.*/Date:/'
-
-cat <<EOF >> $HGRCPATH
-[notify]
-config = $HGTMP/.notify.conf
-domain = test.com
-strip = 3
-template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
-
-[web]
-baseurl = http://test/
-EOF
-
-echo % fail for config file is missing
-hg --cwd b rollback
-hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
-
-touch "$HGTMP/.notify.conf"
-
-echo % pull
-hg --cwd b rollback
-hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
-  -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
-  -e 's/^Date:.*/Date:/'
-
-cat << EOF >> $HGRCPATH
-[hooks]
-incoming.notify = python:hgext.notify.hook
-
-[notify]
-sources = pull
-diffstat = True
-EOF
-
-echo % pull
-hg --cwd b rollback
-hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
-  -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
-  -e 's/^Date:.*/Date:/'
-
-echo % test merge
-cd a
-hg up -C 0
-echo a >> a
-hg ci -Am adda2 -d '2 0'
-hg merge
-hg ci -m merge -d '3 0'
-cd ..
-
-hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
-  -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
-  -e 's/^Date:.*/Date:/'
-
--- a/tests/test-notify-changegroup	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-notify=
-
-[hooks]
-changegroup.notify = python:hgext.notify.hook
-
-[notify]
-sources = push
-diffstat = False
-maxsubject = 10
-
-[usersubs]
-foo@bar = *
-
-[reposubs]
-* = baz
-EOF
-
-hg init a
-
-echo % clone
-hg --traceback clone a b
-
-echo a > b/a
-echo % commit
-hg --traceback --cwd b commit -Ama
-
-echo a >> b/a
-echo % commit
-hg --traceback --cwd b commit -Amb
-
-echo % push
-hg --traceback --cwd b push ../a 2>&1 |
-    python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' |
-    sed -e 's/\(Message-Id:\).*/\1/' \
-        -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
-        -e 's/^Subject: .*/Subject: test-notify-changegroup/' \
-        -e 's/^details: .*test-notify/details: test-notify/' \
-        -e 's/^Date:.*/Date:/'
-
--- a/tests/test-notify-changegroup.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-% clone
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% commit
-adding a
-% commit
-% push
-pushing to ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Date:
-Subject: test-notify-changegroup
-From: test
-X-Hg-Notification: changeset cb9a9f314b8b
-Message-Id:
-To: baz, foo@bar
-
-changeset cb9a9f314b8b in test-notify-changegroup/a
-details: test-notify-changegroup/a?cmd=changeset;node=cb9a9f314b8b
-summary: a
-
-changeset ba677d0156c1 in test-notify-changegroup/a
-details: test-notify-changegroup/a?cmd=changeset;node=ba677d0156c1
-summary: b
-
-diffs (6 lines):
-
-diff -r 000000000000 -r ba677d0156c1 a
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -0,0 +1,2 @@
-+a
-+a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-notify-changegroup.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,75 @@
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > notify=
+  > 
+  > [hooks]
+  > changegroup.notify = python:hgext.notify.hook
+  > 
+  > [notify]
+  > sources = push
+  > diffstat = False
+  > maxsubject = 10
+  > 
+  > [usersubs]
+  > foo@bar = *
+  > 
+  > [reposubs]
+  > * = baz
+  > EOF
+  $ hg init a
+
+clone
+
+  $ hg --traceback clone a b
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a > b/a
+
+commit
+
+  $ hg --traceback --cwd b commit -Ama
+  adding a
+  $ echo a >> b/a
+
+commit
+
+  $ hg --traceback --cwd b commit -Amb
+
+push
+
+  $ hg --traceback --cwd b push ../a 2>&1 |
+  >     python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  pushing to ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Date: * (glob)
+  Subject: * (glob)
+  From: test
+  X-Hg-Notification: changeset cb9a9f314b8b
+  Message-Id: <*> (glob)
+  To: baz, foo@bar
+  
+  changeset cb9a9f314b8b in */a (glob)
+  details: */a?cmd=changeset;node=cb9a9f314b8b (glob)
+  summary: a
+  
+  changeset ba677d0156c1 in */a (glob)
+  details: */a?cmd=changeset;node=ba677d0156c1 (glob)
+  summary: b
+  
+  diffs (6 lines):
+  
+  diff -r 000000000000 -r ba677d0156c1 a
+  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -0,0 +1,2 @@
+  +a
+  +a
+
--- a/tests/test-notify.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-notify extension - hooks for sending email notifications at commit/push time
-
-Subscriptions can be managed through a hgrc file. Default mode is to print
-messages to stdout, for testing and configuring.
-
-To use, configure the notify extension and enable it in hgrc like this:
-
-  [extensions]
-  notify =
-
-  [hooks]
-  # one email for each incoming changeset
-  incoming.notify = python:hgext.notify.hook
-  # batch emails when many changesets incoming at one time
-  changegroup.notify = python:hgext.notify.hook
-
-  [notify]
-  # config items go here
-
-Required configuration items:
-
-  config = /path/to/file # file containing subscriptions
-
-Optional configuration items:
-
-  test = True            # print messages to stdout for testing
-  strip = 3              # number of slashes to strip for url paths
-  domain = example.com   # domain to use if committer missing domain
-  style = ...            # style file to use when formatting email
-  template = ...         # template to use when formatting email
-  incoming = ...         # template to use when run as incoming hook
-  changegroup = ...      # template when run as changegroup hook
-  maxdiff = 300          # max lines of diffs to include (0=none, -1=all)
-  maxsubject = 67        # truncate subject line longer than this
-  diffstat = True        # add a diffstat before the diff content
-  sources = serve        # notify if source of incoming changes in this list
-                         # (serve == ssh or http, push, pull, bundle)
-  merge = False          # send notification for merges (default True)
-  [email]
-  from = user@host.com   # email address to send as if none given
-  [web]
-  baseurl = http://hgserver/... # root of hg web site for browsing commits
-
-The notify config file has same format as a regular hgrc file. It has two
-sections so you can express subscriptions in whatever way is handier for you.
-
-  [usersubs]
-  # key is subscriber email, value is ","-separated list of glob patterns
-  user@host = pattern
-
-  [reposubs]
-  # key is glob pattern, value is ","-separated list of subscriber emails
-  pattern = user@host
-
-Glob patterns are matched against path to repository root.
-
-If you like, you can put notify config file in repository that users can push
-changes to, they can manage their own subscriptions.
-
-no commands defined
-% commit
-adding a
-% clone
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% commit
-% pull (minimal config)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Date:
-Subject: changeset in test-notify/b: b
-From: test
-X-Hg-Notification: changeset 0647d048b600
-Message-Id:
-To: baz, foo@bar
-
-changeset 0647d048b600 in test-notify/b
-details: test-notify/b?cmd=changeset;node=0647d048b600
-description: b
-
-diffs (6 lines):
-
-diff -r cb9a9f314b8b -r 0647d048b600 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-(run 'hg update' to get a working copy)
-% fail for config file is missing
-rolling back to revision 0 (undo pull)
-pull failed
-% pull
-rolling back to revision 0 (undo pull)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Test: foo
-Date:
-Subject: b
-From: test@test.com
-X-Hg-Notification: changeset 0647d048b600
-Message-Id:
-To: baz@test.com, foo@bar
-
-changeset 0647d048b600
-description:
-	b
-diffs (6 lines):
-
-diff -r cb9a9f314b8b -r 0647d048b600 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-(run 'hg update' to get a working copy)
-% pull
-rolling back to revision 0 (undo pull)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Test: foo
-Date:
-Subject: b
-From: test@test.com
-X-Hg-Notification: changeset 0647d048b600
-Message-Id:
-To: baz@test.com, foo@bar
-
-changeset 0647d048b600
-description:
-	b
-diffstat:
-
- a |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diffs (6 lines):
-
-diff -r cb9a9f314b8b -r 0647d048b600 a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:01 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-(run 'hg update' to get a working copy)
-% test merge
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-pulling from ../a
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 0 changes to 0 files
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Test: foo
-Date:
-Subject: adda2
-From: test@test.com
-X-Hg-Notification: changeset 0a184ce6067f
-Message-Id:
-To: baz@test.com, foo@bar
-
-changeset 0a184ce6067f
-description:
-	adda2
-diffstat:
-
- a |  1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diffs (6 lines):
-
-diff -r cb9a9f314b8b -r 0a184ce6067f a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:02 1970 +0000
-@@ -1,1 +1,2 @@
- a
-+a
-Content-Type: text/plain; charset="us-ascii"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-X-Test: foo
-Date:
-Subject: merge
-From: test@test.com
-X-Hg-Notification: changeset 22c88b85aa27
-Message-Id:
-To: baz@test.com, foo@bar
-
-changeset 22c88b85aa27
-description:
-	merge
-(run 'hg update' to get a working copy)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-notify.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,305 @@
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > notify=
+  > 
+  > [hooks]
+  > incoming.notify = python:hgext.notify.hook
+  > 
+  > [notify]
+  > sources = pull
+  > diffstat = False
+  > 
+  > [usersubs]
+  > foo@bar = *
+  > 
+  > [reposubs]
+  > * = baz
+  > EOF
+  $ hg help notify
+  notify extension - hooks for sending email notifications at commit/push time
+  
+  Subscriptions can be managed through a hgrc file. Default mode is to print
+  messages to stdout, for testing and configuring.
+  
+  To use, configure the notify extension and enable it in hgrc like this:
+  
+    [extensions]
+    notify =
+  
+    [hooks]
+    # one email for each incoming changeset
+    incoming.notify = python:hgext.notify.hook
+    # batch emails when many changesets incoming at one time
+    changegroup.notify = python:hgext.notify.hook
+  
+    [notify]
+    # config items go here
+  
+  Required configuration items:
+  
+    config = /path/to/file # file containing subscriptions
+  
+  Optional configuration items:
+  
+    test = True            # print messages to stdout for testing
+    strip = 3              # number of slashes to strip for url paths
+    domain = example.com   # domain to use if committer missing domain
+    style = ...            # style file to use when formatting email
+    template = ...         # template to use when formatting email
+    incoming = ...         # template to use when run as incoming hook
+    changegroup = ...      # template when run as changegroup hook
+    maxdiff = 300          # max lines of diffs to include (0=none, -1=all)
+    maxsubject = 67        # truncate subject line longer than this
+    diffstat = True        # add a diffstat before the diff content
+    sources = serve        # notify if source of incoming changes in this list
+                           # (serve == ssh or http, push, pull, bundle)
+    merge = False          # send notification for merges (default True)
+    [email]
+    from = user@host.com   # email address to send as if none given
+    [web]
+    baseurl = http://hgserver/... # root of hg web site for browsing commits
+  
+  The notify config file has same format as a regular hgrc file. It has two
+  sections so you can express subscriptions in whatever way is handier for you.
+  
+    [usersubs]
+    # key is subscriber email, value is ","-separated list of glob patterns
+    user@host = pattern
+  
+    [reposubs]
+    # key is glob pattern, value is ","-separated list of subscriber emails
+    pattern = user@host
+  
+  Glob patterns are matched against path to repository root.
+  
+  If you like, you can put notify config file in repository that users can push
+  changes to, they can manage their own subscriptions.
+  
+  no commands defined
+  $ hg init a
+  $ echo a > a/a
+
+commit
+
+  $ hg --cwd a commit -Ama -d '0 0'
+  adding a
+
+
+clone
+
+  $ hg --traceback clone a b
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a >> a/a
+
+commit
+
+  $ hg --traceback --cwd a commit -Amb -d '1 0'
+
+on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
+
+  $ cat <<EOF >> $HGRCPATH
+  > [notify]
+  > maxsubject = 200
+  > EOF
+
+the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
+of the very long subject line
+pull (minimal config)
+
+  $ hg --traceback --cwd b pull ../a | \
+  >   python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  Date: * (glob)
+  Subject: changeset in */b: b (glob)
+  From: test
+  X-Hg-Notification: changeset 0647d048b600
+  Message-Id: <*> (glob)
+  To: baz, foo@bar
+  
+  changeset 0647d048b600 in */b (glob)
+  details: *?cmd=changeset;node=0647d048b600 (glob)
+  description: b
+  
+  diffs (6 lines):
+  
+  diff -r cb9a9f314b8b -r 0647d048b600 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  (run 'hg update' to get a working copy)
+  $ cat <<EOF >> $HGRCPATH
+  > [notify]
+  > config = $HGTMP/.notify.conf
+  > domain = test.com
+  > strip = 3
+  > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
+  > 
+  > [web]
+  > baseurl = http://test/
+  > EOF
+
+fail for config file is missing
+
+  $ hg --cwd b rollback
+  rolling back to revision 0 (undo pull)
+  $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
+  pull failed
+  $ touch "$HGTMP/.notify.conf"
+
+pull
+
+  $ hg --cwd b rollback
+  rolling back to revision 0 (undo pull)
+  $ hg --traceback --cwd b pull ../a  | \
+  >   python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  X-Test: foo
+  Date: * (glob)
+  Subject: b
+  From: test@test.com
+  X-Hg-Notification: changeset 0647d048b600
+  Message-Id: <*> (glob)
+  To: baz@test.com, foo@bar
+  
+  changeset 0647d048b600 in */b (glob)
+  description: b
+  diffs (6 lines):
+  
+  diff -r cb9a9f314b8b -r 0647d048b600 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  (run 'hg update' to get a working copy)
+
+  $ cat << EOF >> $HGRCPATH
+  > [hooks]
+  > incoming.notify = python:hgext.notify.hook
+  > 
+  > [notify]
+  > sources = pull
+  > diffstat = True
+  > EOF
+
+pull
+
+  $ hg --cwd b rollback
+  rolling back to revision 0 (undo pull)
+  $ hg --traceback --cwd b pull ../a | \
+  >   python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  X-Test: foo
+  Date: * (glob)
+  Subject: b
+  From: test@test.com
+  X-Hg-Notification: changeset 0647d048b600
+  Message-Id: <*> (glob)
+  To: baz@test.com, foo@bar
+  
+  changeset 0647d048b600 in */b (glob)
+  description: b
+  diffstat:
+  
+   a |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  diffs (6 lines):
+  
+  diff -r cb9a9f314b8b -r 0647d048b600 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:01 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  (run 'hg update' to get a working copy)
+
+test merge
+
+  $ cd a
+  $ hg up -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo a >> a
+  $ hg ci -Am adda2 -d '2 0'
+  created new head
+  $ hg merge
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m merge -d '3 0'
+  $ cd ..
+  $ hg --traceback --cwd b pull ../a | \
+  >   python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
+  pulling from ../a
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 0 files
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  X-Test: foo
+  Date: * (glob)
+  Subject: adda2
+  From: test@test.com
+  X-Hg-Notification: changeset 0a184ce6067f
+  Message-Id: <*> (glob)
+  To: baz@test.com, foo@bar
+  
+  changeset 0a184ce6067f in */b (glob)
+  description: adda2
+  diffstat:
+  
+   a |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  diffs (6 lines):
+  
+  diff -r cb9a9f314b8b -r 0a184ce6067f a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:02 1970 +0000
+  @@ -1,1 +1,2 @@
+   a
+  +a
+  Content-Type: text/plain; charset="us-ascii"
+  MIME-Version: 1.0
+  Content-Transfer-Encoding: 7bit
+  X-Test: foo
+  Date: * (glob)
+  Subject: merge
+  From: test@test.com
+  X-Hg-Notification: changeset 22c88b85aa27
+  Message-Id: <*> (glob)
+  To: baz@test.com, foo@bar
+  
+  changeset 22c88b85aa27 in */b (glob)
+  description: merge
+  (run 'hg update' to get a working copy)
--- a/tests/test-oldcgi	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-#!/bin/sh
-# This tests if CGI files from before d0db3462d568 still work.
-
-hg init test
-
-cat >hgweb.cgi <<HGWEB
-#!/usr/bin/env python
-#
-# An example CGI script to use hgweb, edit as necessary
-
-import cgitb, os, sys
-cgitb.enable()
-
-# sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
-from mercurial import hgweb
-
-h = hgweb.hgweb("test", "Empty test repository")
-h.run()
-HGWEB
-chmod 755 hgweb.cgi
-
-cat >hgweb.config <<HGWEBDIRCONF
-[paths]
-test = test
-HGWEBDIRCONF
-
-cat >hgwebdir.cgi <<HGWEBDIR
-#!/usr/bin/env python
-#
-# An example CGI script to export multiple hgweb repos, edit as necessary
-
-import cgitb, sys
-cgitb.enable()
-
-# sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
-from mercurial import hgweb
-
-# The config file looks like this.  You can have paths to individual
-# repos, collections of repos in a directory tree, or both.
-#
-# [paths]
-# virtual/path = /real/path
-# virtual/path = /real/path
-#
-# [collections]
-# /prefix/to/strip/off = /root/of/tree/full/of/repos
-#
-# collections example: say directory tree /foo contains repos /foo/bar,
-# /foo/quux/baz.  Give this config section:
-#   [collections]
-#   /foo = /foo
-# Then repos will list as bar and quux/baz.
-
-# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
-# or use a dictionary with entries like 'virtual/path': '/real/path'
-
-h = hgweb.hgwebdir("hgweb.config")
-h.run()
-HGWEBDIR
-chmod 755 hgwebdir.cgi
-
-DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
-GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
-HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
-HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
-HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
-HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
-HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
-HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
-HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
-HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
-HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
-PATH_INFO="/"; export PATH_INFO
-PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
-QUERY_STRING=""; export QUERY_STRING
-REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
-REMOTE_PORT="44703"; export REMOTE_PORT
-REQUEST_METHOD="GET"; export REQUEST_METHOD
-REQUEST_URI="/test/"; export REQUEST_URI
-SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
-SCRIPT_NAME="/test"; export SCRIPT_NAME
-SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
-SCRIPT_URL="/test/"; export SCRIPT_URL
-SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
-SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
-SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
-SERVER_PORT="80"; export SERVER_PORT
-SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
-SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>\; export SERVER_SIGNATURE
-"
-SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
-python hgweb.cgi >page1 2>&1 ; echo $?
-python hgwebdir.cgi >page2 2>&1 ; echo $?
-PATH_INFO="/test/"
-PATH_TRANSLATED="/var/something/test.cgi"
-REQUEST_URI="/test/test/"
-SCRIPT_URI="http://hg.omnifarious.org/test/test/"
-SCRIPT_URL="/test/test/"
-python hgwebdir.cgi >page3 2>&1 ; echo $?
-fgrep -i error page1 page2 page3 && exit 1
-exit 0
--- a/tests/test-oldcgi.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-0
-0
-0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-oldcgi.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,103 @@
+This tests if CGI files from before d0db3462d568 still work.
+
+  $ hg init test
+  $ cat >hgweb.cgi <<HGWEB
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to use hgweb, edit as necessary
+  > 
+  > import cgitb, os, sys
+  > cgitb.enable()
+  > 
+  > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
+  > from mercurial import hgweb
+  > 
+  > h = hgweb.hgweb("test", "Empty test repository")
+  > h.run()
+  > HGWEB
+
+  $ chmod 755 hgweb.cgi
+
+  $ cat >hgweb.config <<HGWEBDIRCONF
+  > [paths]
+  > test = test
+  > HGWEBDIRCONF
+
+  $ cat >hgwebdir.cgi <<HGWEBDIR
+  > #!/usr/bin/env python
+  > #
+  > # An example CGI script to export multiple hgweb repos, edit as necessary
+  > 
+  > import cgitb, sys
+  > cgitb.enable()
+  > 
+  > # sys.path.insert(0, "/path/to/python/lib") # if not a system-wide install
+  > from mercurial import hgweb
+  > 
+  > # The config file looks like this.  You can have paths to individual
+  > # repos, collections of repos in a directory tree, or both.
+  > #
+  > # [paths]
+  > # virtual/path = /real/path
+  > # virtual/path = /real/path
+  > #
+  > # [collections]
+  > # /prefix/to/strip/off = /root/of/tree/full/of/repos
+  > #
+  > # collections example: say directory tree /foo contains repos /foo/bar,
+  > # /foo/quux/baz.  Give this config section:
+  > #   [collections]
+  > #   /foo = /foo
+  > # Then repos will list as bar and quux/baz.
+  > 
+  > # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
+  > # or use a dictionary with entries like 'virtual/path': '/real/path'
+  > 
+  > h = hgweb.hgwebdir("hgweb.config")
+  > h.run()
+  > HGWEBDIR
+
+  $ chmod 755 hgwebdir.cgi
+
+  $ DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT
+  $ GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE
+  $ HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT
+  $ HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET
+  $ HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING
+  $ HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE
+  $ HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL
+  $ HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION
+  $ HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST
+  $ HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE
+  $ HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT
+  $ PATH_INFO="/"; export PATH_INFO
+  $ PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED
+  $ QUERY_STRING=""; export QUERY_STRING
+  $ REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR
+  $ REMOTE_PORT="44703"; export REMOTE_PORT
+  $ REQUEST_METHOD="GET"; export REQUEST_METHOD
+  $ REQUEST_URI="/test/"; export REQUEST_URI
+  $ SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME
+  $ SCRIPT_NAME="/test"; export SCRIPT_NAME
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI
+  $ SCRIPT_URL="/test/"; export SCRIPT_URL
+  $ SERVER_ADDR="127.0.0.1"; export SERVER_ADDR
+  $ SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN
+  $ SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME
+  $ SERVER_PORT="80"; export SERVER_PORT
+  $ SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL
+  $ SERVER_SIGNATURE="<address>Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80</address>"; export SERVER_SIGNATURE
+  $ SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE
+
+  $ python hgweb.cgi > page1
+  $ python hgwebdir.cgi > page2
+
+  $ PATH_INFO="/test/"
+  $ PATH_TRANSLATED="/var/something/test.cgi"
+  $ REQUEST_URI="/test/test/"
+  $ SCRIPT_URI="http://hg.omnifarious.org/test/test/"
+  $ SCRIPT_URL="/test/test/"
+  $ python hgwebdir.cgi > page3
+
+  $ grep -i error page1 page2 page3
+  [1]
--- a/tests/test-parentrevspec	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-commit()
-{
-    msg=$1
-    p1=$2
-    p2=$3
-
-    if [ "$p1" ]; then
-	hg up -qC $p1
-    fi
-
-    if [ "$p2" ]; then
-	HGMERGE=true hg merge -q $p2
-    fi
-
-    echo >> foo
-
-    hg commit -qAm "$msg"
-}
-
-hg init repo
-cd repo
-
-echo '[extensions]' > .hg/hgrc
-echo 'parentrevspec =' >> .hg/hgrc
-
-commit '0: add foo'
-commit '1: change foo 1'
-commit '2: change foo 2a'
-commit '3: change foo 3a'
-commit '4: change foo 2b' 1
-commit '5: merge' 3 4
-commit '6: change foo again'
-
-hg log --template '{rev}:{node|short} {parents}\n'
-echo
-
-lookup()
-{
-    for rev in "$@"; do
-	printf "$rev: "
-	hg id -nr $rev
-    done
-    true
-}
-
-tipnode=`hg id -ir tip`
-
-echo 'should work with tag/branch/node/rev'
-for r in tip default $tipnode 6; do
-    lookup "$r^"
-done
-echo
-
-echo 'some random lookups'
-lookup "6^^" "6^^^" "6^^^^" "6^^^^^" "6^^^^^^" "6^1" "6^2" "6^^2" "6^1^2" "6^^3"
-lookup "6~" "6~1" "6~2" "6~3" "6~4" "6~5" "6~42" "6~1^2" "6~1^2~2"
-echo
-
-echo 'with a tag "6^" pointing to rev 1'
-hg tag -l -r 1 "6^"
-lookup "6^" "6^1" "6~1" "6^^"
-echo
-
-echo 'with a tag "foo^bar" pointing to rev 2'
-hg tag -l -r 2 "foo^bar"
-lookup "foo^bar" "foo^bar^"
-
--- a/tests/test-parentrevspec.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-6:755d1e0d79e9 
-5:9ce2ce29723a 3:a3e00c7dbf11 4:bb4475edb621 
-4:bb4475edb621 1:5d953a1917d1 
-3:a3e00c7dbf11 
-2:befc7d89d081 
-1:5d953a1917d1 
-0:837088b6e1d9 
-
-should work with tag/branch/node/rev
-tip^: 5
-default^: 5
-755d1e0d79e9^: 5
-6^: 5
-
-some random lookups
-6^^: 3
-6^^^: 2
-6^^^^: 1
-6^^^^^: 0
-6^^^^^^: -1
-6^1: 5
-6^2: abort: unknown revision '6^2'!
-6^^2: 4
-6^1^2: 4
-6^^3: abort: unknown revision '6^^3'!
-6~: abort: unknown revision '6~'!
-6~1: 5
-6~2: 3
-6~3: 2
-6~4: 1
-6~5: 0
-6~42: -1
-6~1^2: 4
-6~1^2~2: 0
-
-with a tag "6^" pointing to rev 1
-6^: 1
-6^1: 5
-6~1: 5
-6^^: 3
-
-with a tag "foo^bar" pointing to rev 2
-foo^bar: 2
-foo^bar^: abort: unknown revision 'foo^bar^'!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-parentrevspec.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,105 @@
+
+  $ commit()
+  > {
+  >     msg=$1
+  >     p1=$2
+  >     p2=$3
+  > 
+  >     if [ "$p1" ]; then
+  > 	hg up -qC $p1
+  >     fi
+  > 
+  >     if [ "$p2" ]; then
+  > 	HGMERGE=true hg merge -q $p2
+  >     fi
+  > 
+  >     echo >> foo
+  > 
+  >     hg commit -qAm "$msg"
+  > }
+  $ hg init repo
+  $ cd repo
+  $ echo '[extensions]' > .hg/hgrc
+  $ echo 'parentrevspec =' >> .hg/hgrc
+  $ commit '0: add foo'
+  $ commit '1: change foo 1'
+  $ commit '2: change foo 2a'
+  $ commit '3: change foo 3a'
+  $ commit '4: change foo 2b' 1
+  $ commit '5: merge' 3 4
+  $ commit '6: change foo again'
+  $ hg log --template '{rev}:{node|short} {parents}\n'
+  6:755d1e0d79e9 
+  5:9ce2ce29723a 3:a3e00c7dbf11 4:bb4475edb621 
+  4:bb4475edb621 1:5d953a1917d1 
+  3:a3e00c7dbf11 
+  2:befc7d89d081 
+  1:5d953a1917d1 
+  0:837088b6e1d9 
+  $ echo
+  
+  $ lookup()
+  > {
+  >     for rev in "$@"; do
+  > 	printf "$rev: "
+  > 	hg id -nr $rev
+  >     done
+  >     true
+  > }
+  $ tipnode=`hg id -ir tip`
+
+should work with tag/branch/node/rev
+
+  $ for r in tip default $tipnode 6; do
+  >     lookup "$r^"
+  > done
+  tip^: 5
+  default^: 5
+  755d1e0d79e9^: 5
+  6^: 5
+  $ echo
+  
+
+some random lookups
+
+  $ lookup "6^^" "6^^^" "6^^^^" "6^^^^^" "6^^^^^^" "6^1" "6^2" "6^^2" "6^1^2" "6^^3"
+  6^^: 3
+  6^^^: 2
+  6^^^^: 1
+  6^^^^^: 0
+  6^^^^^^: -1
+  6^1: 5
+  6^2: abort: unknown revision '6^2'!
+  6^^2: 4
+  6^1^2: 4
+  6^^3: abort: unknown revision '6^^3'!
+  $ lookup "6~" "6~1" "6~2" "6~3" "6~4" "6~5" "6~42" "6~1^2" "6~1^2~2"
+  6~: abort: unknown revision '6~'!
+  6~1: 5
+  6~2: 3
+  6~3: 2
+  6~4: 1
+  6~5: 0
+  6~42: -1
+  6~1^2: 4
+  6~1^2~2: 0
+  $ echo
+  
+
+with a tag "6^" pointing to rev 1
+
+  $ hg tag -l -r 1 "6^"
+  $ lookup "6^" "6^1" "6~1" "6^^"
+  6^: 1
+  6^1: 5
+  6~1: 5
+  6^^: 3
+  $ echo
+  
+
+with a tag "foo^bar" pointing to rev 2
+
+  $ hg tag -l -r 2 "foo^bar"
+  $ lookup "foo^bar" "foo^bar^"
+  foo^bar: 2
+  foo^bar^: abort: unknown revision 'foo^bar^'!
--- a/tests/test-parseindex	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#!/bin/sh
-#
-# revlog.parseindex must be able to parse the index file even if
-# an index entry is split between two 64k blocks.  The ideal test
-# would be to create an index file with inline data where
-# 64k < size < 64k + 64 (64k is the size of the read buffer, 64 is
-# the size of an index entry) and with an index entry starting right
-# before the 64k block boundary, and try to read it.
-#
-# We approximate that by reducing the read buffer to 1 byte.
-#
-
-hg init a
-cd a
-echo abc > foo
-hg add foo
-hg commit -m 'add foo'
-
-echo >> foo
-hg commit -m 'change foo'
-hg log -r 0:
-
-cat >> test.py << EOF
-from mercurial import changelog, util
-from mercurial.node import *
-
-class singlebyteread(object):
-    def __init__(self, real):
-        self.real = real
-
-    def read(self, size=-1):
-        if size == 65536:
-            size = 1
-        return self.real.read(size)
-
-    def __getattr__(self, key):
-        return getattr(self.real, key)
-
-def opener(*args):
-    o = util.opener(*args)
-    def wrapper(*a):
-        f = o(*a)
-        return singlebyteread(f)
-    return wrapper
-
-cl = changelog.changelog(opener('.hg/store'))
-print len(cl), 'revisions:'
-for r in cl:
-    print short(cl.node(r))
-EOF
-
-python test.py
--- a/tests/test-parseindex.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-changeset:   0:7c31755bf9b5
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add foo
-
-changeset:   1:26333235a41c
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change foo
-
-2 revisions:
-7c31755bf9b5
-26333235a41c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-parseindex.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,59 @@
+revlog.parseindex must be able to parse the index file even if
+an index entry is split between two 64k blocks.  The ideal test
+would be to create an index file with inline data where
+64k < size < 64k + 64 (64k is the size of the read buffer, 64 is
+the size of an index entry) and with an index entry starting right
+before the 64k block boundary, and try to read it.
+We approximate that by reducing the read buffer to 1 byte.
+
+  $ hg init a
+  $ cd a
+  $ echo abc > foo
+  $ hg add foo
+  $ hg commit -m 'add foo'
+  $ echo >> foo
+  $ hg commit -m 'change foo'
+  $ hg log -r 0:
+  changeset:   0:7c31755bf9b5
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add foo
+  
+  changeset:   1:26333235a41c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change foo
+  
+  $ cat >> test.py << EOF
+  > from mercurial import changelog, util
+  > from mercurial.node import *
+  > 
+  > class singlebyteread(object):
+  >     def __init__(self, real):
+  >         self.real = real
+  > 
+  >     def read(self, size=-1):
+  >         if size == 65536:
+  >             size = 1
+  >         return self.real.read(size)
+  > 
+  >     def __getattr__(self, key):
+  >         return getattr(self.real, key)
+  > 
+  > def opener(*args):
+  >     o = util.opener(*args)
+  >     def wrapper(*a):
+  >         f = o(*a)
+  >         return singlebyteread(f)
+  >     return wrapper
+  > 
+  > cl = changelog.changelog(opener('.hg/store'))
+  > print len(cl), 'revisions:'
+  > for r in cl:
+  >     print short(cl.node(r))
+  > EOF
+  $ python test.py
+  2 revisions:
+  7c31755bf9b5
+  26333235a41c
--- a/tests/test-patch-offset	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-cat > writepatterns.py <<EOF
-import sys
-
-path = sys.argv[1]
-patterns = sys.argv[2:]
-
-fp = file(path, 'wb')
-for pattern in patterns:
-    count = int(pattern[0:-1])
-    char = pattern[-1] + '\n'
-    fp.write(char*count)
-fp.close()
-EOF
-
-echo % prepare repo
-hg init a
-cd a
-
-# These initial lines of Xs were not in the original file used to generate
-# the patch.  So all the patch hunks need to be applied to a constant offset
-# within this file.  If the offset isn't tracked then the hunks can be
-# applied to the wrong lines of this file.
-python ../writepatterns.py a 34X 10A 1B 10A 1C 10A 1B 10A 1D 10A 1B 10A 1E 10A 1B 10A
-hg commit -Am adda
-
-# This is a cleaner patch generated via diff
-# In this case it reproduces the problem when
-# the output of hg export does not
-echo % import patch
-hg import -v -m 'b' -d '2 0' - <<EOF
---- a/a	2009-12-08 19:26:17.000000000 -0800
-+++ b/a	2009-12-08 19:26:17.000000000 -0800
-@@ -9,7 +9,7 @@
- A
- A
- B
--A
-+a
- A
- A
- A
-@@ -53,7 +53,7 @@
- A
- A
- B
--A
-+a
- A
- A
- A
-@@ -75,7 +75,7 @@
- A
- A
- B
--A
-+a
- A
- A
- A
-EOF
-
-echo % compare imported changes against reference file
-python ../writepatterns.py aref 34X 10A 1B 1a 9A 1C 10A 1B 10A 1D 10A 1B 1a 9A 1E 10A 1B 1a 9A
-diff aref a
-
--- a/tests/test-patch-offset.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-% prepare repo
-adding a
-% import patch
-applying patch from stdin
-patching file a
-Hunk #1 succeeded at 43 (offset 34 lines).
-Hunk #2 succeeded at 87 (offset 34 lines).
-Hunk #3 succeeded at 109 (offset 34 lines).
-a
-% compare imported changes against reference file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-patch-offset.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,76 @@
+
+  $ cat > writepatterns.py <<EOF
+  > import sys
+  > 
+  > path = sys.argv[1]
+  > patterns = sys.argv[2:]
+  > 
+  > fp = file(path, 'wb')
+  > for pattern in patterns:
+  >     count = int(pattern[0:-1])
+  >     char = pattern[-1] + '\n'
+  >     fp.write(char*count)
+  > fp.close()
+  > EOF
+
+prepare repo
+
+  $ hg init a
+  $ cd a
+
+These initial lines of Xs were not in the original file used to generate
+the patch.  So all the patch hunks need to be applied to a constant offset
+within this file.  If the offset isn't tracked then the hunks can be
+applied to the wrong lines of this file.
+
+  $ python ../writepatterns.py a 34X 10A 1B 10A 1C 10A 1B 10A 1D 10A 1B 10A 1E 10A 1B 10A
+  $ hg commit -Am adda
+  adding a
+
+This is a cleaner patch generated via diff
+In this case it reproduces the problem when
+the output of hg export does not
+import patch
+
+  $ hg import -v -m 'b' -d '2 0' - <<EOF
+  > --- a/a	2009-12-08 19:26:17.000000000 -0800
+  > +++ b/a	2009-12-08 19:26:17.000000000 -0800
+  > @@ -9,7 +9,7 @@
+  >  A
+  >  A
+  >  B
+  > -A
+  > +a
+  >  A
+  >  A
+  >  A
+  > @@ -53,7 +53,7 @@
+  >  A
+  >  A
+  >  B
+  > -A
+  > +a
+  >  A
+  >  A
+  >  A
+  > @@ -75,7 +75,7 @@
+  >  A
+  >  A
+  >  B
+  > -A
+  > +a
+  >  A
+  >  A
+  >  A
+  > EOF
+  applying patch from stdin
+  patching file a
+  Hunk #1 succeeded at 43 (offset 34 lines).
+  Hunk #2 succeeded at 87 (offset 34 lines).
+  Hunk #3 succeeded at 109 (offset 34 lines).
+  a
+
+compare imported changes against reference file
+
+  $ python ../writepatterns.py aref 34X 10A 1B 1a 9A 1C 10A 1B 10A 1D 10A 1B 1a 9A 1E 10A 1B 1a 9A
+  $ diff aref a
--- a/tests/test-profile	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-echo % test --time
-hg --time help -q help 2>&1 | grep Time > /dev/null || echo --time failed
-
-hg init a
-cd a
-
-echo % test --profile
-if "$TESTDIR/hghave" -q lsprof; then
-    hg --profile st 2>../out || echo --profile failed
-    grep CallCount < ../out > /dev/null || echo wrong --profile
-
-    hg --profile --config profiling.output=../out st 2>&1 \
-        || echo --profile + output to file failed
-    grep CallCount < ../out > /dev/null \
-        || echo wrong --profile output when saving to a file
-
-    hg --profile --config profiling.format=text st 2>&1 \
-        | grep CallCount > /dev/null || echo --profile format=text failed
-
-    echo "[profiling]" >> $HGRCPATH
-    echo "format=kcachegrind" >> $HGRCPATH
-
-    hg --profile st 2>../out || echo --profile format=kcachegrind failed
-    grep 'events: Ticks' < ../out > /dev/null || echo --profile output is wrong
-
-    hg --profile --config profiling.output=../out st 2>&1 \
-        || echo --profile format=kcachegrind + output to file failed
-    grep 'events: Ticks' < ../out > /dev/null \
-        || echo --profile output is wrong
-fi
--- a/tests/test-profile.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-% test --time
-% test --profile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-profile.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,31 @@
+test --time
+
+  $ hg --time help -q help 2>&1 | grep Time > /dev/null
+  $ hg init a
+  $ cd a
+
+test --profile
+
+  $ if "$TESTDIR/hghave" -q lsprof; then
+  >     hg --profile st 2>../out || echo --profile failed
+  >     grep CallCount < ../out > /dev/null || echo wrong --profile
+  > 
+  >     hg --profile --config profiling.output=../out st 2>&1 \
+  >         || echo --profile + output to file failed
+  >     grep CallCount < ../out > /dev/null \
+  >         || echo wrong --profile output when saving to a file
+  > 
+  >     hg --profile --config profiling.format=text st 2>&1 \
+  >         | grep CallCount > /dev/null || echo --profile format=text failed
+  > 
+  >     echo "[profiling]" >> $HGRCPATH
+  >     echo "format=kcachegrind" >> $HGRCPATH
+  > 
+  >     hg --profile st 2>../out || echo --profile format=kcachegrind failed
+  >     grep 'events: Ticks' < ../out > /dev/null || echo --profile output is wrong
+  > 
+  >     hg --profile --config profiling.output=../out st 2>&1 \
+  >         || echo --profile format=kcachegrind + output to file failed
+  >     grep 'events: Ticks' < ../out > /dev/null \
+  >         || echo --profile output is wrong
+  > fi
--- a/tests/test-progress	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-cat > loop.py <<EOF
-from mercurial import commands
-
-def loop(ui, loops, **opts):
-    loops = int(loops)
-    total = None
-    if loops >= 0:
-        total = loops
-    if opts.get('total', None):
-        total = int(opts.get('total'))
-    loops = abs(loops)
-
-    for i in range(loops):
-        ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
-    ui.progress('loop', None, 'loop.done', 'loopnum', total)
-
-commands.norepo += " loop"
-
-cmdtable = {
-    "loop": (loop, [('', 'total', '', 'override for total')],
-             'hg loop LOOPS'),
-}
-EOF
-
-cat > filtercr.py <<EOF
-import sys, re
-for line in sys.stdin:
-    line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
-    sys.stdout.write(line)
-EOF
-
-echo "[extensions]" >> $HGRCPATH
-echo "progress=" >> $HGRCPATH
-echo "loop=`pwd`/loop.py" >> $HGRCPATH
-echo "[progress]" >> $HGRCPATH
-echo "assume-tty=1" >> $HGRCPATH
-
-echo '% test default params, display nothing because of delay'
-hg -y loop 3 2>&1 | python filtercr.py
-
-echo "delay=0" >> $HGRCPATH
-echo "refresh=0" >> $HGRCPATH
-
-echo '% test with delay=0, refresh=0'
-hg -y loop 3 2>&1 | python filtercr.py
-
-echo '% test refresh is taken in account'
-hg -y --config progress.refresh=100 loop 3 2>&1 | python filtercr.py
-
-echo '% test format options 1'
-hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 | python filtercr.py
-
-echo '% test format options 2'
-hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 | python filtercr.py
-
-echo '% test format options and indeterminate progress'
-hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 | python filtercr.py
-
-echo "% make sure things don't fall over if count > total"
-hg -y loop --total 4 6 2>&1 | python filtercr.py
-
-echo '% test immediate progress completion'
-hg -y loop 0 2>&1 | python filtercr.py
--- a/tests/test-progress.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-% test default params, display nothing because of delay
-% test with delay=0, refresh=0
-
-loop [                                                                    ] 0/3
-loop [=====================>                                              ] 1/3
-loop [============================================>                       ] 2/3
-                                                                                
% test refresh is taken in account
-% test format options 1
-
-0/2 loop lo
-1/2 loop lo
-                                                                                
% test format options 2
-
-0/2 p.0 [                                                                     ]
-1/2 p.1 [=================================>                                   ]
-                                                                                
% test format options and indeterminate progress
-
-0 loop.0               [ <=>                                                  ]
-1 loop.1               [  <=>                                                 ]
-                                                                                
% make sure things don't fall over if count > total
-
-loop [                                                                    ] 0/4
-loop [================>                                                   ] 1/4
-loop [=================================>                                  ] 2/4
-loop [==================================================>                 ] 3/4
-loop [===================================================================>] 4/4
-loop [ <=>                                                                ] 5/4
-                                                                                
% test immediate progress completion
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-progress.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,100 @@
+
+  $ cat > loop.py <<EOF
+  > from mercurial import commands
+  > 
+  > def loop(ui, loops, **opts):
+  >     loops = int(loops)
+  >     total = None
+  >     if loops >= 0:
+  >         total = loops
+  >     if opts.get('total', None):
+  >         total = int(opts.get('total'))
+  >     loops = abs(loops)
+  > 
+  >     for i in range(loops):
+  >         ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
+  >     ui.progress('loop', None, 'loop.done', 'loopnum', total)
+  > 
+  > commands.norepo += " loop"
+  > 
+  > cmdtable = {
+  >     "loop": (loop, [('', 'total', '', 'override for total')],
+  >              'hg loop LOOPS'),
+  > }
+  > EOF
+
+  $ cat > filtercr.py <<EOF
+  > import sys, re
+  > for line in sys.stdin:
+  >     line = re.sub(r'\r+[^\n]', lambda m: '\n' + m.group()[-1:], line)
+  >     sys.stdout.write(line)
+  > print
+  > EOF
+
+  $ echo "[extensions]" >> $HGRCPATH
+  $ echo "progress=" >> $HGRCPATH
+  $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
+  $ echo "[progress]" >> $HGRCPATH
+  $ echo "assume-tty=1" >> $HGRCPATH
+
+test default params, display nothing because of delay
+
+  $ hg -y loop 3 2>&1 | python filtercr.py
+  
+  $ echo "delay=0" >> $HGRCPATH
+  $ echo "refresh=0" >> $HGRCPATH
+
+test with delay=0, refresh=0
+
+  $ hg -y loop 3 2>&1 | python filtercr.py
+  
+  loop [                                                                    ] 0/3
+  loop [=====================>                                              ] 1/3
+  loop [============================================>                       ] 2/3
+                                                                                  
+
+test refresh is taken in account
+
+  $ hg -y --config progress.refresh=100 loop 3 2>&1 | python filtercr.py
+  
+
+test format options 1
+
+  $ hg -y --config 'progress.format=number topic item+2' loop 2 2>&1 | python filtercr.py
+  
+  0/2 loop lo
+  1/2 loop lo
+                                                                                  
+
+test format options 2
+
+  $ hg -y --config 'progress.format=number item-3 bar' loop 2 2>&1 | python filtercr.py
+  
+  0/2 p.0 [                                                                     ]
+  1/2 p.1 [=================================>                                   ]
+                                                                                  
+
+test format options and indeterminate progress
+
+  $ hg -y --config 'progress.format=number item bar' loop -- -2 2>&1 | python filtercr.py
+  
+  0 loop.0               [ <=>                                                  ]
+  1 loop.1               [  <=>                                                 ]
+                                                                                  
+
+make sure things don't fall over if count > total
+
+  $ hg -y loop --total 4 6 2>&1 | python filtercr.py
+  
+  loop [                                                                    ] 0/4
+  loop [================>                                                   ] 1/4
+  loop [=================================>                                  ] 2/4
+  loop [==================================================>                 ] 3/4
+  loop [===================================================================>] 4/4
+  loop [ <=>                                                                ] 5/4
+                                                                                  
+
+test immediate progress completion
+
+  $ hg -y loop 0 2>&1 | python filtercr.py
+  
--- a/tests/test-pull-http	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-hg init test
-cd test
-echo a > a
-hg ci -Ama
-
-cd ..
-hg clone test test2
-cd test2
-echo a >> a
-hg ci -mb
-
-echo % expect error, cloning not allowed
-echo '[web]' > .hg/hgrc
-echo 'allowpull = false' >> .hg/hgrc
-hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-hg clone http://localhost:$HGPORT/ test3 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-"$TESTDIR/killdaemons.py"
-echo % serve errors
-cat errors.log
-
-req() {
-	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
-	cat hg.pid >> $DAEMON_PIDS
-	hg --cwd ../test pull http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-	kill `cat hg.pid`
-	echo % serve errors
-	cat errors.log
-}
-
-echo % expect error, pulling not allowed
-req
--- a/tests/test-pull-http.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% expect error, cloning not allowed
-abort: authorization failed
-requesting all changes
-% serve errors
-% expect error, pulling not allowed
-abort: authorization failed
-pulling from http://localhost:$HGPORT/
-searching for changes
-% serve errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-http.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,46 @@
+
+  $ cp "$TESTDIR"/printenv.py .
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ cd ..
+  $ hg clone test test2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test2
+  $ echo a >> a
+  $ hg ci -mb
+
+expect error, cloning not allowed
+
+  $ echo '[web]' > .hg/hgrc
+  $ echo 'allowpull = false' >> .hg/hgrc
+  $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ hg clone http://localhost:$HGPORT/ test3
+  requesting all changes
+  abort: authorization failed
+  [255]
+  $ "$TESTDIR/killdaemons.py"
+
+serve errors
+
+  $ cat errors.log
+  $ req() {
+  > 	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  > 	cat hg.pid >> $DAEMON_PIDS
+  > 	hg --cwd ../test pull http://localhost:$HGPORT/
+  > 	kill `cat hg.pid`
+  > 	echo % serve errors
+  > 	cat errors.log
+  > }
+
+expect error, pulling not allowed
+
+  $ req
+  pulling from http://localhost:*/ (glob)
+  searching for changes
+  abort: authorization failed
+  % serve errors
--- a/tests/test-pull-pull-corruption	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# Corrupt an hg repo with two pulls.
-#
-
-# create one repo with a long history
-hg init source1
-cd source1
-touch foo
-hg add foo
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    echo $i >> foo
-    hg ci -m $i
-done
-cd ..
-
-# create one repo with a shorter history
-hg clone -r 0 source1 source2
-cd source2
-echo a >> foo
-hg ci -m a
-cd ..
-
-# create a third repo to pull both other repos into it
-hg init corrupted
-cd corrupted
-# use a hook to make the second pull start while the first one is still running
-echo '[hooks]' >> .hg/hgrc
-echo 'prechangegroup = sleep 5' >> .hg/hgrc
-
-# start a pull...
-hg pull ../source1 &
-
-# ... and start another pull before the first one has finished
-sleep 1
-hg pull ../source2 2>/dev/null
-
-# see the result
-wait
-hg verify
-
--- a/tests/test-pull-pull-corruption.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-pulling from ../source2
-pulling from ../source1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 10 changesets with 10 changes to 1 files
-(run 'hg update' to get a working copy)
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 11 changesets, 11 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-pull-corruption.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,70 @@
+Corrupt an hg repo with two pulls.
+create one repo with a long history
+
+  $ hg init source1
+  $ cd source1
+  $ touch foo
+  $ hg add foo
+  $ for i in 1 2 3 4 5 6 7 8 9 10; do
+  >     echo $i >> foo
+  >     hg ci -m $i
+  > done
+  $ cd ..
+
+create one repo with a shorter history
+
+  $ hg clone -r 0 source1 source2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd source2
+  $ echo a >> foo
+  $ hg ci -m a
+  $ cd ..
+
+create a third repo to pull both other repos into it
+
+  $ hg init corrupted
+  $ cd corrupted
+
+use a hook to make the second pull start while the first one is still running
+
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'prechangegroup = sleep 5' >> .hg/hgrc
+
+start a pull...
+
+  $ hg pull ../source1 &
+
+... and start another pull before the first one has finished
+
+  $ sleep 1
+  $ hg pull ../source2 2>/dev/null
+  pulling from ../source2
+  pulling from ../source1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 10 changesets with 10 changes to 1 files
+  (run 'hg update' to get a working copy)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+see the result
+
+  $ wait
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 11 changesets, 11 total revisions
--- a/tests/test-pull-pull-corruption2	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Corrupt an hg repo with two pulls.
-#
-
-# create one repo with a long history
-hg init source1
-cd source1
-touch foo
-hg add foo
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    echo $i >> foo
-    hg ci -m $i
-done
-cd ..
-
-# create a third repo to pull both other repos into it
-hg init version2
-hg -R version2 pull source1 &
-sleep 1
-
-hg clone --pull -U version2 corrupted
-wait
-hg -R corrupted verify
-hg -R version2 verify
--- a/tests/test-pull-pull-corruption2.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-pulling from source1
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 10 changesets with 10 changes to 1 files
-(run 'hg update' to get a working copy)
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 10 changesets with 10 changes to 1 files
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 10 changesets, 10 total revisions
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 10 changesets, 10 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-pull-pull-corruption2.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,44 @@
+Corrupt an hg repo with two pulls.
+create one repo with a long history
+
+  $ hg init source1
+  $ cd source1
+  $ touch foo
+  $ hg add foo
+  $ for i in 1 2 3 4 5 6 7 8 9 10; do
+  >     echo $i >> foo
+  >     hg ci -m $i
+  > done
+  $ cd ..
+
+create a third repo to pull both other repos into it
+
+  $ hg init version2
+  $ hg -R version2 pull source1 &
+  $ sleep 1
+  pulling from source1
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 10 changesets with 10 changes to 1 files
+  (run 'hg update' to get a working copy)
+  $ hg clone --pull -U version2 corrupted
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 10 changesets with 10 changes to 1 files
+  $ wait
+  $ hg -R corrupted verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 10 changesets, 10 total revisions
+  $ hg -R version2 verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 10 changesets, 10 total revisions
--- a/tests/test-pull.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-pull.t	Mon Sep 27 10:47:36 2010 -0500
@@ -44,12 +44,12 @@
   2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
 
   $ hg pull
-  pulling from http://foo:\*\*\*@localhost:.*/ (re)
+  pulling from http://foo:\*\*\*@localhost:*/ (glob)
   searching for changes
   no changes found
 
   $ hg rollback --dry-run --verbose
-  rolling back to revision -1 \(undo pull: http://foo:\*\*\*@localhost:.*/\) (re)
+  rolling back to revision -1 (undo pull: http://foo:\*\*\*@localhost:*/) (glob)
 
 Issue622: hg init && hg pull -u URL doesn't checkout default branch
 
--- a/tests/test-push-http	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-hg init test
-cd test
-echo a > a
-hg ci -Ama
-
-cd ..
-hg clone test test2
-cd test2
-echo a >> a
-hg ci -mb
-
-req() {
-	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
-	cat hg.pid >> $DAEMON_PIDS
-	hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-	kill `cat hg.pid`
-	echo % serve errors
-	cat errors.log
-}
-
-cd ../test
-
-echo % expect ssl error
-req
-
-echo % expect authorization error
-echo '[web]' > .hg/hgrc
-echo 'push_ssl = false' >> .hg/hgrc
-req
-
-echo % expect authorization error: must have authorized user
-echo 'allow_push = unperson' >> .hg/hgrc
-req
-
-echo % expect success
-echo 'allow_push = *' >> .hg/hgrc
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup 0' >> .hg/hgrc
-req
-
-hg rollback
-echo % expect authorization error: all users denied
-echo '[web]' > .hg/hgrc
-echo 'push_ssl = false' >> .hg/hgrc
-echo 'deny_push = *' >> .hg/hgrc
-req
-
-echo % expect authorization error: some users denied, users must be authenticated
-echo 'deny_push = unperson' >> .hg/hgrc
-req
--- a/tests/test-push-http.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-adding a
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% expect ssl error
-pushing to http://localhost:$HGPORT/
-searching for changes
-remote: ssl required
-% serve errors
-% expect authorization error
-abort: authorization failed
-pushing to http://localhost:$HGPORT/
-searching for changes
-% serve errors
-% expect authorization error: must have authorized user
-abort: authorization failed
-pushing to http://localhost:$HGPORT/
-searching for changes
-% serve errors
-% expect success
-pushing to http://localhost:$HGPORT/
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http 
-% serve errors
-rolling back to revision 0 (undo serve)
-% expect authorization error: all users denied
-abort: authorization failed
-pushing to http://localhost:$HGPORT/
-searching for changes
-% serve errors
-% expect authorization error: some users denied, users must be authenticated
-abort: authorization failed
-pushing to http://localhost:$HGPORT/
-searching for changes
-% serve errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-push-http.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,87 @@
+
+  $ cp "$TESTDIR"/printenv.py .
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ cd ..
+  $ hg clone test test2
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd test2
+  $ echo a >> a
+  $ hg ci -mb
+  $ req() {
+  > 	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  > 	cat hg.pid >> $DAEMON_PIDS
+  > 	hg --cwd ../test2 push http://localhost:$HGPORT/
+  > 	kill `cat hg.pid`
+  > 	echo % serve errors
+  > 	cat errors.log
+  > }
+  $ cd ../test
+
+expect ssl error
+
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  remote: ssl required
+  % serve errors
+
+expect authorization error
+
+  $ echo '[web]' > .hg/hgrc
+  $ echo 'push_ssl = false' >> .hg/hgrc
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  abort: authorization failed
+  % serve errors
+
+expect authorization error: must have authorized user
+
+  $ echo 'allow_push = unperson' >> .hg/hgrc
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  abort: authorization failed
+  % serve errors
+
+expect success
+
+  $ echo 'allow_push = *' >> .hg/hgrc
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup 0' >> .hg/hgrc
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http 
+  % serve errors
+  $ hg rollback
+  rolling back to revision 0 (undo serve)
+
+expect authorization error: all users denied
+
+  $ echo '[web]' > .hg/hgrc
+  $ echo 'push_ssl = false' >> .hg/hgrc
+  $ echo 'deny_push = *' >> .hg/hgrc
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  abort: authorization failed
+  % serve errors
+
+expect authorization error: some users denied, users must be authenticated
+
+  $ echo 'deny_push = unperson' >> .hg/hgrc
+  $ req
+  pushing to http://localhost:*/ (glob)
+  searching for changes
+  abort: authorization failed
+  % serve errors
--- a/tests/test-rename-merge2	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-#!/bin/sh
-
-mkdir -p t
-cd t
-
-cat <<EOF > merge
-import sys, os
-f = open(sys.argv[1], "wb")
-f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
-f.close()
-EOF
-HGMERGE="python ../merge"; export HGMERGE
-
-# perform a test merge with possible renaming
-#
-# args:
-# $1 = action in local branch
-# $2 = action in remote branch
-# $3 = action in working dir
-# $4 = expected result
-tm()
-{
-    mkdir t
-    cd t
-    hg init
-    echo "[merge]" >> .hg/hgrc
-    echo "followcopies = 1" >> .hg/hgrc
-
-    # base
-    echo base > a
-    echo base > rev # used to force commits
-    hg add a rev
-    hg ci -m "base"
-
-    # remote
-    echo remote > rev
-    if [ "$2" != "" ] ; then $2 ; fi
-    hg ci -m "remote"
-
-    # local
-    hg co -q 0
-    echo local > rev
-    if [ "$1" != "" ] ; then $1 ; fi
-    hg ci -m "local"
-
-    # working dir
-    echo local > rev
-    if [ "$3" != "" ] ; then $3 ; fi
-
-    # merge
-    echo "--------------"
-    echo "test L:$1 R:$2 W:$3 - $4"
-    echo "--------------"
-    hg merge -y --debug --traceback
-
-    echo "--------------"
-    hg status -camC -X rev
-
-    hg ci -m "merge"
-
-    echo "--------------"
-    echo
-
-    cd ..
-    rm -r t
-}
-
-up() {
-    cp rev $1
-    hg add $1 2> /dev/null
-    if [ "$2" != "" ] ; then
-	cp rev $2
-	hg add $2 2> /dev/null
-    fi
-}
-
-uc() { up $1; hg cp $1 $2; } # update + copy
-um() { up $1; hg mv $1 $2; }
-nc() { hg cp $1 $2; } # just copy
-nm() { hg mv $1 $2; } # just move
-
-tm "up a  " "nc a b" "      " "1  get local a to b"
-tm "nc a b" "up a  " "      " "2  get rem change to a and b"
-tm "up a  " "nm a b" "      " "3  get local a change to b, remove a"
-tm "nm a b" "up a  " "      " "4  get remote change to b"
-tm "      " "nc a b" "      " "5  get b"
-tm "nc a b" "      " "      " "6  nothing"
-tm "      " "nm a b" "      " "7  get b"
-tm "nm a b" "      " "      " "8  nothing"
-tm "um a b" "um a b" "      " "9  do merge with ancestor in a"
-#tm "um a c" "um x c" "      " "10 do merge with no ancestor"
-tm "nm a b" "nm a c" "      " "11 get c, keep b"
-tm "nc a b" "up b  " "      " "12 merge b no ancestor"
-tm "up b  " "nm a b" "      " "13 merge b no ancestor"
-tm "nc a b" "up a b" "      " "14 merge b no ancestor"
-tm "up b  " "nm a b" "      " "15 merge b no ancestor, remove a"
-tm "nc a b" "up a b" "      " "16 get a, merge b no ancestor"
-tm "up a b" "nc a b" "      " "17 keep a, merge b no ancestor"
-tm "nm a b" "up a b" "      " "18 merge b no ancestor"
-tm "up a b" "nm a b" "      " "19 merge b no ancestor, prompt remove a"
-tm "up a  " "um a b" "      " "20 merge a and b to b, remove a"
-tm "um a b" "up a  " "      " "21 merge a and b to b"
-#tm "nm a b" "um x a" "      " "22 get a, keep b"
-tm "nm a b" "up a c" "      " "23 get c, keep b"
--- a/tests/test-rename-merge2.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,651 +0,0 @@
-created new head
---------------
-test L:up a   R:nc a b W:       - 1  get local a to b
---------------
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local e300d1c794ec+ remote 4ce40f5aca24
- rev: versions differ -> m
- a: remote copied to b -> m
-preserving a for resolve of b
-preserving rev for resolve of rev
-updating: a 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging a and b to b
-my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
- premerge successful
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
-C a
---------------
-
-created new head
---------------
-test L:nc a b R:up a   W:       - 2  get rem change to a and b
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 86a2aa42fc76+ remote f4db7e329e71
- a: remote is newer -> g
- b: local copied/moved to a -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-getting a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b and a to b
-my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
- premerge successful
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
-1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M a
-M b
-  a
---------------
-
-created new head
---------------
-test L:up a   R:nm a b W:       - 3  get local a change to b, remove a
---------------
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local e300d1c794ec+ remote bdb19105162a
- rev: versions differ -> m
- a: remote moved to b -> m
-preserving a for resolve of b
-preserving rev for resolve of rev
-removing a
-updating: a 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging a and b to b
-my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
- premerge successful
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
---------------
-
-created new head
---------------
-test L:nm a b R:up a   W:       - 4  get remote change to b
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 02963e448370+ remote f4db7e329e71
- b: local copied/moved to a -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b and a to b
-my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
- premerge successful
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
---------------
-
-created new head
---------------
-test L:       R:nc a b W:       - 5  get b
---------------
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a 
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 94b33a1b7f2d+ remote 4ce40f5aca24
- rev: versions differ -> m
- b: remote created -> g
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-getting b
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-C a
---------------
-
-created new head
---------------
-test L:nc a b R:       W:       - 6  nothing
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a 
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 86a2aa42fc76+ remote 97c705ade336
- rev: versions differ -> m
-preserving rev for resolve of rev
-updating: rev 1/1 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-C a
-C b
---------------
-
-created new head
---------------
-test L:       R:nm a b W:       - 7  get b
---------------
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a 
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 94b33a1b7f2d+ remote bdb19105162a
- a: other deleted -> r
- rev: versions differ -> m
- b: remote created -> g
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-removing a
-updating: b 2/3 files (66.67%)
-getting b
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
-1 files updated, 1 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
---------------
-
-created new head
---------------
-test L:nm a b R:       W:       - 8  nothing
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a 
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 02963e448370+ remote 97c705ade336
- rev: versions differ -> m
-preserving rev for resolve of rev
-updating: rev 1/1 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-C b
---------------
-
-created new head
---------------
-test L:um a b R:um a b W:       - 9  do merge with ancestor in a
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 62e7bf090eba+ remote 49b6d8032493
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
---------------
-
-created new head
---------------
-test L:nm a b R:nm a c W:       - 11 get c, keep b
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  unmatched files in other:
-   c
-  all copies found (* = to merge, ! = divergent):
-   c -> a !
-   b -> a !
-  checking for directory renames
- a: divergent renames -> dr
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 02963e448370+ remote fe905ef2c33e
- rev: versions differ -> m
- c: remote created -> g
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-warning: detected divergent renames of a to:
- b
- c
-updating: c 2/3 files (66.67%)
-getting c
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
-1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M c
-C b
---------------
-
-created new head
---------------
-test L:nc a b R:up b   W:       - 12 merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 86a2aa42fc76+ remote af30c7647fc7
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-C a
---------------
-
-created new head
---------------
-test L:up b   R:nm a b W:       - 13 merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
- a: other deleted -> r
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-removing a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
-0 files updated, 2 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
---------------
-
-created new head
---------------
-test L:nc a b R:up a b W:       - 14 merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
- a: remote is newer -> g
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-getting a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
-1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M a
-M b
---------------
-
-created new head
---------------
-test L:up b   R:nm a b W:       - 15 merge b no ancestor, remove a
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
- a: other deleted -> r
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-removing a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
-0 files updated, 2 files merged, 1 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
---------------
-
-created new head
---------------
-test L:nc a b R:up a b W:       - 16 get a, merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
- a: remote is newer -> g
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-getting a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
-1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M a
-M b
---------------
-
-created new head
---------------
-test L:up a b R:nc a b W:       - 17 keep a, merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 0b76e65c8289+ remote 4ce40f5aca24
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-C a
---------------
-
-created new head
---------------
-test L:nm a b R:up a b W:       - 18 merge b no ancestor
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 02963e448370+ remote 8dbce441892a
- b: versions differ -> m
- rev: versions differ -> m
-remote changed a which local deleted
-use (c)hanged version or leave (d)eleted? c
- a: prompt recreating -> g
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-getting a
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
-1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M a
-M b
---------------
-
-created new head
---------------
-test L:up a b R:nm a b W:       - 19 merge b no ancestor, prompt remove a
---------------
-  searching for copies back to rev 1
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 0b76e65c8289+ remote bdb19105162a
- local changed a which remote deleted
-use (c)hanged version or (d)elete? c
- a: prompt keep -> a
- b: versions differ -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: a 1/3 files (33.33%)
-updating: b 2/3 files (66.67%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b
-my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-C a
---------------
-
-created new head
---------------
-test L:up a   R:um a b W:       - 20 merge a and b to b, remove a
---------------
-  searching for copies back to rev 1
-  unmatched files in other:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local e300d1c794ec+ remote 49b6d8032493
- rev: versions differ -> m
- a: remote moved to b -> m
-preserving a for resolve of b
-preserving rev for resolve of rev
-removing a
-updating: a 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging a and b to b
-my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
---------------
-
-created new head
---------------
-test L:um a b R:up a   W:       - 21 merge a and b to b
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 62e7bf090eba+ remote f4db7e329e71
- b: local copied/moved to a -> m
- rev: versions differ -> m
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/2 files (50.00%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b and a to b
-my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
-updating: rev 2/2 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
---------------
-
-created new head
---------------
-test L:nm a b R:up a c W:       - 23 get c, keep b
---------------
-  searching for copies back to rev 1
-  unmatched files in local:
-   b
-  unmatched files in other:
-   c
-  all copies found (* = to merge, ! = divergent):
-   b -> a *
-  checking for directory renames
-resolving manifests
- overwrite None partial False
- ancestor 924404dff337 local 02963e448370+ remote 2b958612230f
- b: local copied/moved to a -> m
- rev: versions differ -> m
- c: remote created -> g
-preserving b for resolve of b
-preserving rev for resolve of rev
-updating: b 1/3 files (33.33%)
-picked tool 'python ../merge' for b (binary False symlink False)
-merging b and a to b
-my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
- premerge successful
-updating: c 2/3 files (66.67%)
-getting c
-updating: rev 3/3 files (100.00%)
-picked tool 'python ../merge' for rev (binary False symlink False)
-merging rev
-my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
-1 files updated, 2 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
---------------
-M b
-  a
-M c
---------------
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rename-merge2.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,754 @@
+
+  $ mkdir -p t
+  $ cd t
+  $ cat <<EOF > merge
+  > import sys, os
+  > f = open(sys.argv[1], "wb")
+  > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3]))
+  > f.close()
+  > EOF
+  $ HGMERGE="python ../merge"; export HGMERGE
+
+perform a test merge with possible renaming
+args:
+$1 = action in local branch
+$2 = action in remote branch
+$3 = action in working dir
+$4 = expected result
+
+  $ tm()
+  > {
+  >     mkdir t
+  >     cd t
+  >     hg init
+  >     echo "[merge]" >> .hg/hgrc
+  >     echo "followcopies = 1" >> .hg/hgrc
+  > 
+  >     # base
+  >     echo base > a
+  >     echo base > rev # used to force commits
+  >     hg add a rev
+  >     hg ci -m "base"
+  > 
+  >     # remote
+  >     echo remote > rev
+  >     if [ "$2" != "" ] ; then $2 ; fi
+  >     hg ci -m "remote"
+  > 
+  >     # local
+  >     hg co -q 0
+  >     echo local > rev
+  >     if [ "$1" != "" ] ; then $1 ; fi
+  >     hg ci -m "local"
+  > 
+  >     # working dir
+  >     echo local > rev
+  >     if [ "$3" != "" ] ; then $3 ; fi
+  > 
+  >     # merge
+  >     echo "--------------"
+  >     echo "test L:$1 R:$2 W:$3 - $4"
+  >     echo "--------------"
+  >     hg merge -y --debug --traceback
+  > 
+  >     echo "--------------"
+  >     hg status -camC -X rev
+  > 
+  >     hg ci -m "merge"
+  > 
+  >     echo "--------------"
+  >     echo
+  > 
+  >     cd ..
+  >     rm -r t
+  > }
+  $ up() {
+  >     cp rev $1
+  >     hg add $1 2> /dev/null
+  >     if [ "$2" != "" ] ; then
+  > 	cp rev $2
+  > 	hg add $2 2> /dev/null
+  >     fi
+  > }
+  $ uc() { up $1; hg cp $1 $2; } # update + copy
+  $ um() { up $1; hg mv $1 $2; }
+  $ nc() { hg cp $1 $2; } # just copy
+  $ nm() { hg mv $1 $2; } # just move
+  $ tm "up a  " "nc a b" "      " "1  get local a to b"
+  created new head
+  --------------
+  test L:up a   R:nc a b W:       - 1  get local a to b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local e300d1c794ec+ remote 4ce40f5aca24
+   rev: versions differ -> m
+   a: remote copied to b -> m
+  preserving a for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging a and b to b
+  my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337
+   premerge successful
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  C a
+  --------------
+  
+  $ tm "nc a b" "up a  " "      " "2  get rem change to a and b"
+  created new head
+  --------------
+  test L:nc a b R:up a   W:       - 2  get rem change to a and b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 86a2aa42fc76+ remote f4db7e329e71
+   a: remote is newer -> g
+   b: local copied/moved to a -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  getting a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b and a to b
+  my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337
+   premerge successful
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  1 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M a
+  M b
+    a
+  --------------
+  
+  $ tm "up a  " "nm a b" "      " "3  get local a change to b, remove a"
+  created new head
+  --------------
+  test L:up a   R:nm a b W:       - 3  get local a change to b, remove a
+  --------------
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local e300d1c794ec+ remote bdb19105162a
+   rev: versions differ -> m
+   a: remote moved to b -> m
+  preserving a for resolve of b
+  preserving rev for resolve of rev
+  removing a
+  updating: a 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging a and b to b
+  my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337
+   premerge successful
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  --------------
+  
+  $ tm "nm a b" "up a  " "      " "4  get remote change to b"
+  created new head
+  --------------
+  test L:nm a b R:up a   W:       - 4  get remote change to b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 02963e448370+ remote f4db7e329e71
+   b: local copied/moved to a -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b and a to b
+  my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337
+   premerge successful
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  --------------
+  
+  $ tm "      " "nc a b" "      " "5  get b"
+  created new head
+  --------------
+  test L:       R:nc a b W:       - 5  get b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a 
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 94b33a1b7f2d+ remote 4ce40f5aca24
+   rev: versions differ -> m
+   b: remote created -> g
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  getting b
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  C a
+  --------------
+  
+  $ tm "nc a b" "      " "      " "6  nothing"
+  created new head
+  --------------
+  test L:nc a b R:       W:       - 6  nothing
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a 
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 86a2aa42fc76+ remote 97c705ade336
+   rev: versions differ -> m
+  preserving rev for resolve of rev
+  updating: rev 1/1 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  C a
+  C b
+  --------------
+  
+  $ tm "      " "nm a b" "      " "7  get b"
+  created new head
+  --------------
+  test L:       R:nm a b W:       - 7  get b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a 
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 94b33a1b7f2d+ remote bdb19105162a
+   a: other deleted -> r
+   rev: versions differ -> m
+   b: remote created -> g
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  removing a
+  updating: b 2/3 files (66.67%)
+  getting b
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337
+  1 files updated, 1 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  --------------
+  
+  $ tm "nm a b" "      " "      " "8  nothing"
+  created new head
+  --------------
+  test L:nm a b R:       W:       - 8  nothing
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a 
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 02963e448370+ remote 97c705ade336
+   rev: versions differ -> m
+  preserving rev for resolve of rev
+  updating: rev 1/1 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337
+  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  C b
+  --------------
+  
+  $ tm "um a b" "um a b" "      " "9  do merge with ancestor in a"
+  created new head
+  --------------
+  test L:um a b R:um a b W:       - 9  do merge with ancestor in a
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 62e7bf090eba+ remote 49b6d8032493
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  --------------
+  
+
+m "um a c" "um x c" "      " "10 do merge with no ancestor"
+
+  $ tm "nm a b" "nm a c" "      " "11 get c, keep b"
+  created new head
+  --------------
+  test L:nm a b R:nm a c W:       - 11 get c, keep b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    unmatched files in other:
+     c
+    all copies found (* = to merge, ! = divergent):
+     c -> a !
+     b -> a !
+    checking for directory renames
+   a: divergent renames -> dr
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 02963e448370+ remote fe905ef2c33e
+   rev: versions differ -> m
+   c: remote created -> g
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  warning: detected divergent renames of a to:
+   b
+   c
+  updating: c 2/3 files (66.67%)
+  getting c
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337
+  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M c
+  C b
+  --------------
+  
+  $ tm "nc a b" "up b  " "      " "12 merge b no ancestor"
+  created new head
+  --------------
+  test L:nc a b R:up b   W:       - 12 merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 86a2aa42fc76+ remote af30c7647fc7
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  C a
+  --------------
+  
+  $ tm "up b  " "nm a b" "      " "13 merge b no ancestor"
+  created new head
+  --------------
+  test L:up b   R:nm a b W:       - 13 merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
+   a: other deleted -> r
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  removing a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
+  0 files updated, 2 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  --------------
+  
+  $ tm "nc a b" "up a b" "      " "14 merge b no ancestor"
+  created new head
+  --------------
+  test L:nc a b R:up a b W:       - 14 merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
+   a: remote is newer -> g
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  getting a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
+  1 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M a
+  M b
+  --------------
+  
+  $ tm "up b  " "nm a b" "      " "15 merge b no ancestor, remove a"
+  created new head
+  --------------
+  test L:up b   R:nm a b W:       - 15 merge b no ancestor, remove a
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 59318016310c+ remote bdb19105162a
+   a: other deleted -> r
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  removing a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337
+  0 files updated, 2 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  --------------
+  
+  $ tm "nc a b" "up a b" "      " "16 get a, merge b no ancestor"
+  created new head
+  --------------
+  test L:nc a b R:up a b W:       - 16 get a, merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 86a2aa42fc76+ remote 8dbce441892a
+   a: remote is newer -> g
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  getting a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337
+  1 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M a
+  M b
+  --------------
+  
+  $ tm "up a b" "nc a b" "      " "17 keep a, merge b no ancestor"
+  created new head
+  --------------
+  test L:up a b R:nc a b W:       - 17 keep a, merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 0b76e65c8289+ remote 4ce40f5aca24
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  C a
+  --------------
+  
+  $ tm "nm a b" "up a b" "      " "18 merge b no ancestor"
+  created new head
+  --------------
+  test L:nm a b R:up a b W:       - 18 merge b no ancestor
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 02963e448370+ remote 8dbce441892a
+   b: versions differ -> m
+   rev: versions differ -> m
+  remote changed a which local deleted
+  use (c)hanged version or leave (d)eleted? c
+   a: prompt recreating -> g
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  getting a
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337
+  1 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M a
+  M b
+  --------------
+  
+  $ tm "up a b" "nm a b" "      " "19 merge b no ancestor, prompt remove a"
+  created new head
+  --------------
+  test L:up a b R:nm a b W:       - 19 merge b no ancestor, prompt remove a
+  --------------
+    searching for copies back to rev 1
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 0b76e65c8289+ remote bdb19105162a
+   local changed a which remote deleted
+  use (c)hanged version or (d)elete? c
+   a: prompt keep -> a
+   b: versions differ -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: a 1/3 files (33.33%)
+  updating: b 2/3 files (66.67%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b
+  my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+  C a
+  --------------
+  
+  $ tm "up a  " "um a b" "      " "20 merge a and b to b, remove a"
+  created new head
+  --------------
+  test L:up a   R:um a b W:       - 20 merge a and b to b, remove a
+  --------------
+    searching for copies back to rev 1
+    unmatched files in other:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local e300d1c794ec+ remote 49b6d8032493
+   rev: versions differ -> m
+   a: remote moved to b -> m
+  preserving a for resolve of b
+  preserving rev for resolve of rev
+  removing a
+  updating: a 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging a and b to b
+  my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  --------------
+  
+  $ tm "um a b" "up a  " "      " "21 merge a and b to b"
+  created new head
+  --------------
+  test L:um a b R:up a   W:       - 21 merge a and b to b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 62e7bf090eba+ remote f4db7e329e71
+   b: local copied/moved to a -> m
+   rev: versions differ -> m
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/2 files (50.00%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b and a to b
+  my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337
+  updating: rev 2/2 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337
+  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  --------------
+  
+
+m "nm a b" "um x a" "      " "22 get a, keep b"
+
+  $ tm "nm a b" "up a c" "      " "23 get c, keep b"
+  created new head
+  --------------
+  test L:nm a b R:up a c W:       - 23 get c, keep b
+  --------------
+    searching for copies back to rev 1
+    unmatched files in local:
+     b
+    unmatched files in other:
+     c
+    all copies found (* = to merge, ! = divergent):
+     b -> a *
+    checking for directory renames
+  resolving manifests
+   overwrite None partial False
+   ancestor 924404dff337 local 02963e448370+ remote 2b958612230f
+   b: local copied/moved to a -> m
+   rev: versions differ -> m
+   c: remote created -> g
+  preserving b for resolve of b
+  preserving rev for resolve of rev
+  updating: b 1/3 files (33.33%)
+  picked tool 'python ../merge' for b (binary False symlink False)
+  merging b and a to b
+  my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337
+   premerge successful
+  updating: c 2/3 files (66.67%)
+  getting c
+  updating: rev 3/3 files (100.00%)
+  picked tool 'python ../merge' for rev (binary False symlink False)
+  merging rev
+  my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337
+  1 files updated, 2 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  --------------
+  M b
+    a
+  M c
+  --------------
+  
--- a/tests/test-rename.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-rename.t	Mon Sep 27 10:47:36 2010 -0500
@@ -265,7 +265,7 @@
   $ diff -u d1/b d2/b
   --- d1/b	* (glob)
   +++ d2/b	* (glob)
-  @@ -1 +1 @@
+  @@ * (glob)
   -d1/b
   +d2/b
   [1]
--- a/tests/test-revset.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-revset.t	Mon Sep 27 10:47:36 2010 -0500
@@ -215,6 +215,14 @@
   ('func', ('symbol', 'grep'), ('string', '('))
   hg: parse error: invalid match pattern: unbalanced parenthesis
   [255]
+  $ try 'grep("\bissue\d+")'
+  ('func', ('symbol', 'grep'), ('string', '\x08issue\\d+'))
+  $ try 'grep(r"\bissue\d+")'
+  ('func', ('symbol', 'grep'), ('string', '\\bissue\\d+'))
+  6
+  $ try 'grep(r"\")'
+  hg: parse error at 7: unterminated string
+  [255]
   $ log 'head()'
   0
   1
--- a/tests/test-rollback	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-mkdir t
-cd t
-hg init
-echo a > a
-hg add a
-hg commit -m "test"
-hg verify
-hg parents
-hg status
-hg rollback
-hg verify
-hg parents
-hg status
-
-echo % Test issue 902
-hg commit -m "test2"
-hg branch test
-hg rollback
-hg branch
-
-echo '% Test issue 1635 (commit message saved)'
-echo '.hg/last-message.txt:'
-cat .hg/last-message.txt ; echo
-
-echo % Test rollback of hg before issue 902 was fixed
-hg commit -m "test3"
-hg branch test
-rm .hg/undo.branch
-hg rollback
-hg branch
-
-echo '% rollback by pretxncommit saves commit message (issue 1635)'
-echo a >> a
-hg --config hooks.pretxncommit=false commit -m"precious commit message" 2>&1 | sed 's,exited with status .*,exited ...,g'
-echo '.hg/last-message.txt:'
-cat .hg/last-message.txt ; echo
-
-echo '% same thing, but run $EDITOR'
-cat > $HGTMP/editor <<'__EOF__'
-#!/bin/sh
-echo "another precious commit message" > "$1"
-__EOF__
-chmod +x "$HGTMP"/editor
-HGEDITOR="'$HGTMP'"/editor hg --config hooks.pretxncommit=false commit 2>&1 | sed 's,exited with status .*,exited ...,g'
-echo '.hg/last-message.txt:'
-cat .hg/last-message.txt
--- a/tests/test-rollback.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-changeset:   0:acb14030fe0a
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
-rolling back to revision -1 (undo commit)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-0 files, 0 changesets, 0 total revisions
-A a
-% Test issue 902
-marked working directory as branch test
-rolling back to revision -1 (undo commit)
-default
-% Test issue 1635 (commit message saved)
-.hg/last-message.txt:
-test2
-% Test rollback of hg before issue 902 was fixed
-marked working directory as branch test
-rolling back to revision -1 (undo commit)
-Named branch could not be reset, current branch still is: test
-test
-% rollback by pretxncommit saves commit message (issue 1635)
-transaction abort!
-rollback completed
-abort: pretxncommit hook exited ...
-.hg/last-message.txt:
-precious commit message
-% same thing, but run $EDITOR
-transaction abort!
-rollback completed
-note: commit message saved in .hg/last-message.txt
-abort: pretxncommit hook exited ...
-.hg/last-message.txt:
-another precious commit message
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rollback.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,91 @@
+
+  $ mkdir t
+  $ cd t
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg commit -m "test"
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  $ hg parents
+  changeset:   0:acb14030fe0a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  $ hg status
+  $ hg rollback
+  rolling back to revision -1 (undo commit)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 0 changesets, 0 total revisions
+  $ hg parents
+  $ hg status
+  A a
+
+Test issue 902
+
+  $ hg commit -m "test2"
+  $ hg branch test
+  marked working directory as branch test
+  $ hg rollback
+  rolling back to revision -1 (undo commit)
+  $ hg branch
+  default
+
+Test issue 1635 (commit message saved)
+.hg/last-message.txt:
+
+  $ cat .hg/last-message.txt ; echo
+  test2
+
+Test rollback of hg before issue 902 was fixed
+
+  $ hg commit -m "test3"
+  $ hg branch test
+  marked working directory as branch test
+  $ rm .hg/undo.branch
+  $ hg rollback
+  rolling back to revision -1 (undo commit)
+  Named branch could not be reset, current branch still is: test
+  $ hg branch
+  test
+
+rollback by pretxncommit saves commit message (issue 1635)
+
+  $ echo a >> a
+  $ hg --config hooks.pretxncommit=false commit -m"precious commit message"
+  transaction abort!
+  rollback completed
+  abort: pretxncommit hook exited with status * (glob)
+  [255]
+
+.hg/last-message.txt:
+
+  $ cat .hg/last-message.txt ; echo
+  precious commit message
+  $ echo '% same thing, but run $EDITOR'
+  % same thing, but run $EDITOR
+  $ cat > $HGTMP/editor <<'__EOF__'
+  > #!/bin/sh
+  > echo "another precious commit message" > "$1"
+  > __EOF__
+  > chmod +x "$HGTMP"/editor
+  > HGEDITOR="'$HGTMP'"/editor hg --config hooks.pretxncommit=false commit 2>&1
+  > cat .hg/last-message.txt
+  transaction abort!
+  rollback completed
+  note: commit message saved in .hg/last-message.txt
+  abort: pretxncommit hook exited with status * (glob)
+  another precious commit message
+
+.hg/last-message.txt:
+
--- a/tests/test-run-tests.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-run-tests.t	Mon Sep 27 10:47:36 2010 -0500
@@ -33,5 +33,5 @@
 
 Exit code:
 
-  $ false
+  $ (exit 1) 
   [1]
--- a/tests/test-schemes	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-cat <<EOF >> $HGRCPATH
-[extensions]
-schemes=
-
-[schemes]
-l = http://localhost:$HGPORT/
-parts = http://{1}:$HGPORT/
-z = file:\$PWD/
-EOF
-
-hg init test
-cd test
-echo a > a
-hg ci -Am initial
-
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-cat hg.pid >> $DAEMON_PIDS
-
-hg incoming l://
-
-echo % check that {1} syntax works
-hg incoming --debug parts://localhost | sed 's/[0-9]//g'
-
-echo % check that paths are expanded
-PWD=`pwd` hg incoming z://
-
-echo % errors
-cat errors.log
--- a/tests/test-schemes.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-adding a
-comparing with l://
-searching for changes
-no changes found
-% check that {1} syntax works
-using http://localhost:/
-sending between command
-comparing with parts://localhost
-sending heads command
-searching for changes
-no changes found
-% check that paths are expanded
-comparing with z://
-searching for changes
-no changes found
-% errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-schemes.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,45 @@
+
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > schemes=
+  > 
+  > [schemes]
+  > l = http://localhost:$HGPORT/
+  > parts = http://{1}:$HGPORT/
+  > z = file:\$PWD/
+  > EOF
+  $ hg init test
+  $ cd test
+  $ echo a > a
+  $ hg ci -Am initial
+  adding a
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ hg incoming l://
+  comparing with l://
+  searching for changes
+  no changes found
+  [1]
+
+check that {1} syntax works
+
+  $ hg incoming --debug parts://localhost
+  using http://localhost:*/ (glob)
+  sending between command
+  comparing with parts://localhost
+  sending heads command
+  searching for changes
+  no changes found
+  [1]
+
+check that paths are expanded
+
+  $ PWD=`pwd` hg incoming z://
+  comparing with z://
+  searching for changes
+  no changes found
+  [1]
+
+errors
+
+  $ cat errors.log
--- a/tests/test-serve	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-serve	Mon Sep 27 10:47:36 2010 -0500
@@ -40,8 +40,10 @@
 echo % With -v and -p HGPORT2
 hgserve -p "$HGPORT2"
 
-echo '% With -v and -p http (should fail)'
-KILLQUIETLY=Y hgserve -p http; KILLQUIETLY=N
+echo '% With -v and -p echo (should fail because low port)'
+KILLQUIETLY=Y
+hgserve -p echo
+KILLQUIETLY=N
 
 echo % With --prefix foo
 hgserve --prefix foo
--- a/tests/test-serve.out	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-serve.out	Mon Sep 27 10:47:36 2010 -0500
@@ -7,8 +7,8 @@
 % With -v and -p HGPORT2
 listening at http://localhost/ (bound to 127.0.0.1:HGPORT2)
 % errors
-% With -v and -p http (should fail)
-abort: cannot start server at 'localhost:80': Permission denied
+% With -v and -p echo (should fail because low port)
+abort: cannot start server at 'localhost:7': Permission denied
 abort: child process failed to start
 % errors
 % With --prefix foo
--- a/tests/test-share	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-echo "[extensions]"      >> $HGRCPATH
-echo "share = "          >> $HGRCPATH
-
-echo % prepare repo1
-hg init repo1
-cd repo1
-echo a > a
-hg commit -A -m'init'
-
-echo % share it
-cd ..
-hg share repo1 repo2
-
-echo % contents of repo2/.hg
-cd repo2
-[ -d .hg/store ] \
-  && echo "fail: .hg/store should not exist" \
-  || echo "pass: .hg/store does not exist"
-# Some sed versions appends newline, some don't, and some just fails
-(cat .hg/sharedpath; echo) | head -n1 | "$TESTDIR/filtertmp.py"
-
-echo % commit in shared clone
-echo a >> a
-hg commit -m'change in shared clone'
-
-echo % check original
-cd ../repo1
-hg log
-hg update
-cat a             # should be two lines of "a"
-
-echo % commit in original
-echo b > b
-hg commit -A -m'another file'
-
-echo % check in shared clone
-cd ../repo2
-hg log
-hg update
-cat b             # should exist with one "b"
-
-echo % hg serve shared clone
-hg serve -n test -p $HGPORT -d --pid-file=hg.pid
-cat hg.pid >> $DAEMON_PIDS
-
-"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/'
--- a/tests/test-share.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-% prepare repo1
-adding a
-% share it
-updating working directory
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% contents of repo2/.hg
-pass: .hg/store does not exist
-$HGTMP/test-share/repo1/.hg
-% commit in shared clone
-% check original
-changeset:   1:8af4dc49db9e
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change in shared clone
-
-changeset:   0:d3873e73d99e
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     init
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-a
-a
-% commit in original
-adding b
-% check in shared clone
-changeset:   2:c2e0ac586386
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     another file
-
-changeset:   1:8af4dc49db9e
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     change in shared clone
-
-changeset:   0:d3873e73d99e
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     init
-
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-b
-% hg serve shared clone
-200 Script output follows
-
-
--rw-r--r-- 4 a
--rw-r--r-- 2 b
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-share.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,99 @@
+
+  $ echo "[extensions]"      >> $HGRCPATH
+  $ echo "share = "          >> $HGRCPATH
+
+prepare repo1
+
+  $ hg init repo1
+  $ cd repo1
+  $ echo a > a
+  $ hg commit -A -m'init'
+  adding a
+
+share it
+
+  $ cd ..
+  $ hg share repo1 repo2
+  updating working directory
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+share shouldn't have a store dir
+
+  $ cd repo2
+  $ test -d .hg/store
+  [1]
+
+Some sed versions appends newline, some don't, and some just fails
+
+  $ cat .hg/sharedpath; echo
+  */repo1/.hg (glob)
+
+commit in shared clone
+
+  $ echo a >> a
+  $ hg commit -m'change in shared clone'
+
+check original
+
+  $ cd ../repo1
+  $ hg log
+  changeset:   1:8af4dc49db9e
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change in shared clone
+  
+  changeset:   0:d3873e73d99e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat a             # should be two lines of "a"
+  a
+  a
+
+commit in original
+
+  $ echo b > b
+  $ hg commit -A -m'another file'
+  adding b
+
+check in shared clone
+
+  $ cd ../repo2
+  $ hg log
+  changeset:   2:c2e0ac586386
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     another file
+  
+  changeset:   1:8af4dc49db9e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     change in shared clone
+  
+  changeset:   0:d3873e73d99e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat b             # should exist with one "b"
+  b
+
+hg serve shared clone
+
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+  $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/'
+  200 Script output follows
+  
+  
+  -rw-r--r-- 4 a
+  -rw-r--r-- 2 b
+  
+  
--- a/tests/test-simplemerge-cmd	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/../contrib/simplemerge .
-
-echo base > base
-
-echo local > local
-cat base >> local
-cp local orig
-
-cat base > other
-echo other >> other
-
-echo '% changing local directly'
-python simplemerge local base other && echo "merge succeeded"
-cat local
-cp orig local
-
-echo '% printing to stdout'
-python simplemerge -p local base other
-echo ' local:'
-cat local
-
-echo '% conflicts'
-cp base conflict-local
-cp other conflict-other
-echo not other >> conflict-local
-echo end >> conflict-local
-echo end >> conflict-other
-python simplemerge -p conflict-local base conflict-other || echo "merge failed"
-
-echo '% --no-minimal'
-python simplemerge -p --no-minimal conflict-local base conflict-other
-
-echo '% 1 label'
-python simplemerge -p -L foo conflict-local base conflict-other
-
-echo '% 2 labels'
-python simplemerge -p -L foo -L bar conflict-local base conflict-other
-
-echo '% too many labels'
-python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
-
-echo '% binary file'
-python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
-cat orig >> binary-local
-python simplemerge -p binary-local base other
-
-echo '% binary file --text'
-python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
-
-echo '% help'
-python simplemerge --help
-
-echo '% wrong number of arguments'
-python simplemerge
-
-echo '% bad option'
-python simplemerge --foo -p local base other
-
-exit 0
--- a/tests/test-simplemerge-cmd.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-% changing local directly
-merge succeeded
-local
-base
-other
-% printing to stdout
-local
-base
-other
- local:
-local
-base
-% conflicts
-base
-<<<<<<< conflict-local
-not other
-=======
-other
->>>>>>> conflict-other
-end
-warning: conflicts during merge.
-merge failed
-% --no-minimal
-base
-<<<<<<< conflict-local
-not other
-end
-=======
-other
-end
->>>>>>> conflict-other
-warning: conflicts during merge.
-% 1 label
-base
-<<<<<<< foo
-not other
-=======
-other
->>>>>>> conflict-other
-end
-warning: conflicts during merge.
-% 2 labels
-base
-<<<<<<< foo
-not other
-=======
-other
->>>>>>> bar
-end
-warning: conflicts during merge.
-% too many labels
-abort: can only specify two labels.
-% binary file
-abort: binary-local looks like a binary file.
-% binary file --text
-warning: binary-local looks like a binary file.
-\x00local
-base
-other
-% help
-simplemerge [OPTS] LOCAL BASE OTHER
-
-    Simple three-way file merge utility with a minimal feature set.
-
-    Apply to LOCAL the changes necessary to go from BASE to OTHER.
-
-    By default, LOCAL is overwritten with the results of this operation.
-
-options:
- -L --label       labels to use on conflict markers
- -a --text        treat all files as text
- -p --print       print results instead of overwriting LOCAL
-    --no-minimal  do not try to minimize conflict regions
- -h --help        display help and exit
- -q --quiet       suppress output
-% wrong number of arguments
-simplemerge: wrong number of arguments
-simplemerge [OPTS] LOCAL BASE OTHER
-
-    Simple three-way file merge utility with a minimal feature set.
-
-    Apply to LOCAL the changes necessary to go from BASE to OTHER.
-
-    By default, LOCAL is overwritten with the results of this operation.
-
-options:
- -L --label       labels to use on conflict markers
- -a --text        treat all files as text
- -p --print       print results instead of overwriting LOCAL
-    --no-minimal  do not try to minimize conflict regions
- -h --help        display help and exit
- -q --quiet       suppress output
-% bad option
-simplemerge: option --foo not recognized
-simplemerge [OPTS] LOCAL BASE OTHER
-
-    Simple three-way file merge utility with a minimal feature set.
-
-    Apply to LOCAL the changes necessary to go from BASE to OTHER.
-
-    By default, LOCAL is overwritten with the results of this operation.
-
-options:
- -L --label       labels to use on conflict markers
- -a --text        treat all files as text
- -p --print       print results instead of overwriting LOCAL
-    --no-minimal  do not try to minimize conflict regions
- -h --help        display help and exit
- -q --quiet       suppress output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-simplemerge-cmd.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,172 @@
+
+  $ cp "$TESTDIR"/../contrib/simplemerge .
+  $ echo base > base
+  $ echo local > local
+  $ cat base >> local
+  $ cp local orig
+  $ cat base > other
+  $ echo other >> other
+
+changing local directly
+
+  $ python simplemerge local base other && echo "merge succeeded"
+  merge succeeded
+  $ cat local
+  local
+  base
+  other
+  $ cp orig local
+
+printing to stdout
+
+  $ python simplemerge -p local base other
+  local
+  base
+  other
+
+local:
+
+  $ cat local
+  local
+  base
+
+conflicts
+
+  $ cp base conflict-local
+  $ cp other conflict-other
+  $ echo not other >> conflict-local
+  $ echo end >> conflict-local
+  $ echo end >> conflict-other
+  $ python simplemerge -p conflict-local base conflict-other
+  base
+  <<<<<<< conflict-local
+  not other
+  =======
+  other
+  >>>>>>> conflict-other
+  end
+  warning: conflicts during merge.
+  [1]
+
+--no-minimal
+
+  $ python simplemerge -p --no-minimal conflict-local base conflict-other
+  base
+  <<<<<<< conflict-local
+  not other
+  end
+  =======
+  other
+  end
+  >>>>>>> conflict-other
+  warning: conflicts during merge.
+  [1]
+
+1 label
+
+  $ python simplemerge -p -L foo conflict-local base conflict-other
+  base
+  <<<<<<< foo
+  not other
+  =======
+  other
+  >>>>>>> conflict-other
+  end
+  warning: conflicts during merge.
+  [1]
+
+2 labels
+
+  $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
+  base
+  <<<<<<< foo
+  not other
+  =======
+  other
+  >>>>>>> bar
+  end
+  warning: conflicts during merge.
+  [1]
+
+too many labels
+
+  $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
+  abort: can only specify two labels.
+  [255]
+
+binary file
+
+  $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
+  $ cat orig >> binary-local
+  $ python simplemerge -p binary-local base other
+  abort: binary-local looks like a binary file.
+  [255]
+
+binary file --text
+
+  $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
+  warning: binary-local looks like a binary file.
+  \x00local
+  base
+  other
+
+help
+
+  $ python simplemerge --help
+  simplemerge [OPTS] LOCAL BASE OTHER
+  
+      Simple three-way file merge utility with a minimal feature set.
+  
+      Apply to LOCAL the changes necessary to go from BASE to OTHER.
+  
+      By default, LOCAL is overwritten with the results of this operation.
+  
+  options:
+   -L --label       labels to use on conflict markers
+   -a --text        treat all files as text
+   -p --print       print results instead of overwriting LOCAL
+      --no-minimal  do not try to minimize conflict regions
+   -h --help        display help and exit
+   -q --quiet       suppress output
+
+wrong number of arguments
+
+  $ python simplemerge
+  simplemerge: wrong number of arguments
+  simplemerge [OPTS] LOCAL BASE OTHER
+  
+      Simple three-way file merge utility with a minimal feature set.
+  
+      Apply to LOCAL the changes necessary to go from BASE to OTHER.
+  
+      By default, LOCAL is overwritten with the results of this operation.
+  
+  options:
+   -L --label       labels to use on conflict markers
+   -a --text        treat all files as text
+   -p --print       print results instead of overwriting LOCAL
+      --no-minimal  do not try to minimize conflict regions
+   -h --help        display help and exit
+   -q --quiet       suppress output
+  [1]
+
+bad option
+
+  $ python simplemerge --foo -p local base other
+  simplemerge: option --foo not recognized
+  simplemerge [OPTS] LOCAL BASE OTHER
+  
+      Simple three-way file merge utility with a minimal feature set.
+  
+      Apply to LOCAL the changes necessary to go from BASE to OTHER.
+  
+      By default, LOCAL is overwritten with the results of this operation.
+  
+  options:
+   -L --label       labels to use on conflict markers
+   -a --text        treat all files as text
+   -p --print       print results instead of overwriting LOCAL
+      --no-minimal  do not try to minimize conflict regions
+   -h --help        display help and exit
+   -q --quiet       suppress output
+  [1]
--- a/tests/test-ssh	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-# This test tries to exercise the ssh functionality with a dummy script
-
-cat <<EOF > dummyssh
-import sys
-import os
-
-os.chdir(os.path.dirname(sys.argv[0]))
-if sys.argv[1] != "user@dummy":
-    sys.exit(-1)
-
-if not os.path.exists("dummyssh"):
-    sys.exit(-1)
-
-os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
-
-log = open("dummylog", "ab")
-log.write("Got arguments")
-for i, arg in enumerate(sys.argv[1:]):
-    log.write(" %d:%s" % (i+1, arg))
-log.write("\n")
-log.close()
-r = os.system(sys.argv[2])
-sys.exit(bool(r))
-EOF
-
-cat <<EOF > badhook
-import sys
-sys.stdout.write("KABOOM\n")
-EOF
-
-echo "# creating 'remote'"
-hg init remote
-cd remote
-echo this > foo
-echo this > fooO
-hg ci -A -m "init" foo fooO
-echo '[server]' > .hg/hgrc
-echo 'uncompressed = True' >> .hg/hgrc
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup-in-remote 0 ../dummylog' >> .hg/hgrc
-
-cd ..
-
-echo "# repo not found error"
-hg clone -e "python ./dummyssh" ssh://user@dummy/nonexistent local
-
-echo "# clone remote via stream"
-hg clone -e "python ./dummyssh" --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \
-  sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
-cd local-stream
-hg verify
-cd ..
-
-echo "# clone remote via pull"
-hg clone -e "python ./dummyssh" ssh://user@dummy/remote local
-
-echo "# verify"
-cd local
-hg verify
-
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
-
-echo "# empty default pull"
-hg paths
-hg pull -e "python ../dummyssh"
-
-echo "# local change"
-echo bleah > foo
-hg ci -m "add"
-
-echo "# updating rc"
-echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
-echo "[ui]" >> .hg/hgrc
-echo "ssh = python ../dummyssh" >> .hg/hgrc
-
-echo "# find outgoing"
-hg out ssh://user@dummy/remote
-
-echo "# find incoming on the remote side"
-hg incoming -R ../remote -e "python ../dummyssh" ssh://user@dummy/local
-
-echo "# push"
-hg push
-
-cd ../remote
-
-echo "# check remote tip"
-hg tip
-hg verify
-hg cat -r tip foo
-
-echo z > z
-hg ci -A -m z z
-# a bad, evil hook that prints to stdout
-echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
-
-cd ../local
-echo r > r
-hg ci -A -m z r
-
-echo "# push should succeed even though it has an unexpected response"
-hg push
-hg -R ../remote heads
-
-cd ..
-cat dummylog
--- a/tests/test-ssh-clone-r	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-# This test tries to exercise the ssh functionality with a dummy script
-
-cat <<EOF > dummyssh
-import sys
-import os
-
-os.chdir(os.path.dirname(sys.argv[0]))
-if sys.argv[1] != "user@dummy":
-    sys.exit(-1)
-
-if not os.path.exists("dummyssh"):
-    sys.exit(-1)
-
-os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
-
-log = open("dummylog", "ab")
-log.write("Got arguments")
-for i, arg in enumerate(sys.argv[1:]):
-    log.write(" %d:%s" % (i+1, arg))
-log.write("\n")
-log.close()
-r = os.system(sys.argv[2])
-sys.exit(bool(r))
-EOF
-
-hg init remote
-cd remote
-echo "# creating 'remote'"
-cat >>afile <<EOF
-0
-EOF
-hg add afile
-hg commit -m "0.0"
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "0.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "0.2"
-cat >>afile <<EOF
-3
-EOF
-hg commit -m "0.3"
-hg update -C 0
-cat >>afile <<EOF
-1
-EOF
-hg commit -m "1.1"
-cat >>afile <<EOF
-2
-EOF
-hg commit -m "1.2"
-cat >fred <<EOF
-a line
-EOF
-cat >>afile <<EOF
-3
-EOF
-hg add fred
-hg commit -m "1.3"
-hg mv afile adifferentfile
-hg commit -m "1.3m"
-hg update -C 3
-hg mv afile anotherfile
-hg commit -m "0.3m"
-hg debugindex .hg/store/data/afile.i
-hg debugindex .hg/store/data/adifferentfile.i
-hg debugindex .hg/store/data/anotherfile.i
-hg debugindex .hg/store/data/fred.i
-hg debugindex .hg/store/00manifest.i
-hg verify
-cd ..
-
-echo "# clone remote via stream"
-for i in 0 1 2 3 4 5 6 7 8; do
-   hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" 2>&1
-   if cd test-"$i"; then
-      hg verify
-      cd ..
-   fi
-done
-cd test-8
-hg pull ../test-7
-hg verify
-cd ..
-cd test-1
-hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote 2>&1
-hg verify
-hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1
-cd ..
-cd test-2
-hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote 2>&1
-hg verify
-hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1
-hg verify
-cd ..
--- a/tests/test-ssh-clone-r.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +0,0 @@
-# creating 'remote'
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-created new head
-1 files updated, 0 files merged, 2 files removed, 0 files unresolved
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 362fef284ce2 000000000000 000000000000
-     1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
-     2         8       7      2       2 4c982badb186 125144f7e028 000000000000
-     3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       7 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      75      0       8 2565f3199a74 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
-     1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
-     2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
-     3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
-     4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
-     5       250      68      3       7 09bb521d218d de68e904d169 000000000000
-     6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-# clone remote via stream
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 4 changesets, 4 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 2 changesets, 2 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 3 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 5 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 4 changesets, 5 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 6 changes to 3 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-3 files, 5 changesets, 6 total revisions
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 5 changesets with 5 changes to 2 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 5 changesets, 5 total revisions
-pulling from ../test-7
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 2 changes to 3 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
-pulling from ssh://user@dummy/remote
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 0 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 3 changesets, 2 total revisions
-pulling from ssh://user@dummy/remote
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 6 changesets with 5 changes to 4 files
-(run 'hg update' to get a working copy)
-pulling from ssh://user@dummy/remote
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 0 changes to 1 files (+1 heads)
-(run 'hg heads' to see heads, 'hg merge' to merge)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 5 changesets, 3 total revisions
-pulling from ssh://user@dummy/remote
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 4 changesets with 4 changes to 4 files
-(run 'hg update' to get a working copy)
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-4 files, 9 changesets, 7 total revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-ssh-clone-r.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,289 @@
+This test tries to exercise the ssh functionality with a dummy script
+
+  $ cat <<EOF > dummyssh
+  > import sys
+  > import os
+  > 
+  > os.chdir(os.path.dirname(sys.argv[0]))
+  > if sys.argv[1] != "user@dummy":
+  >     sys.exit(-1)
+  > 
+  > if not os.path.exists("dummyssh"):
+  >     sys.exit(-1)
+  > 
+  > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
+  > 
+  > log = open("dummylog", "ab")
+  > log.write("Got arguments")
+  > for i, arg in enumerate(sys.argv[1:]):
+  >     log.write(" %d:%s" % (i+1, arg))
+  > log.write("\n")
+  > log.close()
+  > r = os.system(sys.argv[2])
+  > sys.exit(bool(r))
+  > EOF
+  $ hg init remote
+  $ cd remote
+
+creating 'remote
+
+  $ cat >>afile <<EOF
+  > 0
+  > EOF
+  $ hg add afile
+  $ hg commit -m "0.0"
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "0.1"
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "0.2"
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg commit -m "0.3"
+  $ hg update -C 0
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat >>afile <<EOF
+  > 1
+  > EOF
+  $ hg commit -m "1.1"
+  created new head
+  $ cat >>afile <<EOF
+  > 2
+  > EOF
+  $ hg commit -m "1.2"
+  $ cat >fred <<EOF
+  > a line
+  > EOF
+  $ cat >>afile <<EOF
+  > 3
+  > EOF
+  $ hg add fred
+  $ hg commit -m "1.3"
+  $ hg mv afile adifferentfile
+  $ hg commit -m "1.3m"
+  $ hg update -C 3
+  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg mv afile anotherfile
+  $ hg commit -m "0.3m"
+  $ hg debugindex .hg/store/data/afile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 362fef284ce2 000000000000 000000000000
+       1         3       5      1       1 125144f7e028 362fef284ce2 000000000000
+       2         8       7      2       2 4c982badb186 125144f7e028 000000000000
+       3        15       9      3       3 19b1fc555737 4c982badb186 000000000000
+  $ hg debugindex .hg/store/data/adifferentfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       7 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/anotherfile.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      75      0       8 2565f3199a74 000000000000 000000000000
+  $ hg debugindex .hg/store/data/fred.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       8      0       6 12ab3bcc5ea4 000000000000 000000000000
+  $ hg debugindex .hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0      48      0       0 43eadb1d2d06 000000000000 000000000000
+       1        48      48      1       1 8b89697eba2c 43eadb1d2d06 000000000000
+       2        96      48      2       2 626a32663c2f 8b89697eba2c 000000000000
+       3       144      48      3       3 f54c32f13478 626a32663c2f 000000000000
+       4       192      58      3       6 de68e904d169 626a32663c2f 000000000000
+       5       250      68      3       7 09bb521d218d de68e904d169 000000000000
+       6       318      54      6       8 1fde233dfb0f f54c32f13478 000000000000
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+
+clone remote via stream
+
+  $ for i in 0 1 2 3 4 5 6 7 8; do
+  >    hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i"
+  >    if cd test-"$i"; then
+  >       hg verify
+  >       cd ..
+  >    fi
+  > done
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 4 changesets, 4 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 2 changesets, 2 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 3 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 5 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 4 changesets, 5 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 6 changes to 3 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  3 files, 5 changesets, 6 total revisions
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 5 changesets with 5 changes to 2 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 5 changesets, 5 total revisions
+  $ cd test-8
+  $ hg pull ../test-7
+  pulling from ../test-7
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 2 changes to 3 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
+  $ cd ..
+  $ cd test-1
+  $ hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote
+  pulling from ssh://user@dummy/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 3 changesets, 2 total revisions
+  $ hg pull -e "python ../dummyssh" ssh://user@dummy/remote
+  pulling from ssh://user@dummy/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 6 changesets with 5 changes to 4 files
+  (run 'hg update' to get a working copy)
+  $ cd ..
+  $ cd test-2
+  $ hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote
+  pulling from ssh://user@dummy/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 5 changesets, 3 total revisions
+  $ hg pull -e "python ../dummyssh" ssh://user@dummy/remote
+  pulling from ssh://user@dummy/remote
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 4 files
+  (run 'hg update' to get a working copy)
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  4 files, 9 changesets, 7 total revisions
--- a/tests/test-ssh.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-# creating 'remote'
-# repo not found error
-remote: abort: There is no Mercurial repository here (.hg not found)!
-abort: no suitable response from remote hg!
-# clone remote via stream
-streaming all changes
-XXX files to transfer, XXX bytes of data
-transferred XXX bytes in XXX seconds (XXX XB/sec)
-updating to branch default
-XXX files updated, XXX files merged, XXX files removed, XXX files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 1 changesets, 2 total revisions
-# clone remote via pull
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 2 changes to 2 files
-updating to branch default
-2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-# verify
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 1 changesets, 2 total revisions
-# empty default pull
-default = ssh://user@dummy/remote
-pulling from ssh://user@dummy/remote
-searching for changes
-no changes found
-# local change
-# updating rc
-# find outgoing
-comparing with ssh://user@dummy/remote
-searching for changes
-changeset:   1:a28a9d1a809c
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add
-
-# find incoming on the remote side
-comparing with ssh://user@dummy/local
-searching for changes
-changeset:   1:a28a9d1a809c
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add
-
-# push
-pushing to ssh://user@dummy/remote
-searching for changes
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-# check remote tip
-changeset:   1:a28a9d1a809c
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     add
-
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-2 files, 2 changesets, 3 total revisions
-bleah
-created new head
-# push should succeed even though it has an unexpected response
-pushing to ssh://user@dummy/remote
-searching for changes
-note: unsynced remote changes!
-remote: adding changesets
-remote: adding manifests
-remote: adding file changes
-remote: added 1 changesets with 1 changes to 1 files
-remote: KABOOM
-changeset:   3:1383141674ec
-tag:         tip
-parent:      1:a28a9d1a809c
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     z
-
-changeset:   2:6c0482d977a3
-parent:      0:1160648e36ce
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     z
-
-Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-Got arguments 1:user@dummy 2:hg -R local serve --stdio
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
-Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-ssh.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,233 @@
+
+  $ cp "$TESTDIR"/printenv.py .
+
+This test tries to exercise the ssh functionality with a dummy script
+
+  $ cat <<EOF > dummyssh
+  > import sys
+  > import os
+  > 
+  > os.chdir(os.path.dirname(sys.argv[0]))
+  > if sys.argv[1] != "user@dummy":
+  >     sys.exit(-1)
+  > 
+  > if not os.path.exists("dummyssh"):
+  >     sys.exit(-1)
+  > 
+  > os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
+  > 
+  > log = open("dummylog", "ab")
+  > log.write("Got arguments")
+  > for i, arg in enumerate(sys.argv[1:]):
+  >     log.write(" %d:%s" % (i+1, arg))
+  > log.write("\n")
+  > log.close()
+  > r = os.system(sys.argv[2])
+  > sys.exit(bool(r))
+  > EOF
+  $ cat <<EOF > badhook
+  > import sys
+  > sys.stdout.write("KABOOM\n")
+  > EOF
+
+creating 'remote
+
+  $ hg init remote
+  $ cd remote
+  $ echo this > foo
+  $ echo this > fooO
+  $ hg ci -A -m "init" foo fooO
+  $ echo '[server]' > .hg/hgrc
+  $ echo 'uncompressed = True' >> .hg/hgrc
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup-in-remote 0 ../dummylog' >> .hg/hgrc
+  $ cd ..
+
+repo not found error
+
+  $ hg clone -e "python ./dummyssh" ssh://user@dummy/nonexistent local
+  remote: abort: There is no Mercurial repository here (.hg not found)!
+  abort: no suitable response from remote hg!
+  [255]
+
+non-existent absolute path
+
+  $ hg clone -e "python ./dummyssh" ssh://user@dummy//$HGTMP/nonexistent local
+  remote: abort: There is no Mercurial repository here (.hg not found)!
+  abort: no suitable response from remote hg!
+  [255]
+
+clone remote via stream
+
+  $ hg clone -e "python ./dummyssh" --uncompressed ssh://user@dummy/remote local-stream
+  streaming all changes
+  4 files to transfer, 392 bytes of data
+  transferred 392 bytes in * seconds (*B/sec) (glob)
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd local-stream
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 1 changesets, 2 total revisions
+  $ cd ..
+
+clone remote via pull
+
+  $ hg clone -e "python ./dummyssh" ssh://user@dummy/remote local
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+verify
+
+  $ cd local
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 1 changesets, 2 total revisions
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
+
+empty default pull
+
+  $ hg paths
+  default = ssh://user@dummy/remote
+  $ hg pull -e "python ../dummyssh"
+  pulling from ssh://user@dummy/remote
+  searching for changes
+  no changes found
+
+local change
+
+  $ echo bleah > foo
+  $ hg ci -m "add"
+
+updating rc
+
+  $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
+  $ echo "[ui]" >> .hg/hgrc
+  $ echo "ssh = python ../dummyssh" >> .hg/hgrc
+
+find outgoing
+
+  $ hg out ssh://user@dummy/remote
+  comparing with ssh://user@dummy/remote
+  searching for changes
+  changeset:   1:a28a9d1a809c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add
+  
+
+find incoming on the remote side
+
+  $ hg incoming -R ../remote -e "python ../dummyssh" ssh://user@dummy/local
+  comparing with ssh://user@dummy/local
+  searching for changes
+  changeset:   1:a28a9d1a809c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add
+  
+
+find incoming on the remote side (using absolute path)
+
+  $ hg incoming -R ../remote -e "python ../dummyssh" "ssh://user@dummy/`pwd`"
+  comparing with ssh://user@dummy/*/test-ssh.t/local (glob)
+  searching for changes
+  changeset:   1:a28a9d1a809c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add
+  
+
+push
+
+  $ hg push
+  pushing to ssh://user@dummy/remote
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  $ cd ../remote
+
+check remote tip
+
+  $ hg tip
+  changeset:   1:a28a9d1a809c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add
+  
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 3 total revisions
+  $ hg cat -r tip foo
+  bleah
+  $ echo z > z
+  $ hg ci -A -m z z
+  created new head
+
+a bad, evil hook that prints to stdout
+
+  $ echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
+  $ cd ../local
+  $ echo r > r
+  $ hg ci -A -m z r
+
+push should succeed even though it has an unexpected response
+
+  $ hg push
+  pushing to ssh://user@dummy/remote
+  searching for changes
+  note: unsynced remote changes!
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 1 changesets with 1 changes to 1 files
+  remote: KABOOM
+  $ hg -R ../remote heads
+  changeset:   3:1383141674ec
+  tag:         tip
+  parent:      1:a28a9d1a809c
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     z
+  
+  changeset:   2:6c0482d977a3
+  parent:      0:1160648e36ce
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     z
+  
+  $ cd ..
+  $ cat dummylog
+  Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
+  Got arguments 1:user@dummy 2:hg -R */nonexistent serve --stdio (glob)
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  Got arguments 1:user@dummy 2:hg -R local serve --stdio
+  Got arguments 1:user@dummy 2:hg -R /*/test-ssh.t/local serve --stdio (glob)
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
+  Got arguments 1:user@dummy 2:hg -R remote serve --stdio
+  changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1 
--- a/tests/test-static-http	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-cp "$TESTDIR"/printenv.py .
-
-hg clone http://localhost:$HGPORT/ copy
-echo $?
-test -d copy || echo copy: No such file or directory
-
-# This server doesn't do range requests so it's basically only good for
-# one pull
-cat > dumb.py <<EOF
-import BaseHTTPServer, SimpleHTTPServer, os, signal
-
-def run(server_class=BaseHTTPServer.HTTPServer,
-        handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
-    server_address = ('localhost', int(os.environ['HGPORT']))
-    httpd = server_class(server_address, handler_class)
-    httpd.serve_forever()
-
-signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
-run()
-EOF
-
-python dumb.py 2>/dev/null &
-echo $! >> $DAEMON_PIDS
-
-mkdir remote
-cd remote
-hg init
-echo foo > bar
-hg add bar
-hg commit -m"test"
-hg tip
-
-cd ..
-
-hg clone static-http://localhost:$HGPORT/remote local | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-cd local
-hg verify
-cat bar
-
-cd ../remote
-echo baz > quux
-hg commit -A -mtest2
-# check for HTTP opener failures when cachefile does not exist
-rm .hg/*.cache
-
-cd ../local
-echo '[hooks]' >> .hg/hgrc
-echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo '% trying to push'
-hg update
-echo more foo >> bar
-hg commit -m"test"
-hg push | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo '% trying clone -r'
-cd ..
-hg clone -r donotexist static-http://localhost:$HGPORT/remote local0 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-hg clone -r 0 static-http://localhost:$HGPORT/remote local0 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo '% test with "/" URI (issue 747)'
-hg init
-echo a > a
-hg add a
-hg ci -ma
-
-hg clone static-http://localhost:$HGPORT/ local2 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-cd local2
-hg verify
-cat a
-hg paths | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo '% test with empty repo (issue965)'
-cd ..
-hg init remotempty
-
-hg clone static-http://localhost:$HGPORT/remotempty local3 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-cd local3
-hg verify
-hg paths | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-echo '% test with non-repo'
-cd ..
-mkdir notarepo
-hg clone static-http://localhost:$HGPORT/notarepo local3 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
-
-kill $!
--- a/tests/test-static-http.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-abort: error: Connection refused
-255
-copy: No such file or directory
-changeset:   0:61c9426e69fe
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     test
-
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-foo
-adding quux
-changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote 
-pulling from static-http://localhost:$HGPORT/remote
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-(run 'hg update' to get a working copy)
-% trying to push
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: cannot lock static-http repository
-pushing to static-http://localhost:$HGPORT/remote
-% trying clone -r
-abort: unknown revision 'donotexist'!
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% test with "/" URI (issue 747)
-requesting all changes
-adding changesets
-adding manifests
-adding file changes
-added 1 changesets with 1 changes to 1 files
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-1 files, 1 changesets, 1 total revisions
-a
-default = static-http://localhost:$HGPORT/
-% test with empty repo (issue965)
-no changes found
-updating to branch default
-0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-0 files, 0 changesets, 0 total revisions
-default = static-http://localhost:$HGPORT/remotempty
-% test with non-repo
-abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-static-http.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,155 @@
+
+  $ cp "$TESTDIR"/printenv.py .
+  $ hg clone http://localhost:$HGPORT/ copy
+  abort: error: Connection refused
+  [255]
+  $ test -d copy
+  [1]
+
+This server doesn't do range requests so it's basically only good for
+one pull
+
+  $ cat > dumb.py <<EOF
+  > import BaseHTTPServer, SimpleHTTPServer, os, signal
+  > 
+  > def run(server_class=BaseHTTPServer.HTTPServer,
+  >         handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
+  >     server_address = ('localhost', int(os.environ['HGPORT']))
+  >     httpd = server_class(server_address, handler_class)
+  >     httpd.serve_forever()
+  > 
+  > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
+  > run()
+  > EOF
+  $ python dumb.py 2>/dev/null &
+  $ echo $! >> $DAEMON_PIDS
+  $ mkdir remote
+  $ cd remote
+  $ hg init
+  $ echo foo > bar
+  $ hg add bar
+  $ hg commit -m"test"
+  $ hg tip
+  changeset:   0:61c9426e69fe
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     test
+  
+  $ cd ..
+  $ hg clone static-http://localhost:$HGPORT/remote local
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd local
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  $ cat bar
+  foo
+  $ cd ../remote
+  $ echo baz > quux
+  $ hg commit -A -mtest2
+  adding quux
+
+check for HTTP opener failures when cachefile does not exist
+
+  $ rm .hg/*.cache
+  $ cd ../local
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
+  $ hg pull
+  changegroup hook: HG_NODE=822d6e31f08b9d6e3b898ce5e52efc0a4bf4905a HG_SOURCE=pull HG_URL=http://localhost:*/remote  (glob)
+  pulling from static-http://localhost:*/remote (glob)
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  (run 'hg update' to get a working copy)
+
+trying to push
+
+  $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo more foo >> bar
+  $ hg commit -m"test"
+  $ hg push
+  pushing to static-http://localhost:*/remote (glob)
+  abort: cannot lock static-http repository
+  [255]
+
+trying clone -r
+
+  $ cd ..
+  $ hg clone -r donotexist static-http://localhost:$HGPORT/remote local0
+  abort: unknown revision 'donotexist'!
+  [255]
+  $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+test with "/" URI (issue 747)
+
+  $ hg init
+  $ echo a > a
+  $ hg add a
+  $ hg ci -ma
+  $ hg clone static-http://localhost:$HGPORT/ local2
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd local2
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  $ cat a
+  a
+  $ hg paths
+  default = static-http://localhost:*/ (glob)
+
+test with empty repo (issue965)
+
+  $ cd ..
+  $ hg init remotempty
+  $ hg clone static-http://localhost:$HGPORT/remotempty local3
+  no changes found
+  updating to branch default
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd local3
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  0 files, 0 changesets, 0 total revisions
+  $ hg paths
+  default = static-http://localhost:*/remotempty (glob)
+
+test with non-repo
+
+  $ cd ..
+  $ mkdir notarepo
+  $ hg clone static-http://localhost:$HGPORT/notarepo local3
+  abort: 'http://localhost:*/notarepo' does not appear to be an hg repository! (glob)
+  [255]
+  $ kill $!
--- a/tests/test-strip-cross	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-# test stripping of filelogs where the linkrev doesn't always increase
-
-. $TESTDIR/helpers.sh
-echo '[extensions]' >> $HGRCPATH
-echo 'hgext.mq =' >> $HGRCPATH
-
-hg init orig
-cd orig
-
-commit()
-{
-    hg up -qC null
-    count=1
-    for i in "$@"; do
-	for f in $i; do
-	    echo $count > $f
-	done
-	count=`expr $count + 1`
-    done
-    hg commit -qAm "$*"
-}
-
-# 2 1 0 2 0 1 2
-commit '201 210'
-
-commit '102 120' '210'
-
-commit '021'
-
-commit '201' '021 120'
-
-commit '012 021' '102 201' '120 210'
-
-commit 'manifest-file'
-
-commit '102 120' '012 210' '021 201'
-
-commit '201 210' '021 120' '012 102'
-
-HGUSER=another-user; export HGUSER
-commit 'manifest-file'
-
-commit '012' 'manifest-file'
-
-cd ..
-hg clone -q -U -r -1 -r -2 -r -3 -r -4 -r -6 orig crossed
-
-for i in crossed/.hg/store/00manifest.i crossed/.hg/store/data/*.i; do
-    echo $i
-    hg debugindex $i
-    echo
-done
-
-for i in 0 1 2 3 4; do
-    hg clone -q -U --pull crossed $i
-    echo "% Trying to strip revision $i"
-    hg --cwd $i strip $i | hidebackup
-    echo "% Verifying"
-    hg --cwd $i verify
-    echo
-done
-
--- a/tests/test-strip-cross.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-crossed/.hg/store/00manifest.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0     112      0       0 6f105cbb914d 000000000000 000000000000
-     1       112      56      1       3 1b55917b3699 000000000000 000000000000
-     2       168     123      1       1 8f3d04e263e5 000000000000 000000000000
-     3       291     122      1       2 f0ef8726ac4f 000000000000 000000000000
-     4       413      87      4       4 0b76e38b4070 000000000000 000000000000
-
-crossed/.hg/store/data/012.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       3      1       1 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       2 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/021.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       0 b8e02f643373 000000000000 000000000000
-     1         3       3      1       2 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       1 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/102.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       1 b8e02f643373 000000000000 000000000000
-     1         3       3      1       0 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       2 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/120.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       1 b8e02f643373 000000000000 000000000000
-     1         3       3      1       2 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       0 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/201.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       2 b8e02f643373 000000000000 000000000000
-     1         3       3      1       0 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       1 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/210.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       2 b8e02f643373 000000000000 000000000000
-     1         3       3      1       1 5d9299349fc0 000000000000 000000000000
-     2         6       3      2       0 2661d26c6496 000000000000 000000000000
-
-crossed/.hg/store/data/manifest-file.i
-   rev    offset  length   base linkrev nodeid       p1           p2
-     0         0       3      0       3 b8e02f643373 000000000000 000000000000
-     1         3       3      1       4 5d9299349fc0 000000000000 000000000000
-
-% Trying to strip revision 0
-saved backup bundle to 
-% Verifying
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-7 files, 4 changesets, 15 total revisions
-
-% Trying to strip revision 1
-saved backup bundle to 
-% Verifying
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-7 files, 4 changesets, 14 total revisions
-
-% Trying to strip revision 2
-saved backup bundle to 
-% Verifying
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-7 files, 4 changesets, 14 total revisions
-
-% Trying to strip revision 3
-saved backup bundle to 
-% Verifying
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-7 files, 4 changesets, 19 total revisions
-
-% Trying to strip revision 4
-saved backup bundle to 
-% Verifying
-checking changesets
-checking manifests
-crosschecking files in changesets and manifests
-checking files
-7 files, 4 changesets, 19 total revisions
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-strip-cross.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,142 @@
+test stripping of filelogs where the linkrev doesn't always increase
+
+  $ . $TESTDIR/helpers.sh
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'hgext.mq =' >> $HGRCPATH
+  $ hg init orig
+  $ cd orig
+  $ commit()
+  > {
+  >     hg up -qC null
+  >     count=1
+  >     for i in "$@"; do
+  >         for f in $i; do
+  >             echo $count > $f
+  >         done
+  >         count=`expr $count + 1`
+  >     done
+  >     hg commit -qAm "$*"
+  > }
+
+2 1 0 2 0 1 2
+
+  $ commit '201 210'
+  $ commit '102 120' '210'
+  $ commit '021'
+  $ commit '201' '021 120'
+  $ commit '012 021' '102 201' '120 210'
+  $ commit 'manifest-file'
+  $ commit '102 120' '012 210' '021 201'
+  $ commit '201 210' '021 120' '012 102'
+  $ HGUSER=another-user; export HGUSER
+  $ commit 'manifest-file'
+  $ commit '012' 'manifest-file'
+  $ cd ..
+  $ hg clone -q -U -r -1 -r -2 -r -3 -r -4 -r -6 orig crossed
+  $ for i in crossed/.hg/store/00manifest.i crossed/.hg/store/data/*.i; do
+  >     echo $i
+  >     hg debugindex $i
+  >     echo
+  > done
+  crossed/.hg/store/00manifest.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0     112      0       0 6f105cbb914d 000000000000 000000000000
+       1       112      56      1       3 1b55917b3699 000000000000 000000000000
+       2       168     123      1       1 8f3d04e263e5 000000000000 000000000000
+       3       291     122      1       2 f0ef8726ac4f 000000000000 000000000000
+       4       413      87      4       4 0b76e38b4070 000000000000 000000000000
+  
+  crossed/.hg/store/data/012.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       3      1       1 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       2 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/021.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       0 b8e02f643373 000000000000 000000000000
+       1         3       3      1       2 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       1 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/102.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       1 b8e02f643373 000000000000 000000000000
+       1         3       3      1       0 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       2 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/120.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       1 b8e02f643373 000000000000 000000000000
+       1         3       3      1       2 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       0 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/201.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       2 b8e02f643373 000000000000 000000000000
+       1         3       3      1       0 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       1 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/210.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       2 b8e02f643373 000000000000 000000000000
+       1         3       3      1       1 5d9299349fc0 000000000000 000000000000
+       2         6       3      2       0 2661d26c6496 000000000000 000000000000
+  
+  crossed/.hg/store/data/manifest-file.i
+     rev    offset  length   base linkrev nodeid       p1           p2
+       0         0       3      0       3 b8e02f643373 000000000000 000000000000
+       1         3       3      1       4 5d9299349fc0 000000000000 000000000000
+  
+  $ for i in 0 1 2 3 4; do
+  >     hg clone -q -U --pull crossed $i
+  >     echo "% Trying to strip revision $i"
+  >     hg --cwd $i strip $i | hidebackup
+  >     echo "% Verifying"
+  >     hg --cwd $i verify
+  >     echo
+  > done
+  % Trying to strip revision 0
+  saved backup bundle to 
+  % Verifying
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 4 changesets, 15 total revisions
+  
+  % Trying to strip revision 1
+  saved backup bundle to 
+  % Verifying
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 4 changesets, 14 total revisions
+  
+  % Trying to strip revision 2
+  saved backup bundle to 
+  % Verifying
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 4 changesets, 14 total revisions
+  
+  % Trying to strip revision 3
+  saved backup bundle to 
+  % Verifying
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 4 changesets, 19 total revisions
+  
+  % Trying to strip revision 4
+  saved backup bundle to 
+  % Verifying
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 4 changesets, 19 total revisions
+  
--- a/tests/test-subrepo-recursion.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-subrepo-recursion.t	Mon Sep 27 10:47:36 2010 -0500
@@ -350,4 +350,4 @@
 
   $ rm -r foo
   $ hg status
-  warning: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98' in foo
+  warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
--- a/tests/test-subrepo-svn.t	Fri Sep 24 19:47:50 2010 -0300
+++ b/tests/test-subrepo-svn.t	Mon Sep 27 10:47:36 2010 -0500
@@ -9,7 +9,7 @@
 don't. Handle that.
 
   $ escapedwd=`pwd | fix_path`
-  $ expr "$escapedwd" : / > /dev/null || escapedwd="/$escapedwd"
+  $ expr "$escapedwd" : '\/' > /dev/null || escapedwd="/$escapedwd"
   $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
 
 create subversion repo
--- a/tests/test-template-engine	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-cat > engine.py << EOF
-
-from mercurial import templater
-
-class mytemplater(object):
-    def __init__(self, loader, filters, defaults):
-        self.loader = loader
-
-    def process(self, t, map):
-        tmpl = self.loader(t)
-        for k, v in map.iteritems():
-            if k in ('templ', 'ctx', 'repo', 'revcache', 'cache'):
-                continue
-            if hasattr(v, '__call__'):
-                v = v(**map)
-            v = templater.stringify(v)
-            tmpl = tmpl.replace('{{%s}}' % k, v)
-        yield tmpl
-
-templater.engines['my'] = mytemplater
-EOF
-
-hg init test
-echo '[extensions]' > test/.hg/hgrc
-echo "engine = `pwd`/engine.py" >> test/.hg/hgrc
-
-cd test
-cat > mymap << EOF
-changeset = my:changeset.txt
-EOF
-
-cat > changeset.txt << EOF
-{{rev}} {{node}} {{author}}
-EOF
-
-hg ci -Ama
-hg log --style=./mymap
--- a/tests/test-template-engine.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-adding changeset.txt
-adding mymap
-0 97e5f848f0936960273bbf75be6388cd0350a32b test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-template-engine.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,37 @@
+
+  $ cat > engine.py << EOF
+  > 
+  > from mercurial import templater
+  > 
+  > class mytemplater(object):
+  >     def __init__(self, loader, filters, defaults):
+  >         self.loader = loader
+  > 
+  >     def process(self, t, map):
+  >         tmpl = self.loader(t)
+  >         for k, v in map.iteritems():
+  >             if k in ('templ', 'ctx', 'repo', 'revcache', 'cache'):
+  >                 continue
+  >             if hasattr(v, '__call__'):
+  >                 v = v(**map)
+  >             v = templater.stringify(v)
+  >             tmpl = tmpl.replace('{{%s}}' % k, v)
+  >         yield tmpl
+  > 
+  > templater.engines['my'] = mytemplater
+  > EOF
+  $ hg init test
+  $ echo '[extensions]' > test/.hg/hgrc
+  $ echo "engine = `pwd`/engine.py" >> test/.hg/hgrc
+  $ cd test
+  $ cat > mymap << EOF
+  > changeset = my:changeset.txt
+  > EOF
+  $ cat > changeset.txt << EOF
+  > {{rev}} {{node}} {{author}}
+  > EOF
+  $ hg ci -Ama
+  adding changeset.txt
+  adding mymap
+  $ hg log --style=./mymap
+  0 97e5f848f0936960273bbf75be6388cd0350a32b test
--- a/tests/test-win32text	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-#!/bin/sh
-
-hg init t
-cd t
-
-cat > unix2dos.py <<EOF
-import sys
-
-for path in sys.argv[1:]:
-    data = file(path, 'rb').read()
-    data = data.replace('\n', '\r\n')
-    file(path, 'wb').write(data)
-EOF
-
-cat > print.py <<EOF
-import sys
-print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
-EOF
-
-echo '[hooks]' >> .hg/hgrc
-echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
-echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
-cat .hg/hgrc
-echo
-
-echo hello > f
-hg add f
-echo commit should succeed
-hg ci -m 1
-echo
-
-hg clone . ../zoz
-cp .hg/hgrc ../zoz/.hg
-
-python unix2dos.py f
-echo commit should fail
-hg ci -m 2.1
-echo
-
-mv .hg/hgrc .hg/hgrc.bak
-echo commits should succeed
-hg ci -m 2
-hg cp f g
-hg ci -m 2.2
-echo
-
-echo push should fail
-hg push ../zoz
-echo
-
-mv .hg/hgrc.bak .hg/hgrc
-echo hello > f
-hg rm g
-echo commit should succeed
-hg ci -m 2.3
-echo
-
-echo push should succeed
-hg push ../zoz
-echo
-
-echo and now for something completely different
-mkdir d
-echo hello > d/f2
-python unix2dos.py d/f2
-hg add d/f2
-hg ci -m 3
-hg revert -a
-rm d/f2
-echo
-
-hg rem f
-hg ci -m 4
-echo
-
-python -c 'file("bin", "wb").write("hello\x00\x0D\x0A")'
-hg add bin
-hg ci -m 5
-hg log -v
-echo
-
-hg clone . dupe
-echo
-for x in a b c d; do echo content > dupe/$x; done
-hg -R dupe add
-python unix2dos.py dupe/b dupe/c dupe/d
-hg -R dupe ci -m a dupe/a
-hg -R dupe ci -m b/c dupe/[bc]
-hg -R dupe ci -m d dupe/d
-hg -R dupe log -v
-echo
-
-hg pull dupe
-echo
-
-hg log -v
-echo
-
-rm .hg/hgrc
-(echo some; echo text) > f3
-python -c 'file("f4.bat", "wb").write("rem empty\x0D\x0A")'
-hg add f3 f4.bat
-hg ci -m 6
-
-python print.py < bin
-python print.py < f3
-python print.py < f4.bat
-echo
-
-echo '[extensions]' >> .hg/hgrc
-echo 'win32text = ' >> .hg/hgrc
-echo '[decode]' >> .hg/hgrc
-echo '** = cleverdecode:' >> .hg/hgrc
-echo '[encode]' >> .hg/hgrc
-echo '** = cleverencode:' >> .hg/hgrc
-cat .hg/hgrc
-echo
-
-rm f3 f4.bat bin
-hg co -C 2>&1 | python -c 'import sys, os; sys.stdout.write(sys.stdin.read().replace(os.getcwd(), "...."))'
-python print.py < bin
-python print.py < f3
-python print.py < f4.bat
-echo
-
-python -c 'file("f5.sh", "wb").write("# empty\x0D\x0A")'
-hg add f5.sh
-hg ci -m 7
-python print.py < f5.sh
-hg cat f5.sh | python print.py
-
-echo '% just linefeed' > linefeed
-hg ci -qAm 8 linefeed
-python print.py < linefeed
-hg cat linefeed | python print.py
-hg st -q
-hg revert -a linefeed
-python print.py < linefeed
-hg st -q
-echo modified >> linefeed
-hg st -q
-hg revert -a
-hg st -q
-python print.py < linefeed
--- a/tests/test-win32text.out	Fri Sep 24 19:47:50 2010 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,304 +0,0 @@
-[hooks]
-pretxncommit.crlf = python:hgext.win32text.forbidcrlf
-pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
-
-commit should succeed
-
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-commit should fail
-Attempt to commit or push text file(s) using CRLF line endings
-in f583ea08d42a: f
-transaction abort!
-rollback completed
-abort: pretxncommit.crlf hook failed
-
-commits should succeed
-
-push should fail
-pushing to ../zoz
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 2 changes to 2 files
-Attempt to commit or push text file(s) using CRLF line endings
-in bc2d09796734: g
-in b1aa5cde7ff4: f
-
-To prevent this mistake in your local repository,
-add to Mercurial.ini or .hg/hgrc:
-
-[hooks]
-pretxncommit.crlf = python:hgext.win32text.forbidcrlf
-
-and also consider adding:
-
-[extensions]
-win32text =
-[encode]
-** = cleverencode:
-[decode]
-** = cleverdecode:
-transaction abort!
-rollback completed
-abort: pretxnchangegroup.crlf hook failed
-
-commit should succeed
-
-push should succeed
-pushing to ../zoz
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 3 changes to 2 files
-
-and now for something completely different
-Attempt to commit or push text file(s) using CRLF line endings
-in 053ba1a3035a: d/f2
-transaction abort!
-rollback completed
-abort: pretxncommit.crlf hook failed
-forgetting d/f2
-
-
-changeset:   5:f0b1c8d75fce
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       bin
-description:
-5
-
-
-changeset:   4:77796dbcd4ad
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-4
-
-
-changeset:   3:7c1b5430b350
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f g
-description:
-2.3
-
-
-changeset:   2:bc2d09796734
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       g
-description:
-2.2
-
-
-changeset:   1:b1aa5cde7ff4
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-2
-
-
-changeset:   0:fcf06d5c4e1d
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-1
-
-
-
-updating to branch default
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-
-adding dupe/a
-adding dupe/b
-adding dupe/c
-adding dupe/d
-changeset:   8:67ac5962ab43
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       d
-description:
-d
-
-
-changeset:   7:68c127d1834e
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       b c
-description:
-b/c
-
-
-changeset:   6:adbf8bf7f31d
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       a
-description:
-a
-
-
-changeset:   5:f0b1c8d75fce
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       bin
-description:
-5
-
-
-changeset:   4:77796dbcd4ad
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-4
-
-
-changeset:   3:7c1b5430b350
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f g
-description:
-2.3
-
-
-changeset:   2:bc2d09796734
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       g
-description:
-2.2
-
-
-changeset:   1:b1aa5cde7ff4
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-2
-
-
-changeset:   0:fcf06d5c4e1d
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-1
-
-
-
-pulling from dupe
-searching for changes
-adding changesets
-adding manifests
-adding file changes
-added 3 changesets with 4 changes to 4 files
-Attempt to commit or push text file(s) using CRLF line endings
-in 67ac5962ab43: d
-in 68c127d1834e: b
-in 68c127d1834e: c
-
-To prevent this mistake in your local repository,
-add to Mercurial.ini or .hg/hgrc:
-
-[hooks]
-pretxncommit.crlf = python:hgext.win32text.forbidcrlf
-
-and also consider adding:
-
-[extensions]
-win32text =
-[encode]
-** = cleverencode:
-[decode]
-** = cleverdecode:
-transaction abort!
-rollback completed
-abort: pretxnchangegroup.crlf hook failed
-
-changeset:   5:f0b1c8d75fce
-tag:         tip
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       bin
-description:
-5
-
-
-changeset:   4:77796dbcd4ad
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-4
-
-
-changeset:   3:7c1b5430b350
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f g
-description:
-2.3
-
-
-changeset:   2:bc2d09796734
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       g
-description:
-2.2
-
-
-changeset:   1:b1aa5cde7ff4
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-2
-
-
-changeset:   0:fcf06d5c4e1d
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-files:       f
-description:
-1
-
-
-
-hello<NUL><CR><LF>
-some<LF>text<LF>
-rem empty<CR><LF>
-
-[extensions]
-win32text = 
-[decode]
-** = cleverdecode:
-[encode]
-** = cleverencode:
-
-WARNING: f4.bat already has CRLF line endings
-and does not need EOL conversion by the win32text plugin.
-Before your next commit, please reconsider your encode/decode settings in 
-Mercurial.ini or ..../.hg/hgrc.
-3 files updated, 0 files merged, 0 files removed, 0 files unresolved
-hello<NUL><CR><LF>
-some<CR><LF>text<CR><LF>
-rem empty<CR><LF>
-
-# empty<CR><LF>
-# empty<LF>
-% just linefeed<LF>
-% just linefeed<LF>
-no changes needed to linefeed
-% just linefeed<LF>
-M linefeed
-reverting linefeed
-% just linefeed<CR><LF>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-win32text.t	Mon Sep 27 10:47:36 2010 -0500
@@ -0,0 +1,436 @@
+
+  $ hg init t
+  $ cd t
+  $ cat > unix2dos.py <<EOF
+  > import sys
+  > 
+  > for path in sys.argv[1:]:
+  >     data = file(path, 'rb').read()
+  >     data = data.replace('\n', '\r\n')
+  >     file(path, 'wb').write(data)
+  > EOF
+  $ cat > print.py <<EOF
+  > import sys
+  > print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
+  > EOF
+  $ echo '[hooks]' >> .hg/hgrc
+  $ echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
+  $ echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
+  $ cat .hg/hgrc
+  [hooks]
+  pretxncommit.crlf = python:hgext.win32text.forbidcrlf
+  pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
+  $ echo
+  
+  $ echo hello > f
+  $ hg add f
+
+commit should succeed
+
+  $ hg ci -m 1
+  $ echo
+  
+  $ hg clone . ../zoz
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cp .hg/hgrc ../zoz/.hg
+  $ python unix2dos.py f
+
+commit should fail
+
+  $ hg ci -m 2.1
+  Attempt to commit or push text file(s) using CRLF line endings
+  in f583ea08d42a: f
+  transaction abort!
+  rollback completed
+  abort: pretxncommit.crlf hook failed
+  [255]
+  $ echo
+  
+  $ mv .hg/hgrc .hg/hgrc.bak
+
+commits should succeed
+
+  $ hg ci -m 2
+  $ hg cp f g
+  $ hg ci -m 2.2
+  $ echo
+  
+
+push should fail
+
+  $ hg push ../zoz
+  pushing to ../zoz
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  Attempt to commit or push text file(s) using CRLF line endings
+  in bc2d09796734: g
+  in b1aa5cde7ff4: f
+  
+  To prevent this mistake in your local repository,
+  add to Mercurial.ini or .hg/hgrc:
+  
+  [hooks]
+  pretxncommit.crlf = python:hgext.win32text.forbidcrlf
+  
+  and also consider adding:
+  
+  [extensions]
+  win32text =
+  [encode]
+  ** = cleverencode:
+  [decode]
+  ** = cleverdecode:
+  transaction abort!
+  rollback completed
+  abort: pretxnchangegroup.crlf hook failed
+  [255]
+  $ echo
+  
+  $ mv .hg/hgrc.bak .hg/hgrc
+  $ echo hello > f
+  $ hg rm g
+
+commit should succeed
+
+  $ hg ci -m 2.3
+  $ echo
+  
+
+push should succeed
+
+  $ hg push ../zoz
+  pushing to ../zoz
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 3 changes to 2 files
+  $ echo
+  
+
+and now for something completely different
+
+  $ mkdir d
+  $ echo hello > d/f2
+  $ python unix2dos.py d/f2
+  $ hg add d/f2
+  $ hg ci -m 3
+  Attempt to commit or push text file(s) using CRLF line endings
+  in 053ba1a3035a: d/f2
+  transaction abort!
+  rollback completed
+  abort: pretxncommit.crlf hook failed
+  [255]
+  $ hg revert -a
+  forgetting d/f2
+  $ rm d/f2
+  $ echo
+  
+  $ hg rem f
+  $ hg ci -m 4
+  $ echo
+  
+  $ python -c 'file("bin", "wb").write("hello\x00\x0D\x0A")'
+  $ hg add bin
+  $ hg ci -m 5
+  $ hg log -v
+  changeset:   5:f0b1c8d75fce
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       bin
+  description:
+  5
+  
+  
+  changeset:   4:77796dbcd4ad
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  4
+  
+  
+  changeset:   3:7c1b5430b350
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f g
+  description:
+  2.3
+  
+  
+  changeset:   2:bc2d09796734
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       g
+  description:
+  2.2
+  
+  
+  changeset:   1:b1aa5cde7ff4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  2
+  
+  
+  changeset:   0:fcf06d5c4e1d
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  1
+  
+  
+  $ echo
+  
+  $ hg clone . dupe
+  updating to branch default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo
+  
+  $ for x in a b c d; do echo content > dupe/$x; done
+  $ hg -R dupe add
+  adding dupe/a
+  adding dupe/b
+  adding dupe/c
+  adding dupe/d
+  $ python unix2dos.py dupe/b dupe/c dupe/d
+  $ hg -R dupe ci -m a dupe/a
+  $ hg -R dupe ci -m b/c dupe/[bc]
+  $ hg -R dupe ci -m d dupe/d
+  $ hg -R dupe log -v
+  changeset:   8:67ac5962ab43
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       d
+  description:
+  d
+  
+  
+  changeset:   7:68c127d1834e
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       b c
+  description:
+  b/c
+  
+  
+  changeset:   6:adbf8bf7f31d
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       a
+  description:
+  a
+  
+  
+  changeset:   5:f0b1c8d75fce
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       bin
+  description:
+  5
+  
+  
+  changeset:   4:77796dbcd4ad
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  4
+  
+  
+  changeset:   3:7c1b5430b350
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f g
+  description:
+  2.3
+  
+  
+  changeset:   2:bc2d09796734
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       g
+  description:
+  2.2
+  
+  
+  changeset:   1:b1aa5cde7ff4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  2
+  
+  
+  changeset:   0:fcf06d5c4e1d
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  1
+  
+  
+  $ echo
+  
+  $ hg pull dupe
+  pulling from dupe
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 4 changes to 4 files
+  Attempt to commit or push text file(s) using CRLF line endings
+  in 67ac5962ab43: d
+  in 68c127d1834e: b
+  in 68c127d1834e: c
+  
+  To prevent this mistake in your local repository,
+  add to Mercurial.ini or .hg/hgrc:
+  
+  [hooks]
+  pretxncommit.crlf = python:hgext.win32text.forbidcrlf
+  
+  and also consider adding:
+  
+  [extensions]
+  win32text =
+  [encode]
+  ** = cleverencode:
+  [decode]
+  ** = cleverdecode:
+  transaction abort!
+  rollback completed
+  abort: pretxnchangegroup.crlf hook failed
+  [255]
+  $ echo
+  
+  $ hg log -v
+  changeset:   5:f0b1c8d75fce
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       bin
+  description:
+  5
+  
+  
+  changeset:   4:77796dbcd4ad
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  4
+  
+  
+  changeset:   3:7c1b5430b350
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f g
+  description:
+  2.3
+  
+  
+  changeset:   2:bc2d09796734
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       g
+  description:
+  2.2
+  
+  
+  changeset:   1:b1aa5cde7ff4
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  2
+  
+  
+  changeset:   0:fcf06d5c4e1d
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       f
+  description:
+  1
+  
+  
+  $ echo
+  
+  $ rm .hg/hgrc
+  $ (echo some; echo text) > f3
+  $ python -c 'file("f4.bat", "wb").write("rem empty\x0D\x0A")'
+  $ hg add f3 f4.bat
+  $ hg ci -m 6
+  $ python print.py < bin
+  hello<NUL><CR><LF>
+  $ python print.py < f3
+  some<LF>text<LF>
+  $ python print.py < f4.bat
+  rem empty<CR><LF>
+  $ echo
+  
+  $ echo '[extensions]' >> .hg/hgrc
+  $ echo 'win32text = ' >> .hg/hgrc
+  $ echo '[decode]' >> .hg/hgrc
+  $ echo '** = cleverdecode:' >> .hg/hgrc
+  $ echo '[encode]' >> .hg/hgrc
+  $ echo '** = cleverencode:' >> .hg/hgrc
+  $ cat .hg/hgrc
+  [extensions]
+  win32text = 
+  [decode]
+  ** = cleverdecode:
+  [encode]
+  ** = cleverencode:
+  $ echo
+  
+  $ rm f3 f4.bat bin
+  $ hg co -C 2>&1 | python -c 'import sys, os; sys.stdout.write(sys.stdin.read().replace(os.getcwd(), "...."))'
+  WARNING: f4.bat already has CRLF line endings
+  and does not need EOL conversion by the win32text plugin.
+  Before your next commit, please reconsider your encode/decode settings in 
+  Mercurial.ini or ..../.hg/hgrc.
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ python print.py < bin
+  hello<NUL><CR><LF>
+  $ python print.py < f3
+  some<CR><LF>text<CR><LF>
+  $ python print.py < f4.bat
+  rem empty<CR><LF>
+  $ echo
+  
+  $ python -c 'file("f5.sh", "wb").write("# empty\x0D\x0A")'
+  $ hg add f5.sh
+  $ hg ci -m 7
+  $ python print.py < f5.sh
+  # empty<CR><LF>
+  $ hg cat f5.sh | python print.py
+  # empty<LF>
+  $ echo '% just linefeed' > linefeed
+  $ hg ci -qAm 8 linefeed
+  $ python print.py < linefeed
+  % just linefeed<LF>
+  $ hg cat linefeed | python print.py
+  % just linefeed<LF>
+  $ hg st -q
+  $ hg revert -a linefeed
+  no changes needed to linefeed
+  $ python print.py < linefeed
+  % just linefeed<LF>
+  $ hg st -q
+  $ echo modified >> linefeed
+  $ hg st -q
+  M linefeed
+  $ hg revert -a
+  reverting linefeed
+  $ hg st -q
+  $ python print.py < linefeed
+  % just linefeed<CR><LF>