merge with i18n stable 4.2
authorKevin Bullock <kbullock+mercurial@ringworld.org>
Tue, 02 May 2017 16:35:12 -0500
branchstable
changeset 32107 bb96d4a49743
parent 32105 2384a6546927 (diff)
parent 32106 1527b3890674 (current diff)
child 32108 b9cd7967225f
merge with i18n
--- a/.hgignore	Mon May 01 07:23:29 2017 +0900
+++ b/.hgignore	Tue May 02 16:35:12 2017 -0500
@@ -62,6 +62,9 @@
 mercurial/osutil.py
 mercurial/parsers.py
 
+# Generated wheels
+wheelhouse/
+
 syntax: regexp
 ^\.pc/
 ^\.(pydev)?project
--- a/Makefile	Mon May 01 07:23:29 2017 +0900
+++ b/Makefile	Tue May 02 16:35:12 2017 -0500
@@ -270,6 +270,14 @@
 	mkdir -p packages/centos7
 	contrib/dockerrpm centos7
 
+linux-wheels: linux-wheels-x86_64 linux-wheels-i686
+
+linux-wheels-x86_64:
+	docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/build-linux-wheels.sh
+
+linux-wheels-i686:
+	docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/build-linux-wheels.sh
+
 .PHONY: help all local build doc cleanbutpackages clean install install-bin \
 	install-doc install-home install-home-bin install-home-doc \
 	dist dist-notests check tests check-code update-pot \
@@ -278,4 +286,5 @@
 	docker-ubuntu-xenial docker-ubuntu-xenial-ppa \
 	docker-ubuntu-yakkety docker-ubuntu-yakkety-ppa \
 	fedora20 docker-fedora20 fedora21 docker-fedora21 \
-	centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
+	centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7 \
+	linux-wheels
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/build-linux-wheels.sh	Tue May 02 16:35:12 2017 -0500
@@ -0,0 +1,34 @@
+#!/bin/bash
+# This file is directly inspired by
+# https://github.com/pypa/python-manylinux-demo/blob/master/travis/build-wheels.sh
+set -e -x
+
+PYTHON_TARGETS=$(ls -d /opt/python/cp2*/bin)
+
+# Create an user for the tests
+useradd hgbuilder
+
+# Bypass uid/gid problems
+cp -R /src /io && chown -R hgbuilder:hgbuilder /io
+
+# Compile wheels for Python 2.X
+for PYBIN in $PYTHON_TARGETS; do
+    "${PYBIN}/pip" wheel /io/ -w wheelhouse/
+done
+
+# Bundle external shared libraries into the wheels with
+# auditwheel (https://github.com/pypa/auditwheel) repair.
+# It also fix the ABI tag on the wheel making it pip installable.
+for whl in wheelhouse/*.whl; do
+    auditwheel repair "$whl" -w /src/wheelhouse/
+done
+
+# Install packages and run the tests for all Python versions
+cd /io/tests/
+
+for PYBIN in $PYTHON_TARGETS; do
+    # Install mercurial wheel as root
+    "${PYBIN}/pip" install mercurial --no-index -f /src/wheelhouse
+    # But run tests as hgbuilder user (non-root)
+    su hgbuilder -c "\"${PYBIN}/python\" /io/tests/run-tests.py --with-hg=\"${PYBIN}/hg\" --blacklist=/io/contrib/linux-wheel-centos5-blacklist"
+done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/debian/default-tools.rc	Tue May 02 16:35:12 2017 -0500
@@ -0,0 +1,5 @@
+[ui]
+editor = sensible-editor
+
+[pager]
+pager = sensible-pager
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/linux-wheel-centos5-blacklist	Tue May 02 16:35:12 2017 -0500
@@ -0,0 +1,3 @@
+test-convert-git.t
+test-subrepo-git.t
+test-patchbomb-tls.t
--- a/hgext/rebase.py	Mon May 01 07:23:29 2017 +0900
+++ b/hgext/rebase.py	Tue May 02 16:35:12 2017 -0500
@@ -665,10 +665,10 @@
     Configuration Options:
 
     You can make rebase require a destination if you set the following config
-    option:
+    option::
 
       [commands]
-      rebase.requiredest = False
+      rebase.requiredest = True
 
     Return Values:
 
--- a/mercurial/color.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/color.py	Tue May 02 16:35:12 2017 -0500
@@ -193,7 +193,15 @@
         return 'debug'
 
     auto = (config == 'auto')
-    always = not auto and util.parsebool(config)
+    always = False
+    if not auto and util.parsebool(config):
+        # We want the config to behave like a boolean, "on" is actually auto,
+        # but "always" value is treated as a special case to reduce confusion.
+        if ui.configsource('ui', 'color') == '--color' or config == 'always':
+            always = True
+        else:
+            auto = True
+
     if not always and not auto:
         return None
 
--- a/mercurial/commands.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/commands.py	Tue May 02 16:35:12 2017 -0500
@@ -3334,6 +3334,8 @@
     'o' is a changeset, '@' is a working directory parent, 'x' is obsolete,
     and '+' represents a fork where the changeset from the lines below is a
     parent of the 'o' merge on the same line.
+    Paths in the DAG are represented with '|', '/' and so forth. ':' in place
+    of a '|' indicates one or more revisions in a path are omitted.
 
     .. note::
 
--- a/mercurial/context.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/context.py	Tue May 02 16:35:12 2017 -0500
@@ -1192,6 +1192,9 @@
     `fromline`-`toline` range.
     """
     diffopts = patch.diffopts(fctx._repo.ui)
+    introrev = fctx.introrev()
+    if fctx.rev() != introrev:
+        fctx = fctx.filectx(fctx.filenode(), changeid=introrev)
     visit = {(fctx.linkrev(), fctx.filenode()): (fctx, (fromline, toline))}
     while visit:
         c, linerange2 = visit.pop(max(visit))
@@ -1211,6 +1214,10 @@
                 # introduced in this revision; no need to go futher in this
                 # branch.
                 continue
+            # Set _descendantrev with 'c' (a known descendant) so that, when
+            # _adjustlinkrev is called for 'p', it receives this descendant
+            # (as srcrev) instead possibly topmost introrev.
+            p._descendantrev = c.rev()
             visit[p.linkrev(), p.filenode()] = p, linerange1
         if inrange:
             yield c, linerange2
--- a/mercurial/discovery.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/discovery.py	Tue May 02 16:35:12 2017 -0500
@@ -511,7 +511,7 @@
         for m in markers:
             nexts = m[1] # successors
             if not nexts: # this is a prune marker
-                nexts = m[5] # parents
+                nexts = m[5] or () # parents
             for n in nexts:
                 if n not in seen:
                     seen.add(n)
--- a/mercurial/help.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/help.py	Tue May 02 16:35:12 2017 -0500
@@ -203,7 +203,8 @@
 
 def internalshelp(ui):
     """Generate the index for the "internals" topic."""
-    lines = []
+    lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
+             '\n']
     for names, header, doc in internalstable:
         lines.append(' :%s: %s\n' % (names[0], header))
 
--- a/mercurial/help/color.txt	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/help/color.txt	Tue May 02 16:35:12 2017 -0500
@@ -1,14 +1,21 @@
-Mercurial can colorizes output from several commands.
+Mercurial colorizes output from several commands.
 
 For example, the diff command shows additions in green and deletions
 in red, while the status command shows modified files in magenta. Many
 other commands have analogous colors. It is possible to customize
 these colors.
 
-To enable color use::
+To enable color (default) whenever possible use::
 
   [ui]
-  color = auto
+  color = yes
+
+To disable color use::
+
+  [ui]
+  color = no
+
+See :hg:`help config.ui.color` for details.
 
 Mode
 ====
@@ -119,7 +126,7 @@
 Custom colors
 =============
 
-Because there are only eight standard colors, this module allows you
+Because there are only eight standard colors, Mercurial allows you
 to define color names for other color slots which might be available
 for your terminal type, assuming terminfo mode.  For instance::
 
--- a/mercurial/help/config.txt	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/help/config.txt	Tue May 02 16:35:12 2017 -0500
@@ -414,16 +414,15 @@
 
 ``mode``
     String: control the method used to output color. One of ``auto``, ``ansi``,
-    ``win32``, ``terminfo`` or ``debug``. In auto mode the color extension will
+    ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
     use ANSI mode by default (or win32 mode on Windows) if it detects a
     terminal. Any invalid value will disable color.
 
 ``pagermode``
-    String: optinal override of ``color.mode`` used with pager (from the pager
-    extensions).
+    String: optinal override of ``color.mode`` used with pager.
 
     On some systems, terminfo mode may cause problems when using
-    color with the pager extension and less -R. less with the -R option
+    color with ``less -R`` as a pager program. less with the -R option
     will only display ECMA-48 color codes, and terminfo mode may sometimes
     emit codes that less doesn't understand. You can work around this by
     either using ansi mode (or auto mode), or by using less -r (which will
@@ -431,19 +430,18 @@
     codes).
 
     On some systems (such as MSYS in Windows), the terminal may support
-    a different color mode than the pager (activated via the "pager"
-    extension).
+    a different color mode than the pager program.
 
 ``commands``
 ------------
 
 ``status.relative``
-    Make paths in ``hg status`` output relative to the current directory.
+    Make paths in :hg:`status` output relative to the current directory.
     (default: False)
 
 ``update.requiredest``
-    Require that the user pass a destination when running ``hg update``.
-    For example, ``hg update .::`` will be allowed, but a plain ``hg update``
+    Require that the user pass a destination when running :hg:`update`.
+    For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
     will be disallowed.
     (default: False)
 
@@ -1363,6 +1361,27 @@
     the executable name of the tool.
     (default: None)
 
+``pager``
+---------
+
+Setting used to control when to paginate and with what external tool. See
+:hg:`help pager` for details.
+
+``pager``
+    Define the external tool used as pager.
+
+    If no pager is set, Mercurial uses the environment variable $PAGER.
+    If neither pager.pager, nor $PAGER is set, a default pager will be
+    used, typically `less` on Unix and `more` on Windows. Example::
+
+      [pager]
+      pager = less -FRX
+
+``ignore``
+    List of commands to disable the pager for. Example::
+
+      [pager]
+      ignore = version, help, update
 
 ``patch``
 ---------
@@ -1862,11 +1881,9 @@
     By default, the first bundle advertised by the server is used.
 
 ``color``
-    String: when to use to colorize output. possible value are auto, always,
-    never, or debug (default: auto). 'auto' will use color whenever it seems
-    possible. See :hg:`help color` for details.
-
-    (in addition a boolean can be used in place always/never)
+    When to colorize output. Possible value are Boolean ("yes" or "no"), or
+    "debug", or "always". (default: "yes"). "yes" will use color whenever it
+    seems possible. See :hg:`help color` for details.
 
 ``commitsubrepos``
     Whether to commit modified subrepositories when committing the
@@ -1943,6 +1960,10 @@
     The path to a directory used to store generated .orig files. If the path is
     not a directory, one will be created.
 
+``paginate``
+  Control the pagination of command output (default: True). See :hg:`help pager`
+  for details.
+
 ``patch``
     An optional external tool that ``hg import`` and some extensions
     will use for applying patches. By default Mercurial uses an
--- a/mercurial/help/pager.txt	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/help/pager.txt	Tue May 02 16:35:12 2017 -0500
@@ -6,9 +6,9 @@
   [pager]
   pager = less -FRX
 
-If no pager is set, the pager extensions uses the environment variable
+If no pager is set, Mercurial uses the environment variable
 $PAGER. If neither pager.pager, nor $PAGER is set, a default pager
-will be used, typically `more`.
+will be used, typically `less` on Unix and `more` on Windows.
 
 You can disable the pager for certain commands by adding them to the
 pager.ignore list::
@@ -20,16 +20,16 @@
 to specify them in your user configuration file.
 
 To control whether the pager is used at all for an individual command,
-you can use --pager=<value>::
+you can use --pager=<value>:
 
   - use as needed: `auto`.
   - require the pager: `yes` or `on`.
   - suppress the pager: `no` or `off` (any unrecognized value
-  will also work).
+    will also work).
 
 To globally turn off all attempts to use a pager, set::
 
-  [pager]
-  enable = false
+  [ui]
+  paginate = never
 
 which will prevent the pager from running.
--- a/mercurial/help/revisions.txt	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/help/revisions.txt	Tue May 02 16:35:12 2017 -0500
@@ -109,10 +109,10 @@
     [revsetalias]
     issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
 
-    ``issue(1234)`` is equivalent to
-    ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
-    in this case. This matches against all of "issue 1234", "issue:1234",
-    "issue1234" and "bug(1234)".
+  ``issue(1234)`` is equivalent to
+  ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
+  in this case. This matches against all of "issue 1234", "issue:1234",
+  "issue1234" and "bug(1234)".
 
 There is a single postfix operator:
 
@@ -132,9 +132,8 @@
 insensitive match on a case-sensitive predicate, use a regular expression,
 prefixed with ``(?i)``.
 
-  For example::
-
-    ``tag(r're:(?i)release')`` matches "release" or "RELEASE" or "Release", etc
+For example, ``tag(r're:(?i)release')`` matches "release" or "RELEASE"
+or "Release", etc
 
 Predicates
 ==========
--- a/mercurial/hgweb/webcommands.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/hgweb/webcommands.py	Tue May 02 16:35:12 2017 -0500
@@ -131,6 +131,7 @@
     f = fctx.path()
     text = fctx.data()
     parity = paritygen(web.stripecount)
+    ishead = fctx.filerev() in fctx.filelog().headrevs()
 
     if util.binary(text):
         mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
@@ -150,6 +151,7 @@
                 symrev=webutil.symrevorshortnode(req, fctx),
                 rename=webutil.renamelink(fctx),
                 permissions=fctx.manifest().flags(f),
+                ishead=int(ishead),
                 **webutil.commonentry(web.repo, fctx))
 
 @webcommand('file')
--- a/mercurial/httppeer.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/httppeer.py	Tue May 02 16:35:12 2017 -0500
@@ -80,7 +80,7 @@
             except httplib.HTTPException as e:
                 raise error.PeerTransportError(
                     _('HTTP request error (%s)') % e,
-                    hint=_('this may be an intermittent failure; '
+                    hint=_('this may be an intermittent network failure; '
                            'if the error persists, consider contacting the '
                            'network or server operator'))
 
--- a/mercurial/lock.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/lock.py	Tue May 02 16:35:12 2017 -0500
@@ -131,6 +131,9 @@
             except (OSError, IOError) as why:
                 if why.errno == errno.EEXIST:
                     locker = self._readlock()
+                    if locker is None:
+                        continue
+
                     # special case where a parent process holds the lock -- this
                     # is different from the pid being different because we do
                     # want the unlock and postrelease functions to be called,
@@ -148,6 +151,12 @@
                     raise error.LockUnavailable(why.errno, why.strerror,
                                                 why.filename, self.desc)
 
+        if not self.held:
+            # use empty locker to mean "busy for frequent lock/unlock
+            # by many processes"
+            raise error.LockHeld(errno.EAGAIN,
+                                 self.vfs.join(self.f), self.desc, "")
+
     def _readlock(self):
         """read lock and return its value
 
--- a/mercurial/patch.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/patch.py	Tue May 02 16:35:12 2017 -0500
@@ -992,6 +992,38 @@
             'record': _("record this change to '%s'?"),
             'revert': _("revert this change to '%s'?"),
         }[operation],
+        'help': {
+            'discard': _('[Ynesfdaq?]'
+                         '$$ &Yes, discard this change'
+                         '$$ &No, skip this change'
+                         '$$ &Edit this change manually'
+                         '$$ &Skip remaining changes to this file'
+                         '$$ Discard remaining changes to this &file'
+                         '$$ &Done, skip remaining changes and files'
+                         '$$ Discard &all changes to all remaining files'
+                         '$$ &Quit, discarding no changes'
+                         '$$ &? (display help)'),
+            'record': _('[Ynesfdaq?]'
+                        '$$ &Yes, record this change'
+                        '$$ &No, skip this change'
+                        '$$ &Edit this change manually'
+                        '$$ &Skip remaining changes to this file'
+                        '$$ Record remaining changes to this &file'
+                        '$$ &Done, skip remaining changes and files'
+                        '$$ Record &all changes to all remaining files'
+                        '$$ &Quit, recording no changes'
+                        '$$ &? (display help)'),
+            'revert': _('[Ynesfdaq?]'
+                        '$$ &Yes, revert this change'
+                        '$$ &No, skip this change'
+                        '$$ &Edit this change manually'
+                        '$$ &Skip remaining changes to this file'
+                        '$$ Revert remaining changes to this &file'
+                        '$$ &Done, skip remaining changes and files'
+                        '$$ Revert &all changes to all remaining files'
+                        '$$ &Quit, reverting no changes'
+                        '$$ &? (display help)')
+        }[operation]
     }
 
     def prompt(skipfile, skipall, query, chunk):
@@ -1010,16 +1042,7 @@
         if skipfile is not None:
             return skipfile, skipfile, skipall, newpatches
         while True:
-            resps = _('[Ynesfdaq?]'
-                      '$$ &Yes, record this change'
-                      '$$ &No, skip this change'
-                      '$$ &Edit this change manually'
-                      '$$ &Skip remaining changes to this file'
-                      '$$ Record remaining changes to this &file'
-                      '$$ &Done, skip remaining changes and files'
-                      '$$ Record &all changes to all remaining files'
-                      '$$ &Quit, recording no changes'
-                      '$$ &? (display help)')
+            resps = messages['help']
             r = ui.promptchoice("%s %s" % (query, resps))
             ui.write("\n")
             if r == 8: # ?
--- a/mercurial/rcutil.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/rcutil.py	Tue May 02 16:35:12 2017 -0500
@@ -21,6 +21,7 @@
 else:
     from . import scmposix as scmplatform
 
+fallbackpager = scmplatform.fallbackpager
 systemrcpath = scmplatform.systemrcpath
 userrcpath = scmplatform.userrcpath
 
--- a/mercurial/revset.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/revset.py	Tue May 02 16:35:12 2017 -0500
@@ -926,6 +926,7 @@
         revs = getset(repo, fullreposet(repo), args['startrev'])
         if len(revs) != 1:
             raise error.ParseError(
+                # i18n: "followlines" is a keyword
                 _("followlines expects exactly one revision"))
         rev = revs.last()
 
@@ -936,9 +937,11 @@
         m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=repo[rev])
         files = [f for f in repo[rev] if m(f)]
         if len(files) != 1:
+            # i18n: "followlines" is a keyword
             raise error.ParseError(_("followlines expects exactly one file"))
         fname = files[0]
 
+    # i18n: "followlines" is a keyword
     lr = getrange(args['lines'][0], _("followlines expects a line range"))
     fromline, toline = [getinteger(a, _("line range bounds must be integers"))
                         for a in lr]
@@ -948,7 +951,8 @@
     descend = False
     if 'descend' in args:
         descend = getboolean(args['descend'],
-                             _("'descend' argument must be a boolean"))
+                             # i18n: "descend" is a keyword
+                             _("descend argument must be a boolean"))
     if descend:
         rs = generatorset(
             (c.rev() for c, _linerange
--- a/mercurial/scmposix.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/scmposix.py	Tue May 02 16:35:12 2017 -0500
@@ -12,6 +12,12 @@
     pycompat,
 )
 
+# BSD 'more' escapes ANSI color sequences by default. This can be disabled by
+# $MORE variable, but there's no compatible option with Linux 'more'. Given
+# OS X is widely used and most modern Unix systems would have 'less', setting
+# 'less' as the default seems reasonable.
+fallbackpager = 'less'
+
 def _rcfiles(path):
     rcs = [os.path.join(path, 'hgrc')]
     rcdir = os.path.join(path, 'hgrc.d')
--- a/mercurial/scmutil.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/scmutil.py	Tue May 02 16:35:12 2017 -0500
@@ -151,10 +151,12 @@
     # Mercurial-specific first, followed by built-in and library exceptions
     except error.LockHeld as inst:
         if inst.errno == errno.ETIMEDOUT:
-            reason = _('timed out waiting for lock held by %s') % inst.locker
+            reason = _('timed out waiting for lock held by %r') % inst.locker
         else:
-            reason = _('lock held by %s') % inst.locker
+            reason = _('lock held by %r') % inst.locker
         ui.warn(_("abort: %s: %s\n") % (inst.desc or inst.filename, reason))
+        if not inst.locker:
+            ui.warn(_("(lock might be very busy)\n"))
     except error.LockUnavailable as inst:
         ui.warn(_("abort: could not lock %s: %s\n") %
                (inst.desc or inst.filename, inst.strerror))
--- a/mercurial/scmwindows.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/scmwindows.py	Tue May 02 16:35:12 2017 -0500
@@ -16,6 +16,9 @@
 except ImportError:
     import winreg
 
+# MS-DOS 'more' is the only pager available by default on Windows.
+fallbackpager = 'more'
+
 def systemrcpath():
     '''return default os-specific hgrc search path'''
     rcpath = []
--- a/mercurial/sshpeer.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/sshpeer.py	Tue May 02 16:35:12 2017 -0500
@@ -91,7 +91,15 @@
         return self._call('write', data)
 
     def read(self, size):
-        return self._call('read', size)
+        r = self._call('read', size)
+        if size != 0 and not r:
+            # We've observed a condition that indicates the
+            # stdout closed unexpectedly. Check stderr one
+            # more time and snag anything that's there before
+            # letting anyone know the main part of the pipe
+            # closed prematurely.
+            _forwardoutput(self._ui, self._side)
+        return r
 
     def readline(self):
         return self._call('readline')
--- a/mercurial/templates/gitweb/filerevision.tmpl	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/templates/gitweb/filerevision.tmpl	Tue May 02 16:35:12 2017 -0500
@@ -64,7 +64,7 @@
 </div>
 
 <div class="page_body">
-<pre class="sourcelines stripes" data-logurl="{url|urlescape}log/{symrev}/{file|urlescape}">{text%fileline}</pre>
+<pre class="sourcelines stripes" data-logurl="{url|urlescape}log/{symrev}/{file|urlescape}" data-ishead="{ishead}">{text%fileline}</pre>
 </div>
 
 <script type="text/javascript" src="{staticurl|urlescape}followlines.js"></script>
--- a/mercurial/templates/paper/filerevision.tmpl	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/templates/paper/filerevision.tmpl	Tue May 02 16:35:12 2017 -0500
@@ -71,7 +71,7 @@
 <div class="overflow">
 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
 <div class="sourcefirst"> line source</div>
-<pre class="sourcelines stripes4 wrap bottomline" data-logurl="{url|urlescape}log/{symrev}/{file|urlescape}">{text%fileline}</pre>
+<pre class="sourcelines stripes4 wrap bottomline" data-logurl="{url|urlescape}log/{symrev}/{file|urlescape}" data-ishead="{ishead}">{text%fileline}</pre>
 </div>
 
 <script type="text/javascript" src="{staticurl|urlescape}followlines.js"></script>
--- a/mercurial/templates/static/followlines.js	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/templates/static/followlines.js	Tue May 02 16:35:12 2017 -0500
@@ -17,6 +17,8 @@
         return;
     }
 
+    var isHead = parseInt(sourcelines.dataset.ishead || "0");
+
     // tooltip to invite on lines selection
     var tooltip = document.createElement('div');
     tooltip.id = 'followlines-tooltip';
@@ -153,7 +155,7 @@
 
             // append the <div id="followlines"> element to last line of the
             // selection block
-            var divAndButton = followlinesBox(targetUri, startId, endId);
+            var divAndButton = followlinesBox(targetUri, startId, endId, isHead);
             var div = divAndButton[0],
                 button = divAndButton[1];
             inviteElement.appendChild(div);
@@ -186,7 +188,7 @@
     sourcelines.addEventListener('click', lineSelectStart);
 
     //** return a <div id="followlines"> and inner cancel <button> elements */
-    function followlinesBox(targetUri, fromline, toline) {
+    function followlinesBox(targetUri, fromline, toline, isHead) {
         // <div id="followlines">
         var div = document.createElement('div');
         div.id = 'followlines';
@@ -211,15 +213,18 @@
         var aAsc = document.createElement('a');
         var url = targetUri + '?patch=&linerange=' + fromline + ':' + toline;
         aAsc.setAttribute('href', url);
-        aAsc.textContent = 'ascending';
+        aAsc.textContent = 'older';
         aDiv.appendChild(aAsc);
-        var sep = document.createTextNode(' / ');
-        aDiv.appendChild(sep);
-        //     link to "descending" followlines
-        var aDesc = document.createElement('a');
-        aDesc.setAttribute('href', url + '&descend=');
-        aDesc.textContent = 'descending';
-        aDiv.appendChild(aDesc);
+
+        if (!isHead) {
+            var sep = document.createTextNode(' / ');
+            aDiv.appendChild(sep);
+            //     link to "descending" followlines
+            var aDesc = document.createElement('a');
+            aDesc.setAttribute('href', url + '&descend=');
+            aDesc.textContent = 'newer';
+            aDiv.appendChild(aDesc);
+        }
 
         div.appendChild(aDiv);
 
--- a/mercurial/ui.py	Mon May 01 07:23:29 2017 +0900
+++ b/mercurial/ui.py	Tue May 02 16:35:12 2017 -0500
@@ -51,14 +51,20 @@
 # username = Jane Doe <jdoe@example.com>
 username =
 
-# uncomment to colorize command output
-# color = auto
+# uncomment to disable color in command output
+# (see 'hg help color' for details)
+# color = never
+
+# uncomment to disable command output pagination
+# (see 'hg help pager' for details)
+# paginate = never
 
 [extensions]
 # uncomment these lines to enable some popular extensions
 # (see 'hg help extensions' for more info)
 #
-# pager =""",
+# churn =
+""",
 
     'cloned':
 """# example repository config (see 'hg help config' for more info)
@@ -97,15 +103,21 @@
 """# example system-wide hg config (see 'hg help config' for more info)
 
 [ui]
-# uncomment to colorize command output
-# color = auto
+# uncomment to disable color in command output
+# (see 'hg help color' for details)
+# color = never
+
+# uncomment to disable command output pagination
+# (see 'hg help pager' for details)
+# paginate = never
 
 [extensions]
 # uncomment these lines to enable some popular extensions
 # (see 'hg help extensions' for more info)
 #
 # blackbox =
-# pager =""",
+# churn =
+""",
 }
 
 
@@ -844,7 +856,7 @@
         if (self._disablepager
             or self.pageractive
             or command in self.configlist('pager', 'ignore')
-            or not self.configbool('pager', 'enable', True)
+            or not self.configbool('ui', 'paginate', True)
             or not self.configbool('pager', 'attend-' + command, True)
             # TODO: if we want to allow HGPLAINEXCEPT=pager,
             # formatted() will need some adjustment.
@@ -857,8 +869,7 @@
             # HGPLAINEXCEPT=pager, and the user didn't specify --debug.
             return
 
-        fallbackpager = 'more'
-        pagercmd = self.config('pager', 'pager', fallbackpager)
+        pagercmd = self.config('pager', 'pager', rcutil.fallbackpager)
         if not pagercmd:
             return
 
--- a/tests/test-annotate.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-annotate.t	Tue May 02 16:35:12 2017 -0500
@@ -488,6 +488,8 @@
 followlines(pat, range, descend=True) to make sure both give the same result
 when they should.
 
+  $ echo a >> foo
+  $ hg ci -m 'foo: add a'
   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)'
   16: baz:0
   19: baz:3
@@ -528,17 +530,17 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  23: baz:3->3+
+  24: baz:3->3+
   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)'
   19: baz:3
   20: baz:4
-  23: baz:3->3+
+  24: baz:3->3+
   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2, descend=false)'
-  21: added two lines with 0
+  22: added two lines with 0
 
 file patterns are okay
   $ hg log -T '{rev}: {desc}\n' -r 'followlines("path:baz", 1:2)'
-  21: added two lines with 0
+  22: added two lines with 0
 
 renames are followed
   $ hg mv baz qux
@@ -549,15 +551,15 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  23: baz:3->3+
-  24: qux:4->4+
+  24: baz:3->3+
+  25: qux:4->4+
 
 but are missed when following children
   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=22, descend=True)'
-  23: baz:3->3+
+  24: baz:3->3+
 
 merge
-  $ hg up 23 --quiet
+  $ hg up 24 --quiet
   $ echo 7 >> baz
   $ hg ci -m 'one more line, out of line range'
   created new head
@@ -568,9 +570,9 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  23: baz:3->3+
-  26: baz:3+->3-
-  $ hg merge 24
+  24: baz:3->3+
+  27: baz:3+->3-
+  $ hg merge 25
   merging baz and qux to qux
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -579,12 +581,12 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  23: baz:3->3+
-  24: qux:4->4+
-  26: baz:3+->3-
-  27: merge
-  $ hg up 24 --quiet
-  $ hg merge 26
+  24: baz:3->3+
+  25: qux:4->4+
+  27: baz:3+->3-
+  28: merge
+  $ hg up 25 --quiet
+  $ hg merge 27
   merging qux and baz to qux
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -594,28 +596,28 @@
   16: baz:0
   19: baz:3
   20: baz:4
-  23: baz:3->3+
-  24: qux:4->4+
-  26: baz:3+->3-
-  28: merge from other side
-  $ hg up 23 --quiet
+  24: baz:3->3+
+  25: qux:4->4+
+  27: baz:3+->3-
+  29: merge from other side
+  $ hg up 24 --quiet
 
 we are missing the branch with rename when following children
-  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=25, descend=True)'
-  26: baz:3+->3-
+  $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=26, descend=True)'
+  27: baz:3+->3-
 
 we follow all branches in descending direction
-  $ hg up 22 --quiet
+  $ hg up 23 --quiet
   $ sed 's/3/+3/' baz > baz.new
   $ mv baz.new baz
   $ hg ci -m 'baz:3->+3'
   created new head
   $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 2:5, startrev=16, descend=True)' --graph
-  @  29: baz:3->+3
+  @  30: baz:3->+3
   :
-  : o  26: baz:3+->3-
+  : o  27: baz:3+->3-
   : :
-  : o  23: baz:3->3+
+  : o  24: baz:3->3+
   :/
   o    20: baz:4
   |\
@@ -628,7 +630,7 @@
   ~
 
 check error cases
-  $ hg up 23 --quiet
+  $ hg up 24 --quiet
   $ hg log -r 'followlines()'
   hg: parse error: followlines takes at least 1 positional arguments
   [255]
@@ -666,7 +668,7 @@
   hg: parse error at 43: syntax error in revset 'followlines(baz, 2:4, startrev=20, descend=[1])'
   [255]
   $ hg log -r 'followlines(baz, 2:4, startrev=20, descend=a)'
-  hg: parse error: 'descend' argument must be a boolean
+  hg: parse error: descend argument must be a boolean
   [255]
 
 Test annotate with whitespace options
--- a/tests/test-bookmarks-pushpull.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-bookmarks-pushpull.t	Tue May 02 16:35:12 2017 -0500
@@ -306,6 +306,12 @@
   $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
   $ cat pull-race.pid >> $DAEMON_PIDS
 
+  $ cat <<EOF > $TESTTMP/out_makecommit.sh
+  > #!/bin/sh
+  > hg ci -Am5
+  > echo committed in pull-race
+  > EOF
+
   $ hg clone -q http://localhost:$HGPORT/ pull-race2
   $ cd pull-race
   $ hg up -q Y
@@ -314,7 +320,7 @@
   $ echo c5 > f3
   $ cat <<EOF > .hg/hgrc
   > [hooks]
-  > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
+  > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh
   > EOF
 
 (new config needs a server restart)
@@ -347,12 +353,21 @@
 Update a bookmark right after the initial lookup -B (issue4689)
 
   $ echo c6 > ../pull-race/f3 # to be committed during the race
+  $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh
+  > #!/bin/sh
+  > if hg st | grep -q M; then
+  >     hg commit -m race
+  >     echo committed in pull-race
+  > else
+  >     exit 0
+  > fi
+  > EOF
   $ cat <<EOF > ../pull-race/.hg/hgrc
   > [hooks]
   > # If anything to commit, commit it right after the first key listing used
   > # during lookup. This makes the commit appear before the actual getbundle
   > # call.
-  > listkeys.makecommit= ((hg st | grep -q M) && (hg commit -m race; echo commited in pull-race)) || exit 0
+  > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh
   > EOF
 
 (new config need server restart)
--- a/tests/test-clonebundles.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-clonebundles.t	Tue May 02 16:35:12 2017 -0500
@@ -61,7 +61,7 @@
   $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
   $ hg clone http://localhost:$HGPORT server-not-runner
   applying clone bundle from http://localhost:$HGPORT1/bundle.hg
-  error fetching bundle: (.* refused.*|Protocol not supported) (re)
+  error fetching bundle: (.* refused.*|Protocol not supported|Cannot assign requested address) (re)
   abort: error applying bundle
   (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
   [255]
--- a/tests/test-convert-hg-sink.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-convert-hg-sink.t	Tue May 02 16:35:12 2017 -0500
@@ -440,15 +440,12 @@
   $ echo b > b/f
   $ hg -R b ci -mb
 
-  $ tail */.hg/shamap
-  ==> 0/.hg/shamap <==
+  $ tail 0/.hg/shamap
   86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
   dd9f218eb91fb857f2a62fe023e1d64a4e7812fe 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a
-  
-  ==> a/.hg/shamap <==
+  $ tail a/.hg/shamap
   8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6
-  
-  ==> b/.hg/shamap <==
+  $ tail b/.hg/shamap
   8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a dd9f218eb91fb857f2a62fe023e1d64a4e7812fe
 
   $ hg convert a 0
--- a/tests/test-diff-color.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-diff-color.t	Tue May 02 16:35:12 2017 -0500
@@ -2,7 +2,8 @@
 
   $ cat <<EOF >> $HGRCPATH
   > [ui]
-  > color = always
+  > color = yes
+  > formatted = always
   > [color]
   > mode = ansi
   > EOF
@@ -49,6 +50,54 @@
    a
    c
 
+(check that 'ui.color=yes' match '--color=auto')
+
+  $ hg diff --nodates --config ui.formatted=no
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+
+(check that 'ui.color=no' disable color)
+
+  $ hg diff --nodates --config ui.formatted=yes --config ui.color=no
+  diff -r cf9f4ba66af2 a
+  --- a/a
+  +++ b/a
+  @@ -2,7 +2,7 @@
+   c
+   a
+   a
+  -b
+  +dd
+   a
+   a
+   c
+
+(check that 'ui.color=always' force color)
+
+  $ hg diff --nodates --config ui.formatted=no --config ui.color=always
+  \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
+  \x1b[0;31;1m--- a/a\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/a\x1b[0m (esc)
+  \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
+   c
+   a
+   a
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
+   a
+   a
+   c
+
 --unified=2
 
   $ hg diff --nodates -U 2
--- a/tests/test-help.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-help.t	Tue May 02 16:35:12 2017 -0500
@@ -943,6 +943,8 @@
   Technical implementation topics
   """""""""""""""""""""""""""""""
   
+      To access a subtopic, use "hg help internals.{subtopic-name}"
+  
        bundles       Bundles
        censor        Censor
        changegroups  Changegroups
--- a/tests/test-hgweb-commands.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-hgweb-commands.t	Tue May 02 16:35:12 2017 -0500
@@ -1343,7 +1343,7 @@
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/1/foo">
+  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/1/foo" data-ishead="0">
   <span id="l1">foo</span><a href="#l1"></a></pre>
   </div>
   
@@ -1471,7 +1471,7 @@
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/2/foo">
+  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/2/foo" data-ishead="1">
   <span id="l1">another</span><a href="#l1"></a></pre>
   </div>
   
--- a/tests/test-hgweb-filelog.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-hgweb-filelog.t	Tue May 02 16:35:12 2017 -0500
@@ -1220,6 +1220,8 @@
   > f+
   > EOF
   $ hg ci -m 'touching beginning and end of c' c
+  $ echo c > cc
+  $ hg ci -Am 'tip does not touch c' cc
   $ hg log -r 'followlines(c, 3:4, startrev=tip) and follow(c)' -p
   changeset:   0:6563da9dcf87
   user:        test
@@ -1289,7 +1291,6 @@
   
   changeset:   11:fb9bc322513a
   branch:      a-branch
-  tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     touching beginning and end of c
@@ -1369,7 +1370,7 @@
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
   <h3>
-   log c @ 11:<a href="/rev/fb9bc322513a">fb9bc322513a</a>
+   log c @ 12:<a href="/rev/6e4182052f7b">6e4182052f7b</a>
    <span class="branchname">a-branch</span> <span class="tag">tip</span> 
     (following lines 3:4 <a href="/log/tip/c">back to filelog</a>)
   </h3>
@@ -1400,7 +1401,7 @@
     <td class="author">test</td>
     <td class="description">
      <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
-     <span class="branchhead">a-branch</span> <span class="tag">tip</span> 
+     <span class="branchname">a-branch</span> 
     </td>
    </tr>
    <tr><td colspan="3"><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
@@ -1546,7 +1547,6 @@
   
   changeset:   11:fb9bc322513a
   branch:      a-branch
-  tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     touching beginning and end of c
@@ -1675,7 +1675,7 @@
     <td class="author">test</td>
     <td class="description">
      <a href="/rev/fb9bc322513a">touching beginning and end of c</a>
-     <span class="branchhead">a-branch</span> <span class="tag">tip</span> 
+     <span class="branchname">a-branch</span> 
     </td>
    </tr>
    
--- a/tests/test-highlight.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-highlight.t	Tue May 02 16:35:12 2017 -0500
@@ -149,7 +149,7 @@
   <div class="overflow">
   <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
   <div class="sourcefirst"> line source</div>
-  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py">
+  <pre class="sourcelines stripes4 wrap bottomline" data-logurl="/log/tip/primes.py" data-ishead="1">
   <span id="l1"><span class="c">#!/usr/bin/env python</span></span><a href="#l1"></a>
   <span id="l2"></span><a href="#l2"></a>
   <span id="l3"><span class="sd">&quot;&quot;&quot;Fun with generators. Corresponding Haskell implementation:</span></span><a href="#l3"></a>
--- a/tests/test-http-bad-server.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-http-bad-server.t	Tue May 02 16:35:12 2017 -0500
@@ -48,9 +48,17 @@
   $ hg --config badserver.closeafteraccept=true serve -p $HGPORT -d --pid-file=hg.pid
   $ cat hg.pid > $DAEMON_PIDS
 
+TODO: this usually outputs good results, but sometimes emits abort:
+error: '' on FreeBSD and OS X.
+What we ideally want are:
+
+abort: error: Connection reset by peer (no-windows !)
+abort: error: An existing connection was forcibly closed by the remote host (windows !)
+
+The flakiness in this output was observable easily with
+--runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: Connection reset by peer (no-windows !)
-  abort: error: An existing connection was forcibly closed by the remote host (windows !)
+  abort: error: * (glob)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
@@ -63,13 +71,13 @@
 TODO this error message is not very good
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: ''
+  abort: error: (''|) (re)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(1 from 65537) -> (1) G
+  readline\(1 from (-1|65537)\) -> \(1\) G (re)
   read limit reached; closing socket
 
   $ rm -f error.log
@@ -79,13 +87,13 @@
   $ hg --config badserver.closeafterrecvbytes=40 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: ''
+  abort: error: (''|) (re)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(40 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\(40 from (-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(7 from -1) -> (7) Accept-
   read limit reached; closing socket
 
@@ -96,18 +104,18 @@
   $ hg --config badserver.closeafterrecvbytes=210 serve -p $HGPORT -d --pid-file=hg.pid -E error.log
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: ''
+  abort: error: (''|) (re)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(210 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\(210 from (-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(177 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(150 from -1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(115 from -1) -> (23) host: localhost:$HGPORT\r\n
-  readline(92 from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
-  readline(43 from -1) -> (2) \r\n
+  readline(115 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
+  readline(9? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
+  readline(4? from -1) -> (2) \r\n (glob)
   write(36) -> HTTP/1.1 200 Script output follows\r\n
   write(23) -> Server: badhttpserver\r\n
   write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
@@ -115,10 +123,10 @@
   write(21) -> Content-Length: 405\r\n
   write(2) -> \r\n
   write(405) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(41 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
-  readline(15 from -1) -> (15) Accept-Encoding
+  readline\(4[12] from (-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
+  readline(1? from -1) -> (1?) Accept-Encoding* (glob)
   read limit reached; closing socket
-  readline(210 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\(210 from (-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(184 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(157 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(128 from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
@@ -135,18 +143,18 @@
   $ cat hg.pid > $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ clone
   requesting all changes
-  abort: error: ''
+  abort: error: (''|) (re)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(292 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\(292 from (-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(259 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(232 from -1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(197 from -1) -> (23) host: localhost:$HGPORT\r\n
-  readline(174 from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
-  readline(125 from -1) -> (2) \r\n
+  readline(197 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
+  readline(17? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
+  readline(12? from -1) -> (2) \r\n (glob)
   write(36) -> HTTP/1.1 200 Script output follows\r\n
   write(23) -> Server: badhttpserver\r\n
   write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
@@ -154,20 +162,21 @@
   write(21) -> Content-Length: 405\r\n
   write(2) -> \r\n
   write(405) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(123 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
-  readline(97 from -1) -> (27) Accept-Encoding: identity\r\n
-  readline(70 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
-  readline(41 from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
+  readline\(12[34] from (-1|65537)\) -> \(2[67]\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
+  readline(9? from -1) -> (27) Accept-Encoding: identity\r\n (glob)
+  readline(7? from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
+  readline(4? from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
+  readline(1 from -1) -> (1) x (?)
   read limit reached; closing socket
-  readline(292 from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\(292 from (-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(266 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(239 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(210 from -1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(169 from -1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(121 from -1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(86 from -1) -> (23) host: localhost:$HGPORT\r\n
-  readline(63 from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
-  readline(14 from -1) -> (2) \r\n
+  readline(86 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
+  readline(6? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
+  readline(1? from -1) -> (2) \r\n (glob)
   write(36) -> HTTP/1.1 200 Script output follows\r\n
   write(23) -> Server: badhttpserver\r\n
   write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
@@ -175,9 +184,9 @@
   write(20) -> Content-Length: 42\r\n
   write(2) -> \r\n
   write(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
-  readline(12 from 65537) -> (12) GET /?cmd=ge
+  readline\(1[23] from (-1|65537)\) -> \(1[23]\) GET /\?cmd=ge.? (re)
   read limit reached; closing socket
-  readline(292 from 65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
+  readline\(292 from (-1|65537)\) -> \(30\) GET /\?cmd=getbundle HTTP/1.1\\r\\n (re)
   readline(262 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(235 from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(206 from -1) -> (206) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Ali
@@ -191,18 +200,18 @@
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: ''
+  abort: error: (''|) (re)
   [255]
 
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(315 from 65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\(315 from (-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(282 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(255 from -1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(220 from -1) -> (23) host: localhost:$HGPORT\r\n
-  readline(197 from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
-  readline(148 from -1) -> (2) \r\n
+  readline(220 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
+  readline(19? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
+  readline(14? from -1) -> (2) \r\n (glob)
   write(36) -> HTTP/1.1 200 Script output follows\r\n
   write(23) -> Server: badhttpserver\r\n
   write(37) -> Date: Fri, 14 Apr 2017 00:00:00 GMT\r\n
@@ -210,14 +219,14 @@
   write(21) -> Content-Length: 418\r\n
   write(2) -> \r\n
   write(418) -> lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httppostargs httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(146 from 65537) -> (27) POST /?cmd=batch HTTP/1.1\r\n
-  readline(119 from -1) -> (27) Accept-Encoding: identity\r\n
-  readline(92 from -1) -> (41) content-type: application/mercurial-0.1\r\n
-  readline(51 from -1) -> (19) vary: X-HgProto-1\r\n
-  readline(32 from -1) -> (19) x-hgargs-post: 28\r\n
-  readline(13 from -1) -> (13) x-hgproto-1: 
+  readline\(14[67] from (-1|65537)\) -> \(2[67]\) POST /\?cmd=batch HTTP/1.1\\r\\n (re)
+  readline\(1(19|20) from -1\) -> \(27\) Accept-Encoding: identity\\r\\n (re)
+  readline(9? from -1) -> (41) content-type: application/mercurial-0.1\r\n (glob)
+  readline(5? from -1) -> (19) vary: X-HgProto-1\r\n (glob)
+  readline(3? from -1) -> (19) x-hgargs-post: 28\r\n (glob)
+  readline(1? from -1) -> (1?) x-hgproto-1: * (glob)
   read limit reached; closing socket
-  readline(315 from 65537) -> (27) POST /?cmd=batch HTTP/1.1\r\n
+  readline\(315 from (-1|65537)\) -> \(27\) POST /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(288 from -1) -> (27) Accept-Encoding: identity\r\n
   readline(261 from -1) -> (41) content-type: application/mercurial-0.1\r\n
   readline(220 from -1) -> (19) vary: X-HgProto-1\r\n
@@ -225,10 +234,10 @@
   readline(182 from -1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(134 from -1) -> (35) accept: application/mercurial-0.1\r\n
   readline(99 from -1) -> (20) content-length: 28\r\n
-  readline(79 from -1) -> (23) host: localhost:$HGPORT\r\n
-  readline(56 from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
-  readline(7 from -1) -> (2) \r\n
-  read(5 from 28) -> (5) cmds=
+  readline(79 from -1) -> (2?) host: localhost:$HGPORT\r\n (glob)
+  readline(5? from -1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
+  readline(? from -1) -> (2) \r\n (glob)
+  read(? from 28) -> (?) cmds=* (glob)
   read limit reached, closing socket
   write(36) -> HTTP/1.1 500 Internal Server Error\r\n
 
@@ -248,10 +257,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(1 from 36) -> (0) H
@@ -273,10 +282,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (144) HTTP/1.1 200 Script output follows\r\n
@@ -308,10 +317,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (659) HTTP/1.1 200 Script output follows\r\n
@@ -321,13 +330,13 @@
   write(21 from 21) -> (537) Content-Length: 405\r\n
   write(2 from 2) -> (535) \r\n
   write(405 from 405) -> (130) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (94) HTTP/1.1 200 Script output follows\r\n
@@ -351,10 +360,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (724) HTTP/1.1 200 Script output follows\r\n
@@ -364,13 +373,13 @@
   write(21 from 21) -> (602) Content-Length: 405\r\n
   write(2 from 2) -> (600) \r\n
   write(405 from 405) -> (195) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (159) HTTP/1.1 200 Script output follows\r\n
@@ -403,10 +412,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (859) HTTP/1.1 200 Script output follows\r\n
@@ -416,13 +425,13 @@
   write(21 from 21) -> (737) Content-Length: 405\r\n
   write(2 from 2) -> (735) \r\n
   write(405 from 405) -> (330) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (294) HTTP/1.1 200 Script output follows\r\n
@@ -432,13 +441,13 @@
   write(20 from 20) -> (173) Content-Length: 42\r\n
   write(2 from 2) -> (171) \r\n
   write(42 from 42) -> (129) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
-  readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(30\) GET /\?cmd=getbundle HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (93) HTTP/1.1 200 Script output follows\r\n
@@ -464,10 +473,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (897) HTTP/1.1 200 Script output follows\r\n
@@ -477,13 +486,13 @@
   write(21 from 21) -> (775) Content-Length: 405\r\n
   write(2 from 2) -> (773) \r\n
   write(405 from 405) -> (368) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (332) HTTP/1.1 200 Script output follows\r\n
@@ -493,13 +502,13 @@
   write(20 from 20) -> (211) Content-Length: 42\r\n
   write(2 from 2) -> (209) \r\n
   write(42 from 42) -> (167) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
-  readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(30\) GET /\?cmd=getbundle HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (131) HTTP/1.1 200 Script output follows\r\n
@@ -527,10 +536,10 @@
   $ killdaemons.py $DAEMON_PIDS
 
   $ cat error.log
-  readline(65537) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(33\) GET /\?cmd=capabilities HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (909) HTTP/1.1 200 Script output follows\r\n
@@ -540,13 +549,13 @@
   write(21 from 21) -> (787) Content-Length: 405\r\n
   write(2 from 2) -> (785) \r\n
   write(405 from 405) -> (380) lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 bundle2=HG20%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx compression=none
-  readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(26\) GET /\?cmd=batch HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (344) HTTP/1.1 200 Script output follows\r\n
@@ -556,13 +565,13 @@
   write(20 from 20) -> (223) Content-Length: 42\r\n
   write(2 from 2) -> (221) \r\n
   write(42 from 42) -> (179) 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
-  readline(65537) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
+  readline\((-1|65537)\) -> \(30\) GET /\?cmd=getbundle HTTP/1.1\\r\\n (re)
   readline(-1) -> (27) Accept-Encoding: identity\r\n
   readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n
   readline(-1) -> (396) x-hgarg-1: bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n
   readline(-1) -> (48) x-hgproto-1: 0.1 0.2 comp=zstd,zlib,none,bzip2\r\n
   readline(-1) -> (35) accept: application/mercurial-0.1\r\n
-  readline(-1) -> (23) host: localhost:$HGPORT\r\n
+  readline(-1) -> (2?) host: localhost:$HGPORT\r\n (glob)
   readline(-1) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n
   readline(-1) -> (2) \r\n
   write(36 from 36) -> (143) HTTP/1.1 200 Script output follows\r\n
--- a/tests/test-http-proxy.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-http-proxy.t	Tue May 02 16:35:12 2017 -0500
@@ -87,7 +87,7 @@
 misconfigured hosts)
 
   $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
-  abort: error: (Connection refused|Protocol not supported|.* actively refused it) (re)
+  abort: error: (Connection refused|Protocol not supported|.* actively refused it|Cannot assign requested address) (re)
   [255]
 
 do not use the proxy if it is in the no list
--- a/tests/test-lock.py	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-lock.py	Tue May 02 16:35:12 2017 -0500
@@ -1,6 +1,7 @@
 from __future__ import absolute_import
 
 import copy
+import errno
 import os
 import silenttestrunner
 import tempfile
@@ -267,5 +268,31 @@
 
         lock.release()
 
+    def testfrequentlockunlock(self):
+        """This tests whether lock acquisition fails as expected, even if
+        (1) lock can't be acquired (makelock fails by EEXIST), and
+        (2) locker info can't be read in (readlock fails by ENOENT) while
+        retrying 5 times.
+        """
+
+        d = tempfile.mkdtemp(dir=os.getcwd())
+        state = teststate(self, d)
+
+        def emulatefrequentlock(*args):
+            raise OSError(errno.EEXIST, "File exists")
+        def emulatefrequentunlock(*args):
+            raise OSError(errno.ENOENT, "No such file or directory")
+
+        state.vfs.makelock = emulatefrequentlock
+        state.vfs.readlock = emulatefrequentunlock
+
+        try:
+            state.makelock(timeout=0)
+            self.fail("unexpected lock acquisition")
+        except error.LockHeld as why:
+            self.assertTrue(why.errno == errno.ETIMEDOUT)
+            self.assertTrue(why.locker == "")
+            state.assertlockexists(False)
+
 if __name__ == '__main__':
     silenttestrunner.main(__name__)
--- a/tests/test-obsolete-checkheads.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-obsolete-checkheads.t	Tue May 02 16:35:12 2017 -0500
@@ -281,3 +281,32 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
+
+Old head is pruned without parent data and new unrelated head added
+===================================================================
+
+setup
+
+  $ cd ..
+  $ rm -R remote local
+  $ cp -R backup1 remote
+  $ hg clone remote local -qr c70b08862e08
+  $ cd local
+  $ hg up -q '.^'
+  $ mkcommit new-unrelated
+  created new head
+  $ hg debugobsolete `getid old`
+  $ hg log -G --hidden
+  @  350a93b716be (draft) add new-unrelated
+  |
+  | x  c70b08862e08 (draft) add old
+  |/
+  o  b4952fcf48cf (public) add base
+  
+
+  $ hg push
+  pushing to $TESTTMP/remote (glob)
+  searching for changes
+  abort: push creates new remote head 350a93b716be!
+  (merge or see 'hg help push' for details about pushing new heads)
+  [255]
--- a/tests/test-pager-legacy.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-pager-legacy.t	Tue May 02 16:35:12 2017 -0500
@@ -160,7 +160,7 @@
 even though stdout is no longer a tty.
   $ cat >> $HGRCPATH <<EOF
   > [ui]
-  > color = yes
+  > color = always
   > [color]
   > mode = ansi
   > EOF
--- a/tests/test-pager.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-pager.t	Tue May 02 16:35:12 2017 -0500
@@ -52,6 +52,30 @@
   $ hg id
   46106edeeb38 tip
 
+We can control the pager from the config
+
+  $ hg log --limit 1 --config 'ui.paginate=False'
+  changeset:   10:46106edeeb38
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a 10
+  
+  $ hg log --limit 1 --config 'ui.paginate=0'
+  changeset:   10:46106edeeb38
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     modify a 10
+  
+  $ hg log --limit 1 --config 'ui.paginate=1'
+  paged! 'changeset:   10:46106edeeb38\n'
+  paged! 'tag:         tip\n'
+  paged! 'user:        test\n'
+  paged! 'date:        Thu Jan 01 00:00:00 1970 +0000\n'
+  paged! 'summary:     modify a 10\n'
+  paged! '\n'
+
 We can enable the pager on id:
 
 BROKEN: should be paged
@@ -69,8 +93,9 @@
    a 1
   +a 2
 
-If 'log' is in attend, then 'history' should also be paged:
-  $ hg history --limit 2 --config pager.attend=log
+Command aliases should have same behavior as main command
+
+  $ hg history --limit 2
   paged! 'changeset:   10:46106edeeb38\n'
   paged! 'tag:         tip\n'
   paged! 'user:        test\n'
@@ -83,6 +108,24 @@
   paged! 'summary:     modify a 9\n'
   paged! '\n'
 
+Abbreviated command alias should also be paged
+
+  $ hg hist -l 1
+  paged! 'changeset:   10:46106edeeb38\n'
+  paged! 'tag:         tip\n'
+  paged! 'user:        test\n'
+  paged! 'date:        Thu Jan 01 00:00:00 1970 +0000\n'
+  paged! 'summary:     modify a 10\n'
+  paged! '\n'
+
+Attend for an abbreviated command does not work
+
+  $ hg --config pager.attend-ident=true ident
+  46106edeeb38 tip
+
+  $ hg --config extensions.pager= --config pager.attend-ident=true ident
+  46106edeeb38 tip
+
 Pager should not start if stdout is not a tty.
 
   $ hg log -l1 -q --config ui.formatted=False
@@ -98,7 +141,7 @@
 even though stdout is no longer a tty.
   $ cat >> $HGRCPATH <<EOF
   > [ui]
-  > color = yes
+  > color = always
   > [color]
   > mode = ansi
   > EOF
--- a/tests/test-revert-interactive.t	Mon May 01 07:23:29 2017 +0900
+++ b/tests/test-revert-interactive.t	Tue May 02 16:35:12 2017 -0500
@@ -46,6 +46,7 @@
   > y
   > y
   > y
+  > ?
   > y
   > n
   > n
@@ -88,6 +89,17 @@
    3
    4
    5
+  revert change 3/6 to 'folder1/g'? [Ynesfdaq?] ?
+  
+  y - yes, revert this change
+  n - no, skip this change
+  e - edit this change manually
+  s - skip remaining changes to this file
+  f - revert remaining changes to this file
+  d - done, skip remaining changes and files
+  a - revert all changes to all remaining files
+  q - quit, reverting no changes
+  ? - ? (display help)
   revert change 3/6 to 'folder1/g'? [Ynesfdaq?] y
   
   @@ -1,5 +2,6 @@
@@ -264,6 +276,7 @@
   M folder1/g
   $ hg revert --interactive f << EOF
   > y
+  > ?
   > y
   > n
   > n
@@ -279,6 +292,17 @@
    3
    4
    5
+  discard change 1/2 to 'f'? [Ynesfdaq?] ?
+  
+  y - yes, discard this change
+  n - no, skip this change
+  e - edit this change manually
+  s - skip remaining changes to this file
+  f - discard remaining changes to this file
+  d - done, skip remaining changes and files
+  a - discard all changes to all remaining files
+  q - quit, discarding no changes
+  ? - ? (display help)
   discard change 1/2 to 'f'? [Ynesfdaq?] y
   
   @@ -2,6 +1,5 @@
@@ -436,4 +460,3 @@
   forget added file newfile (Yn)? y
   $ hg status
   ? newfile
-