changeset 16995:f940f200bad2

merge with i18n
author Wagner Bruna <wbruna@softwareexpress.com.br>
date Mon, 18 Jun 2012 16:21:31 -0300
parents 132ea1736751 (diff) a96393863658 (current diff)
children 7e753220c3b7
files
diffstat 280 files changed, 2290 insertions(+), 1050 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/contrib/check-code.py	Mon Jun 18 16:21:31 2012 -0300
@@ -47,7 +47,7 @@
     (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
     (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
     (r'sed.*-i', "don't use 'sed -i', use a temporary file"),
-    (r'echo.*\\n', "don't use 'echo \\n', use printf"),
+    (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"),
     (r'echo -n', "don't use 'echo -n', use printf"),
     (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"),
     (r'head -c', "don't use 'head -c', use 'dd'"),
--- a/hgext/acl.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/acl.py	Mon Jun 18 16:21:31 2012 -0300
@@ -46,6 +46,9 @@
 - a comma-separated list containing users and groups, or
 - an asterisk, to match anyone;
 
+You can add the "!" prefix to a user or group name to invert the sense
+of the match.
+
 Path-based Access Control
 .........................
 
@@ -146,6 +149,46 @@
 
   .hgtags = release_engineer
 
+Examples using the "!" prefix
+.............................
+
+Suppose there's a branch that only a given user (or group) should be able to
+push to, and you don't want to restrict access to any other branch that may
+be created.
+
+The "!" prefix allows you to prevent anyone except a given user or group to
+push changesets in a given branch or path.
+
+In the examples below, we will:
+1) Deny access to branch "ring" to anyone but user "gollum"
+2) Deny access to branch "lake" to anyone but members of the group "hobbit"
+3) Deny access to a file to anyone but user "gollum"
+
+::
+
+  [acl.allow.branches]
+  # Empty
+
+  [acl.deny.branches]
+
+  # 1) only 'gollum' can commit to branch 'ring';
+  # 'gollum' and anyone else can still commit to any other branch.
+  ring = !gollum
+
+  # 2) only members of the group 'hobbit' can commit to branch 'lake';
+  # 'hobbit' members and anyone else can still commit to any other branch.
+  lake = !@hobbit
+
+  # You can also deny access based on file paths:
+
+  [acl.allow]
+  # Empty
+
+  [acl.deny]
+  # 3) only 'gollum' can change the file below;
+  # 'gollum' and anyone else can still change any other file.
+  /misty/mountains/cave/ring = !gollum
+
 '''
 
 from mercurial.i18n import _
@@ -174,7 +217,21 @@
         return True
 
     for ug in usersorgroups.replace(',', ' ').split():
-        if user == ug or ug.startswith('@') and user in _getusers(ui, ug[1:]):
+
+        if ug.startswith('!'):
+            # Test for excluded user or group. Format:
+            # if ug is a user  name: !username
+            # if ug is a group name: !@groupname
+            ug = ug[1:]
+            if not ug.startswith('@') and user != ug \
+                or ug.startswith('@') and user not in _getusers(ui, ug[1:]):
+                return True
+
+        # Test for user or group. Format:
+        # if ug is a user  name: username
+        # if ug is a group name: @groupname
+        elif user == ug \
+             or ug.startswith('@') and user in _getusers(ui, ug[1:]):
             return True
 
     return False
--- a/hgext/churn.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/churn.py	Mon Jun 18 16:21:31 2012 -0300
@@ -69,7 +69,7 @@
         else:
             parents = ctx.parents()
             if len(parents) > 1:
-                ui.note(_('Revision %d is a merge, ignoring...\n') % (rev,))
+                ui.note(_('revision %d is a merge, ignoring...\n') % (rev,))
                 return
 
             ctx1 = parents[0]
--- a/hgext/convert/convcmd.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/convert/convcmd.py	Mon Jun 18 16:21:31 2012 -0300
@@ -280,7 +280,7 @@
     def writeauthormap(self):
         authorfile = self.authorfile
         if authorfile:
-            self.ui.status(_('Writing author map file %s\n') % authorfile)
+            self.ui.status(_('writing author map file %s\n') % authorfile)
             ofile = open(authorfile, 'w+')
             for author in self.authors:
                 ofile.write("%s=%s\n" % (author, self.authors[author]))
@@ -297,7 +297,7 @@
             try:
                 srcauthor, dstauthor = line.split('=', 1)
             except ValueError:
-                msg = _('Ignoring bad line in author map file %s: %s\n')
+                msg = _('ignoring bad line in author map file %s: %s\n')
                 self.ui.warn(msg % (authorfile, line.rstrip()))
                 continue
 
--- a/hgext/convert/subversion.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/convert/subversion.py	Mon Jun 18 16:21:31 2012 -0300
@@ -227,7 +227,7 @@
             raise NoRepo(_("%s does not look like a Subversion repository")
                          % url)
         if svn is None:
-            raise MissingTool(_('Could not load Subversion python bindings'))
+            raise MissingTool(_('could not load Subversion python bindings'))
 
         try:
             version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
--- a/hgext/fetch.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/fetch.py	Mon Jun 18 16:21:31 2012 -0300
@@ -75,7 +75,7 @@
             try:
                 revs = [other.lookup(rev) for rev in opts['rev']]
             except error.CapabilityError:
-                err = _("Other repository doesn't support revision lookup, "
+                err = _("other repository doesn't support revision lookup, "
                         "so a rev cannot be specified.")
                 raise util.Abort(err)
 
--- a/hgext/gpg.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/gpg.py	Mon Jun 18 16:21:31 2012 -0300
@@ -180,7 +180,7 @@
                 keys.extend(k)
 
     if not keys:
-        ui.write(_("No valid signature for %s\n") % hgnode.short(rev))
+        ui.write(_("no valid signature for %s\n") % hgnode.short(rev))
         return
 
     # print summary
@@ -237,7 +237,7 @@
 
     for n in nodes:
         hexnode = hgnode.hex(n)
-        ui.write(_("Signing %d:%s\n") % (repo.changelog.rev(n),
+        ui.write(_("signing %d:%s\n") % (repo.changelog.rev(n),
                                          hgnode.short(n)))
         # build data
         data = node2txt(repo, n, sigver)
--- a/hgext/largefiles/lfutil.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/largefiles/lfutil.py	Mon Jun 18 16:21:31 2012 -0300
@@ -115,10 +115,10 @@
 
 def findfile(repo, hash):
     if instore(repo, hash):
-        repo.ui.note(_('Found %s in store\n') % hash)
+        repo.ui.note(_('found %s in store\n') % hash)
         return storepath(repo, hash)
     elif inusercache(repo.ui, hash):
-        repo.ui.note(_('Found %s in system cache\n') % hash)
+        repo.ui.note(_('found %s in system cache\n') % hash)
         path = storepath(repo, hash)
         util.makedirs(os.path.dirname(path))
         link(usercachepath(repo.ui, hash), path)
--- a/hgext/largefiles/localstore.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/largefiles/localstore.py	Mon Jun 18 16:21:31 2012 -0300
@@ -43,7 +43,7 @@
             path = lfutil.usercachepath(self.ui, hash)
         else:
             raise basestore.StoreError(filename, hash, '',
-                _("Can't get file locally"))
+                _("can't get file locally"))
         fd = open(path, 'rb')
         try:
             return lfutil.copyandhash(fd, tmpfile)
--- a/hgext/mq.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/mq.py	Mon Jun 18 16:21:31 2012 -0300
@@ -1773,7 +1773,7 @@
                 else:
                     series.append(l)
         if datastart is None:
-            self.ui.warn(_("No saved patch data found\n"))
+            self.ui.warn(_("no saved patch data found\n"))
             return 1
         self.ui.warn(_("restoring status: %s\n") % lines[0])
         self.fullseries = series
@@ -1800,7 +1800,7 @@
                 self.ui.status(_("updating queue directory\n"))
                 r = self.qrepo()
                 if not r:
-                    self.ui.warn(_("Unable to load queue repository\n"))
+                    self.ui.warn(_("unable to load queue repository\n"))
                     return 1
                 hg.clean(r, qpp[0])
 
@@ -2514,7 +2514,7 @@
     for f in files:
         p = q.lookup(f)
         if p in patches or p == parent:
-            ui.warn(_('Skipping already folded patch %s\n') % p)
+            ui.warn(_('skipping already folded patch %s\n') % p)
         if q.isapplied(p):
             raise util.Abort(_('qfold cannot fold already applied patch %s')
                              % p)
@@ -3420,7 +3420,7 @@
             tags = result[0]
             for patch in mqtags:
                 if patch[1] in tags:
-                    self.ui.warn(_('Tag %s overrides mq patch of the same '
+                    self.ui.warn(_('tag %s overrides mq patch of the same '
                                    'name\n') % patch[1])
                 else:
                     tags[patch[1]] = patch[0]
--- a/hgext/notify.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/notify.py	Mon Jun 18 16:21:31 2012 -0300
@@ -7,13 +7,13 @@
 
 '''hooks for sending email push notifications
 
-This extension let you run hooks sending email notifications when
-changesets are being pushed, from the sending or receiving side.
+This extension implements hooks to send email notifications when
+changesets are sent from or received by the local repository.
 
 First, enable the extension as explained in :hg:`help extensions`, and
 register the hook you want to run. ``incoming`` and ``changegroup`` hooks
-are run by the changesets receiver while the ``outgoing`` one is for
-the sender::
+are run when changesets are received, while ``outgoing`` hooks are for
+changesets sent to another repository::
 
   [hooks]
   # one email for each incoming changeset
@@ -24,13 +24,13 @@
   # one email for all outgoing changesets
   outgoing.notify = python:hgext.notify.hook
 
-Now the hooks are running, subscribers must be assigned to
-repositories. Use the ``[usersubs]`` section to map repositories to a
-given email or the ``[reposubs]`` section to map emails to a single
-repository::
+This registers the hooks. To enable notification, subscribers must
+be assigned to repositories. The ``[usersubs]`` section maps multiple
+repositories to a given recipient. The ``[reposubs]`` section maps
+multiple recipients to a single repository::
 
   [usersubs]
-  # key is subscriber email, value is a comma-separated list of glob
+  # key is subscriber email, value is a comma-separated list of repo glob
   # patterns
   user@host = pattern
 
@@ -40,17 +40,17 @@
   pattern = user@host
 
 Glob patterns are matched against absolute path to repository
-root. The subscriptions can be defined in their own file and
-referenced with::
+root.
+
+In order to place them under direct user management, ``[usersubs]`` and
+``[reposubs]`` sections may be placed in a separate ``hgrc`` file and
+incorporated by reference::
 
   [notify]
   config = /path/to/subscriptionsfile
 
-Alternatively, they can be added to Mercurial configuration files by
-setting the previous entry to an empty value.
-
-At this point, notifications should be generated but will not be sent until you
-set the ``notify.test`` entry to ``False``.
+Notifications will not be sent until the ``notify.test`` value is set
+to ``False``; see below.
 
 Notifications content can be tweaked with the following configuration entries:
 
@@ -58,23 +58,25 @@
   If ``True``, print messages to stdout instead of sending them. Default: True.
 
 notify.sources
-  Space separated list of change sources. Notifications are sent only
-  if it includes the incoming or outgoing changes source. Incoming
-  sources can be ``serve`` for changes coming from http or ssh,
-  ``pull`` for pulled changes, ``unbundle`` for changes added by
-  :hg:`unbundle` or ``push`` for changes being pushed
-  locally. Outgoing sources are the same except for ``unbundle`` which
-  is replaced by ``bundle``. Default: serve.
+  Space-separated list of change sources. Notifications are activated only
+  when a changeset's source is in this list. Sources may be:
+
+  :``serve``: changesets received via http or ssh
+  :``pull``: changesets received via ``hg pull``
+  :``unbundle``: changesets received via ``hg unbundle``
+  :``push``: changesets sent or received via ``hg push``
+  :``bundle``: changesets sent via ``hg unbundle``
+
+  Default: serve.
 
 notify.strip
   Number of leading slashes to strip from url paths. By default, notifications
-  references repositories with their absolute path. ``notify.strip`` let you
+  reference repositories with their absolute path. ``notify.strip`` lets you
   turn them into relative paths. For example, ``notify.strip=3`` will change
   ``/long/path/repository`` into ``repository``. Default: 0.
 
 notify.domain
-  If subscribers emails or the from email have no domain set, complete them
-  with this value.
+  Default email domain for sender or recipients with no explicit domain.
 
 notify.style
   Style file to use when formatting emails.
@@ -83,21 +85,21 @@
   Template to use when formatting emails.
 
 notify.incoming
-  Template to use when run as incoming hook, override ``notify.template``.
+  Template to use when run as an incoming hook, overriding ``notify.template``.
 
 notify.outgoing
-  Template to use when run as outgoing hook, override ``notify.template``.
+  Template to use when run as an outgoing hook, overriding ``notify.template``.
 
 notify.changegroup
-  Template to use when running as changegroup hook, override
+  Template to use when running as a changegroup hook, overriding
   ``notify.template``.
 
 notify.maxdiff
   Maximum number of diff lines to include in notification email. Set to 0
-  to disable the diff, -1 to include all of it. Default: 300.
+  to disable the diff, or -1 to include all of it. Default: 300.
 
 notify.maxsubject
-  Maximum number of characters in emails subject line. Default: 67.
+  Maximum number of characters in email's subject line. Default: 67.
 
 notify.diffstat
   Set to True to include a diffstat before diff content. Default: True.
@@ -109,17 +111,19 @@
   If set, append mails to this mbox file instead of sending. Default: None.
 
 notify.fromauthor
-  If set, use the first committer of the changegroup for the "From" field of
-  the notification mail. If not set, take the user from the pushing repo.
-  Default: False.
+  If set, use the committer of the first changeset in a changegroup for
+  the "From" field of the notification mail. If not set, take the user
+  from the pushing repo.  Default: False.
 
-If set, the following entries will also be used to customize the notifications:
+If set, the following entries will also be used to customize the
+notifications:
 
 email.from
-  Email ``From`` address to use if none can be found in generated email content.
+  Email ``From`` address to use if none can be found in the generated
+  email content.
 
 web.baseurl
-  Root repository browsing URL to combine with repository paths when making
+  Root repository URL to combine with repository paths when making
   references. See also ``notify.strip``.
 
 '''
--- a/hgext/patchbomb.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/patchbomb.py	Mon Jun 18 16:21:31 2012 -0300
@@ -361,7 +361,7 @@
     def getpatchmsgs(patches, patchnames=None):
         msgs = []
 
-        ui.write(_('This patch series consists of %d patches.\n\n')
+        ui.write(_('this patch series consists of %d patches.\n\n')
                  % len(patches))
 
         # build the intro message, or skip it if the user declines
@@ -526,7 +526,7 @@
         if replyto:
             m['Reply-To'] = ', '.join(replyto)
         if opts.get('test'):
-            ui.status(_('Displaying '), subj, ' ...\n')
+            ui.status(_('displaying '), subj, ' ...\n')
             ui.flush()
             if 'PAGER' in os.environ and not ui.plain():
                 fp = util.popen(os.environ['PAGER'], 'w')
@@ -544,7 +544,7 @@
         else:
             if not sendmail:
                 sendmail = mail.connect(ui, mbox=mbox)
-            ui.status(_('Sending '), subj, ' ...\n')
+            ui.status(_('sending '), subj, ' ...\n')
             ui.progress(_('sending'), i, item=subj, total=len(msgs))
             if not mbox:
                 # Exim does not remove the Bcc field
--- a/hgext/purge.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/purge.py	Mon Jun 18 16:21:31 2012 -0300
@@ -101,10 +101,10 @@
     status = repo.status(match=match, ignored=opts['all'], unknown=True)
 
     for f in sorted(status[4] + status[5]):
-        ui.note(_('Removing file %s\n') % f)
+        ui.note(_('removing file %s\n') % f)
         remove(removefile, f)
 
     for f in sorted(directories, reverse=True):
         if match(f) and not os.listdir(repo.wjoin(f)):
-            ui.note(_('Removing directory %s\n') % f)
+            ui.note(_('removing directory %s\n') % f)
             remove(os.rmdir, f)
--- a/hgext/win32text.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/hgext/win32text.py	Mon Jun 18 16:21:31 2012 -0300
@@ -130,7 +130,7 @@
             data = c[f].data()
             if not util.binary(data) and newline in data:
                 if not halt:
-                    ui.warn(_('Attempt to commit or push text file(s) '
+                    ui.warn(_('attempt to commit or push text file(s) '
                               'using %s line endings\n') %
                               newlinestr[newline])
                 ui.warn(_('in %s: %s\n') % (short(c.node()), f))
--- a/mercurial/archival.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/archival.py	Mon Jun 18 16:21:31 2012 -0300
@@ -234,8 +234,6 @@
         prefix = tidyprefix(dest, kind, prefix)
 
     def write(name, mode, islink, getdata):
-        if matchfn and not matchfn(name):
-            return
         data = getdata()
         if decode:
             data = repo.wwritedata(name, data)
@@ -265,11 +263,18 @@
 
             return base + tags
 
-        write('.hg_archival.txt', 0644, False, metadata)
+        name = '.hg_archival.txt'
+        if not matchfn or matchfn(name):
+            write(name, 0644, False, metadata)
 
-    total = len(ctx.manifest())
+    if matchfn:
+        files = [f for f in ctx.manifest().keys() if matchfn(f)]
+    else:
+        files = ctx.manifest().keys()
+    files.sort()
+    total = len(files)
     repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total)
-    for i, f in enumerate(ctx):
+    for i, f in enumerate(files):
         ff = ctx.flags(f)
         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
         repo.ui.progress(_('archiving'), i + 1, item=f,
--- a/mercurial/cmdutil.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/cmdutil.py	Mon Jun 18 16:21:31 2012 -0300
@@ -952,7 +952,7 @@
     for ctx in walkchangerevs(repo, m, {'rev': None}, prep):
         rev = ctx.rev()
         if rev in results:
-            ui.status(_("Found revision %s from %s\n") %
+            ui.status(_("found revision %s from %s\n") %
                       (rev, util.datestr(results[rev])))
             return str(rev)
 
--- a/mercurial/commands.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/commands.py	Mon Jun 18 16:21:31 2012 -0300
@@ -684,7 +684,7 @@
                 ctx = scmutil.revsingle(repo, rev, node)
                 rev = None # clear for future iterations
                 state[transition].append(ctx.node())
-                ui.status(_('Changeset %d:%s: %s\n') % (ctx, ctx, transition))
+                ui.status(_('changeset %d:%s: %s\n') % (ctx, ctx, transition))
                 check_state(state, interactive=False)
                 # bisect
                 nodes, changesets, good = hbisect.bisect(repo.changelog, state)
@@ -1973,7 +1973,7 @@
     problems = 0
 
     # encoding
-    ui.status(_("Checking encoding (%s)...\n") % encoding.encoding)
+    ui.status(_("checking encoding (%s)...\n") % encoding.encoding)
     try:
         encoding.fromlocal("test")
     except util.Abort, inst:
@@ -1982,7 +1982,7 @@
         problems += 1
 
     # compiled modules
-    ui.status(_("Checking installed modules (%s)...\n")
+    ui.status(_("checking installed modules (%s)...\n")
               % os.path.dirname(__file__))
     try:
         import bdiff, mpatch, base85, osutil
@@ -1996,7 +1996,7 @@
     # templates
     import templater
     p = templater.templatepath()
-    ui.status(_("Checking templates (%s)...\n") % ' '.join(p))
+    ui.status(_("checking templates (%s)...\n") % ' '.join(p))
     try:
         templater.templater(templater.templatepath("map-cmdline.default"))
     except Exception, inst:
@@ -2005,7 +2005,7 @@
         problems += 1
 
     # editor
-    ui.status(_("Checking commit editor...\n"))
+    ui.status(_("checking commit editor...\n"))
     editor = ui.geteditor()
     cmdpath = util.findexe(editor) or util.findexe(editor.split()[0])
     if not cmdpath:
@@ -2020,7 +2020,7 @@
             problems += 1
 
     # check username
-    ui.status(_("Checking username...\n"))
+    ui.status(_("checking username...\n"))
     try:
         ui.username()
     except util.Abort, e:
@@ -2029,7 +2029,7 @@
         problems += 1
 
     if not problems:
-        ui.status(_("No problems detected\n"))
+        ui.status(_("no problems detected\n"))
     else:
         ui.write(_("%s problems detected,"
                    " please check your install!\n") % problems)
@@ -2371,11 +2371,14 @@
     items = list(repo.walk(m))
     if not items:
         return
+    f = lambda fn: fn
+    if ui.configbool('ui', 'slash') and os.sep != '/':
+        f = lambda fn: util.normpath(fn)
     fmt = 'f  %%-%ds  %%-%ds  %%s' % (
         max([len(abs) for abs in items]),
         max([len(m.rel(abs)) for abs in items]))
     for abs in items:
-        line = fmt % (abs, m.rel(abs), m.exact(abs) and 'exact' or '')
+        line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
         ui.write("%s\n" % line.rstrip())
 
 @command('debugwireargs',
@@ -3331,7 +3334,7 @@
                          ('extensioncommands', _('Extension Commands'))):
             if matches[t]:
                 rst.append('%s:\n\n' % title)
-                rst.extend(minirst.maketable(matches[t], 1))
+                rst.extend(minirst.maketable(sorted(matches[t]), 1))
                 rst.append('\n')
     elif name and name != 'shortlist':
         i = None
@@ -5035,7 +5038,7 @@
 
     def checkrepo():
         if repo is None:
-            raise error.RepoError(_("There is no Mercurial repository here"
+            raise error.RepoError(_("there is no Mercurial repository here"
                               " (.hg not found)"))
 
     if opts["stdio"]:
@@ -5066,7 +5069,7 @@
     o = opts.get('web_conf') or opts.get('webdir_conf')
     if not o:
         if not repo:
-            raise error.RepoError(_("There is no Mercurial repository"
+            raise error.RepoError(_("there is no Mercurial repository"
                                     " here (.hg not found)"))
         o = repo.root
 
--- a/mercurial/config.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/config.py	Mon Jun 18 16:21:31 2012 -0300
@@ -7,7 +7,7 @@
 
 from i18n import _
 import error, util
-import re, os, errno
+import os, errno
 
 class sortdict(dict):
     'a simple sorted dictionary'
@@ -105,13 +105,13 @@
             self._source.pop((section, item), None)
 
     def parse(self, src, data, sections=None, remap=None, include=None):
-        sectionre = re.compile(r'\[([^\[]+)\]')
-        itemre = re.compile(r'([^=\s][^=]*?)\s*=\s*(.*\S|)')
-        contre = re.compile(r'\s+(\S|\S.*\S)\s*$')
-        emptyre = re.compile(r'(;|#|\s*$)')
-        commentre = re.compile(r'(;|#)')
-        unsetre = re.compile(r'%unset\s+(\S+)')
-        includere = re.compile(r'%include\s+(\S|\S.*\S)\s*$')
+        sectionre = util.compilere(r'\[([^\[]+)\]')
+        itemre = util.compilere(r'([^=\s][^=]*?)\s*=\s*(.*\S|)')
+        contre = util.compilere(r'\s+(\S|\S.*\S)\s*$')
+        emptyre = util.compilere(r'(;|#|\s*$)')
+        commentre = util.compilere(r'(;|#)')
+        unsetre = util.compilere(r'%unset\s+(\S+)')
+        includere = util.compilere(r'%include\s+(\S|\S.*\S)\s*$')
         section = ""
         item = None
         line = 0
--- a/mercurial/dirstate.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/dirstate.py	Mon Jun 18 16:21:31 2012 -0300
@@ -498,12 +498,24 @@
             return
         st = self._opener("dirstate", "w", atomictemp=True)
 
+        def finish(s):
+            st.write(s)
+            st.close()
+            self._lastnormaltime = 0
+            self._dirty = self._dirtypl = False
+
         # use the modification time of the newly created temporary file as the
         # filesystem's notion of 'now'
-        now = int(util.fstat(st).st_mtime)
+        now = util.fstat(st).st_mtime
+        copymap = self._copymap
+        try:
+            finish(parsers.pack_dirstate(self._map, copymap, self._pl, now))
+            return
+        except AttributeError:
+            pass
 
+        now = int(now)
         cs = cStringIO.StringIO()
-        copymap = self._copymap
         pack = struct.pack
         write = cs.write
         write("".join(self._pl))
@@ -526,10 +538,7 @@
             e = pack(_format, e[0], e[1], e[2], e[3], len(f))
             write(e)
             write(f)
-        st.write(cs.getvalue())
-        st.close()
-        self._lastnormaltime = 0
-        self._dirty = self._dirtypl = False
+        finish(cs.getvalue())
 
     def _dirignore(self, f):
         if f == '.':
--- a/mercurial/dispatch.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/dispatch.py	Mon Jun 18 16:21:31 2012 -0300
@@ -654,7 +654,7 @@
         s = get_times()
         def print_time():
             t = get_times()
-            ui.warn(_("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
+            ui.warn(_("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
                 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
         atexit.register(print_time)
 
--- a/mercurial/help.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/help.py	Mon Jun 18 16:21:31 2012 -0300
@@ -107,8 +107,11 @@
         for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
             if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
                 cmdname = cmd.split('|')[0].lstrip('^')
-                cmddoc=getattr(mod, '__doc__', '').splitlines()[0]
-                results['extensioncommands'].append((cmdname, _(cmddoc)))
+                if entry[0].__doc__:
+                    cmddoc = gettext(entry[0].__doc__).splitlines()[0]
+                else:
+                    cmddoc = _('(no help text available)')
+                results['extensioncommands'].append((cmdname, cmddoc))
     return results
 
 def loaddoc(topic):
--- a/mercurial/localrepo.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/localrepo.py	Mon Jun 18 16:21:31 2012 -0300
@@ -2230,7 +2230,7 @@
                 resp = int(l)
             except ValueError:
                 raise error.ResponseError(
-                    _('Unexpected response from remote server:'), l)
+                    _('unexpected response from remote server:'), l)
             if resp == 1:
                 raise util.Abort(_('operation forbidden by server'))
             elif resp == 2:
@@ -2243,7 +2243,7 @@
                 total_files, total_bytes = map(int, l.split(' ', 1))
             except (ValueError, TypeError):
                 raise error.ResponseError(
-                    _('Unexpected response from remote server:'), l)
+                    _('unexpected response from remote server:'), l)
             self.ui.status(_('%d files to transfer, %s of data\n') %
                            (total_files, util.bytecount(total_bytes)))
             handled_bytes = 0
@@ -2257,7 +2257,7 @@
                     size = int(size)
                 except (ValueError, TypeError):
                     raise error.ResponseError(
-                        _('Unexpected response from remote server:'), l)
+                        _('unexpected response from remote server:'), l)
                 if self.ui.debugflag:
                     self.ui.debug('adding %s (%s)\n' %
                                   (name, util.bytecount(size)))
--- a/mercurial/match.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/match.py	Mon Jun 18 16:21:31 2012 -0300
@@ -9,6 +9,14 @@
 import scmutil, util, fileset
 from i18n import _
 
+def _rematcher(pat):
+    m = util.compilere(pat)
+    try:
+        # slightly faster, provided by facebook's re2 bindings
+        return m.test_match
+    except AttributeError:
+        return m.match
+
 def _expandsets(pats, ctx):
     '''convert set: patterns into a list of files in the given context'''
     fset = set()
@@ -280,7 +288,7 @@
         pat = '(?:%s)' % '|'.join([_regex(k, p, tail) for (k, p) in pats])
         if len(pat) > 20000:
             raise OverflowError
-        return pat, re.compile(pat).match
+        return pat, _rematcher(pat)
     except OverflowError:
         # We're using a Python with a tiny regex engine and we
         # made it explode, so we'll divide the pattern list in two
@@ -294,7 +302,7 @@
     except re.error:
         for k, p in pats:
             try:
-                re.compile('(?:%s)' % _regex(k, p, tail))
+                _rematcher('(?:%s)' % _regex(k, p, tail))
             except re.error:
                 raise util.Abort(_("invalid pattern (%s): %s") % (k, p))
         raise util.Abort(_("invalid pattern"))
--- a/mercurial/parsers.c	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/parsers.c	Mon Jun 18 16:21:31 2012 -0300
@@ -214,6 +214,154 @@
 	return ret;
 }
 
+static inline int getintat(PyObject *tuple, int off, uint32_t *v)
+{
+	PyObject *o = PyTuple_GET_ITEM(tuple, off);
+	long val;
+
+	if (PyInt_Check(o))
+		val = PyInt_AS_LONG(o);
+	else if (PyLong_Check(o)) {
+		val = PyLong_AsLong(o);
+		if (val == -1 && PyErr_Occurred())
+			return -1;
+	} else {
+		PyErr_SetString(PyExc_TypeError, "expected an int or long");
+		return -1;
+	}
+	if (LONG_MAX > INT_MAX && (val > INT_MAX || val < INT_MIN)) {
+		PyErr_SetString(PyExc_OverflowError,
+				"Python value to large to convert to uint32_t");
+		return -1;
+	}
+	*v = (uint32_t)val;
+	return 0;
+}
+
+static PyObject *dirstate_unset;
+
+/*
+ * Efficiently pack a dirstate object into its on-disk format.
+ */
+static PyObject *pack_dirstate(PyObject *self, PyObject *args)
+{
+	PyObject *packobj = NULL;
+	PyObject *map, *copymap, *pl;
+	Py_ssize_t nbytes, pos, l;
+	PyObject *k, *v, *pn;
+	char *p, *s;
+	double now;
+
+	if (!PyArg_ParseTuple(args, "O!O!Od:pack_dirstate",
+			      &PyDict_Type, &map, &PyDict_Type, &copymap,
+			      &pl, &now))
+		return NULL;
+
+	if (!PySequence_Check(pl) || PySequence_Size(pl) != 2) {
+		PyErr_SetString(PyExc_TypeError, "expected 2-element sequence");
+		return NULL;
+	}
+
+	/* Figure out how much we need to allocate. */
+	for (nbytes = 40, pos = 0; PyDict_Next(map, &pos, &k, &v);) {
+		PyObject *c;
+		if (!PyString_Check(k)) {
+			PyErr_SetString(PyExc_TypeError, "expected string key");
+			goto bail;
+		}
+		nbytes += PyString_GET_SIZE(k) + 17;
+		c = PyDict_GetItem(copymap, k);
+		if (c) {
+			if (!PyString_Check(c)) {
+				PyErr_SetString(PyExc_TypeError,
+						"expected string key");
+				goto bail;
+			}
+			nbytes += PyString_GET_SIZE(c) + 1;
+		}
+	}
+
+	packobj = PyString_FromStringAndSize(NULL, nbytes);
+	if (packobj == NULL)
+		goto bail;
+
+	p = PyString_AS_STRING(packobj);
+
+	pn = PySequence_ITEM(pl, 0);
+	if (PyString_AsStringAndSize(pn, &s, &l) == -1 || l != 20) {
+		PyErr_SetString(PyExc_TypeError, "expected a 20-byte hash");
+		goto bail;
+	}
+	memcpy(p, s, l);
+	p += 20;
+	pn = PySequence_ITEM(pl, 1);
+	if (PyString_AsStringAndSize(pn, &s, &l) == -1 || l != 20) {
+		PyErr_SetString(PyExc_TypeError, "expected a 20-byte hash");
+		goto bail;
+	}
+	memcpy(p, s, l);
+	p += 20;
+
+	for (pos = 0; PyDict_Next(map, &pos, &k, &v); ) {
+		uint32_t mode, size, mtime;
+		Py_ssize_t len, l;
+		PyObject *o;
+		char *s, *t;
+		int err;
+
+		if (!PyTuple_Check(v) || PyTuple_GET_SIZE(v) != 4) {
+			PyErr_SetString(PyExc_TypeError, "expected a 4-tuple");
+			goto bail;
+		}
+		o = PyTuple_GET_ITEM(v, 0);
+		if (PyString_AsStringAndSize(o, &s, &l) == -1 || l != 1) {
+			PyErr_SetString(PyExc_TypeError, "expected one byte");
+			goto bail;
+		}
+		*p++ = *s;
+		err = getintat(v, 1, &mode);
+		err |= getintat(v, 2, &size);
+		err |= getintat(v, 3, &mtime);
+		if (err)
+			goto bail;
+		if (*s == 'n' && mtime == (uint32_t)now) {
+			/* See dirstate.py:write for why we do this. */
+			if (PyDict_SetItem(map, k, dirstate_unset) == -1)
+				goto bail;
+			mode = 0, size = -1, mtime = -1;
+		}
+		putbe32(mode, p);
+		putbe32(size, p + 4);
+		putbe32(mtime, p + 8);
+		t = p + 12;
+		p += 16;
+		len = PyString_GET_SIZE(k);
+		memcpy(p, PyString_AS_STRING(k), len);
+		p += len;
+		o = PyDict_GetItem(copymap, k);
+		if (o) {
+			*p++ = '\0';
+			l = PyString_GET_SIZE(o);
+			memcpy(p, PyString_AS_STRING(o), l);
+			p += l;
+			len += l + 1;
+		}
+		putbe32((uint32_t)len, t);
+	}
+
+	pos = p - PyString_AS_STRING(packobj);
+	if (pos != nbytes) {
+		PyErr_Format(PyExc_SystemError, "bad dirstate size: %ld != %ld",
+                             (long)pos, (long)nbytes);
+		goto bail;
+	}
+
+	return packobj;
+bail:
+	Py_XDECREF(packobj);
+	return NULL;
+}
+
 /*
  * A base-16 trie for fast node->rev mapping.
  *
@@ -1356,6 +1504,7 @@
 static char parsers_doc[] = "Efficient content parsing.";
 
 static PyMethodDef methods[] = {
+	{"pack_dirstate", pack_dirstate, METH_VARARGS, "pack a dirstate\n"},
 	{"parse_manifest", parse_manifest, METH_VARARGS, "parse a manifest\n"},
 	{"parse_dirstate", parse_dirstate, METH_VARARGS, "parse a dirstate\n"},
 	{"parse_index2", parse_index2, METH_VARARGS, "parse a revlog index\n"},
@@ -1375,6 +1524,8 @@
 				  -1, -1, -1, -1, nullid, 20);
 	if (nullentry)
 		PyObject_GC_UnTrack(nullentry);
+
+	dirstate_unset = Py_BuildValue("ciii", 'n', 0, -1, -1);
 }
 
 #ifdef IS_PY3K
--- a/mercurial/revlog.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/revlog.py	Mon Jun 18 16:21:31 2012 -0300
@@ -112,7 +112,10 @@
     if t == '\0':
         return bin
     if t == 'x':
-        return _decompress(bin)
+        try:
+            return _decompress(bin)
+        except zlib.error, e:
+            raise RevlogError(_("revlog decompress error: %s") % str(e))
     if t == 'u':
         return bin[1:]
     raise RevlogError(_("unknown compression type %r") % t)
--- a/mercurial/statichttprepo.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/statichttprepo.py	Mon Jun 18 16:21:31 2012 -0300
@@ -26,7 +26,8 @@
         end = ''
         if bytes:
             end = self.pos + bytes - 1
-        req.add_header('Range', 'bytes=%d-%s' % (self.pos, end))
+        if self.pos or end:
+            req.add_header('Range', 'bytes=%d-%s' % (self.pos, end))
 
         try:
             f = self.opener.open(req)
--- a/mercurial/ui.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/ui.py	Mon Jun 18 16:21:31 2012 -0300
@@ -64,7 +64,7 @@
             return True
 
         if self._reportuntrusted:
-            self.warn(_('Not trusting file %s from untrusted '
+            self.warn(_('not trusting file %s from untrusted '
                         'user %s, group %s\n') % (f, user, group))
         return False
 
@@ -86,7 +86,7 @@
         except error.ConfigError, inst:
             if trusted:
                 raise
-            self.warn(_("Ignored: %s\n") % str(inst))
+            self.warn(_("ignored: %s\n") % str(inst))
 
         if self.plain():
             for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
@@ -409,7 +409,7 @@
         if user is None and not self.interactive():
             try:
                 user = '%s@%s' % (util.getuser(), socket.getfqdn())
-                self.warn(_("No username found, using '%s' instead\n") % user)
+                self.warn(_("no username found, using '%s' instead\n") % user)
             except KeyError:
                 pass
         if not user:
--- a/mercurial/util.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/mercurial/util.py	Mon Jun 18 16:21:31 2012 -0300
@@ -629,6 +629,30 @@
     except OSError:
         return True
 
+try:
+    import re2
+    _re2 = None
+except ImportError:
+    _re2 = False
+
+def compilere(pat):
+    '''Compile a regular expression, using re2 if possible
+
+    For best performance, use only re2-compatible regexp features.'''
+    global _re2
+    if _re2 is None:
+        try:
+            re2.compile
+            _re2 = True
+        except ImportError:
+            _re2 = False
+    if _re2:
+        try:
+            return re2.compile(pat)
+        except re2.error:
+            pass
+    return re.compile(pat)
+
 _fspathcache = {}
 def fspath(name, root):
     '''Get name in the case stored in the filesystem
--- a/tests/hghave	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/hghave	Mon Jun 18 16:21:31 2012 -0300
@@ -4,278 +4,10 @@
 prefixed with "no-", the absence of feature is tested.
 """
 import optparse
-import os, stat
-import re
 import sys
-import tempfile
-
-tempprefix = 'hg-hghave-'
-
-def matchoutput(cmd, regexp, ignorestatus=False):
-    """Return True if cmd executes successfully and its output
-    is matched by the supplied regular expression.
-    """
-    r = re.compile(regexp)
-    fh = os.popen(cmd)
-    s = fh.read()
-    try:
-        ret = fh.close()
-    except IOError:
-        # Happen in Windows test environment
-        ret = 1
-    return (ignorestatus or ret is None) and r.search(s)
-
-def has_baz():
-    return matchoutput('baz --version 2>&1', r'baz Bazaar version')
-
-def has_bzr():
-    try:
-        import bzrlib
-        return bzrlib.__doc__ is not None
-    except ImportError:
-        return False
-
-def has_bzr114():
-    try:
-        import bzrlib
-        return (bzrlib.__doc__ is not None
-                and bzrlib.version_info[:2] >= (1, 14))
-    except ImportError:
-        return False
-
-def has_cvs():
-    re = r'Concurrent Versions System.*?server'
-    return matchoutput('cvs --version 2>&1', re) and not has_msys()
-
-def has_darcs():
-    return matchoutput('darcs --version', r'2\.[2-9]', True)
-
-def has_mtn():
-    return matchoutput('mtn --version', r'monotone', True) and not matchoutput(
-        'mtn --version', r'monotone 0\.', True)
-
-def has_eol_in_paths():
-    try:
-        fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r')
-        os.close(fd)
-        os.remove(path)
-        return True
-    except (IOError, OSError):
-        return False
-
-def has_executablebit():
-    try:
-        EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
-        fh, fn = tempfile.mkstemp(dir=".", prefix='hg-checkexec-')
-        try:
-            os.close(fh)
-            m = os.stat(fn).st_mode & 0777
-            new_file_has_exec = m & EXECFLAGS
-            os.chmod(fn, m ^ EXECFLAGS)
-            exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m)
-        finally:
-            os.unlink(fn)
-    except (IOError, OSError):
-        # we don't care, the user probably won't be able to commit anyway
-        return False
-    return not (new_file_has_exec or exec_flags_cannot_flip)
-
-def has_icasefs():
-    # Stolen from mercurial.util
-    fd, path = tempfile.mkstemp(prefix=tempprefix, dir='.')
-    os.close(fd)
-    try:
-        s1 = os.stat(path)
-        d, b = os.path.split(path)
-        p2 = os.path.join(d, b.upper())
-        if path == p2:
-            p2 = os.path.join(d, b.lower())
-        try:
-            s2 = os.stat(p2)
-            return s2 == s1
-        except OSError:
-            return False
-    finally:
-        os.remove(path)
-
-def has_inotify():
-    try:
-        import hgext.inotify.linux.watcher
-        return True
-    except ImportError:
-        return False
-
-def has_fifo():
-    return getattr(os, "mkfifo", None) is not None
-
-def has_cacheable_fs():
-    from mercurial import util
-
-    fd, path = tempfile.mkstemp(prefix=tempprefix)
-    os.close(fd)
-    try:
-        return util.cachestat(path).cacheable()
-    finally:
-        os.remove(path)
-
-def has_lsprof():
-    try:
-        import _lsprof
-        return True
-    except ImportError:
-        return False
-
-def has_gettext():
-    return matchoutput('msgfmt --version', 'GNU gettext-tools')
-
-def has_git():
-    return matchoutput('git --version 2>&1', r'^git version')
-
-def has_docutils():
-    try:
-        from docutils.core import publish_cmdline
-        return True
-    except ImportError:
-        return False
+import hghave
 
-def getsvnversion():
-    m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)')
-    if not m:
-        return (0, 0)
-    return (int(m.group(1)), int(m.group(2)))
-
-def has_svn15():
-    return getsvnversion() >= (1, 5)
-
-def has_svn13():
-    return getsvnversion() >= (1, 3)
-
-def has_svn():
-    return matchoutput('svn --version 2>&1', r'^svn, version') and \
-        matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
-
-def has_svn_bindings():
-    try:
-        import svn.core
-        version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
-        if version < (1, 4):
-            return False
-        return True
-    except ImportError:
-        return False
-
-def has_p4():
-    return (matchoutput('p4 -V', r'Rev\. P4/') and
-            matchoutput('p4d -V', r'Rev\. P4D/'))
-
-def has_symlink():
-    if getattr(os, "symlink", None) is None:
-        return False
-    name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
-    try:
-        os.symlink(".", name)
-        os.unlink(name)
-        return True
-    except (OSError, AttributeError):
-        return False
-
-def has_tla():
-    return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
-
-def has_gpg():
-    return matchoutput('gpg --version 2>&1', r'GnuPG')
-
-def has_unix_permissions():
-    d = tempfile.mkdtemp(prefix=tempprefix, dir=".")
-    try:
-        fname = os.path.join(d, 'foo')
-        for umask in (077, 007, 022):
-            os.umask(umask)
-            f = open(fname, 'w')
-            f.close()
-            mode = os.stat(fname).st_mode
-            os.unlink(fname)
-            if mode & 0777 != ~umask & 0666:
-                return False
-        return True
-    finally:
-        os.rmdir(d)
-
-def has_pyflakes():
-    return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
-                       r"<stdin>:1: 're' imported but unused",
-                       True)
-
-def has_pygments():
-    try:
-        import pygments
-        return True
-    except ImportError:
-        return False
-
-def has_outer_repo():
-    return matchoutput('hg root 2>&1', r'')
-
-def has_ssl():
-    try:
-        import ssl
-        import OpenSSL
-        OpenSSL.SSL.Context
-        return True
-    except ImportError:
-        return False
-
-def has_windows():
-    return os.name == 'nt'
-
-def has_system_sh():
-    return os.name != 'nt'
-
-def has_serve():
-    return os.name != 'nt' # gross approximation
-
-def has_tic():
-    return matchoutput('test -x "`which tic`"', '')
-
-def has_msys():
-    return os.getenv('MSYSTEM')
-
-checks = {
-    "baz": (has_baz, "GNU Arch baz client"),
-    "bzr": (has_bzr, "Canonical's Bazaar client"),
-    "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
-    "cacheable": (has_cacheable_fs, "cacheable filesystem"),
-    "cvs": (has_cvs, "cvs client/server"),
-    "darcs": (has_darcs, "darcs client"),
-    "docutils": (has_docutils, "Docutils text processing library"),
-    "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"),
-    "execbit": (has_executablebit, "executable bit"),
-    "fifo": (has_fifo, "named pipes"),
-    "gettext": (has_gettext, "GNU Gettext (msgfmt)"),
-    "git": (has_git, "git command line client"),
-    "gpg": (has_gpg, "gpg client"),
-    "icasefs": (has_icasefs, "case insensitive file system"),
-    "inotify": (has_inotify, "inotify extension support"),
-    "lsprof": (has_lsprof, "python lsprof module"),
-    "mtn": (has_mtn, "monotone client (>= 1.0)"),
-    "outer-repo": (has_outer_repo, "outer repo"),
-    "p4": (has_p4, "Perforce server and client"),
-    "pyflakes": (has_pyflakes, "Pyflakes python linter"),
-    "pygments": (has_pygments, "Pygments source highlighting library"),
-    "serve": (has_serve, "platform and python can manage 'hg serve -d'"),
-    "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
-    "svn": (has_svn, "subversion client and admin tools"),
-    "svn13": (has_svn13, "subversion client and admin tools >= 1.3"),
-    "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
-    "svn-bindings": (has_svn_bindings, "subversion python bindings"),
-    "symlink": (has_symlink, "symbolic links"),
-    "system-sh": (has_system_sh, "system() uses sh"),
-    "tic": (has_tic, "terminfo compiler"),
-    "tla": (has_tla, "GNU Arch tla client"),
-    "unix-permissions": (has_unix_permissions, "unix-style permissions"),
-    "windows": (has_windows, "Windows"),
-    "msys": (has_msys, "Windows with MSYS"),
-}
+checks = hghave.checks
 
 def list_features():
     for name, feature in checks.iteritems():
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/hghave.py	Mon Jun 18 16:21:31 2012 -0300
@@ -0,0 +1,306 @@
+import os, stat, socket
+import re
+import sys
+import tempfile
+
+tempprefix = 'hg-hghave-'
+
+def matchoutput(cmd, regexp, ignorestatus=False):
+    """Return True if cmd executes successfully and its output
+    is matched by the supplied regular expression.
+    """
+    r = re.compile(regexp)
+    fh = os.popen(cmd)
+    s = fh.read()
+    try:
+        ret = fh.close()
+    except IOError:
+        # Happen in Windows test environment
+        ret = 1
+    return (ignorestatus or ret is None) and r.search(s)
+
+def has_baz():
+    return matchoutput('baz --version 2>&1', r'baz Bazaar version')
+
+def has_bzr():
+    try:
+        import bzrlib
+        return bzrlib.__doc__ is not None
+    except ImportError:
+        return False
+
+def has_bzr114():
+    try:
+        import bzrlib
+        return (bzrlib.__doc__ is not None
+                and bzrlib.version_info[:2] >= (1, 14))
+    except ImportError:
+        return False
+
+def has_cvs():
+    re = r'Concurrent Versions System.*?server'
+    return matchoutput('cvs --version 2>&1', re) and not has_msys()
+
+def has_darcs():
+    return matchoutput('darcs --version', r'2\.[2-9]', True)
+
+def has_mtn():
+    return matchoutput('mtn --version', r'monotone', True) and not matchoutput(
+        'mtn --version', r'monotone 0\.', True)
+
+def has_eol_in_paths():
+    try:
+        fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r')
+        os.close(fd)
+        os.remove(path)
+        return True
+    except (IOError, OSError):
+        return False
+
+def has_executablebit():
+    try:
+        EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
+        fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
+        try:
+            os.close(fh)
+            m = os.stat(fn).st_mode & 0777
+            new_file_has_exec = m & EXECFLAGS
+            os.chmod(fn, m ^ EXECFLAGS)
+            exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0777) == m)
+        finally:
+            os.unlink(fn)
+    except (IOError, OSError):
+        # we don't care, the user probably won't be able to commit anyway
+        return False
+    return not (new_file_has_exec or exec_flags_cannot_flip)
+
+def has_icasefs():
+    # Stolen from mercurial.util
+    fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
+    os.close(fd)
+    try:
+        s1 = os.stat(path)
+        d, b = os.path.split(path)
+        p2 = os.path.join(d, b.upper())
+        if path == p2:
+            p2 = os.path.join(d, b.lower())
+        try:
+            s2 = os.stat(p2)
+            return s2 == s1
+        except OSError:
+            return False
+    finally:
+        os.remove(path)
+
+def has_inotify():
+    try:
+        import hgext.inotify.linux.watcher
+    except ImportError:
+        return False
+    name = tempfile.mktemp(dir='.', prefix=tempprefix)
+    sock = socket.socket(socket.AF_UNIX)
+    try:
+        sock.bind(name)
+    except socket.error, err:
+        return False
+    sock.close()
+    os.unlink(name)
+    return True
+
+def has_fifo():
+    if getattr(os, "mkfifo", None) is None:
+        return False
+    name = tempfile.mktemp(dir='.', prefix=tempprefix)
+    try:
+        os.mkfifo(name)
+        os.unlink(name)
+        return True
+    except OSError:
+        return False
+
+def has_cacheable_fs():
+    from mercurial import util
+
+    fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
+    os.close(fd)
+    try:
+        return util.cachestat(path).cacheable()
+    finally:
+        os.remove(path)
+
+def has_lsprof():
+    try:
+        import _lsprof
+        return True
+    except ImportError:
+        return False
+
+def has_gettext():
+    return matchoutput('msgfmt --version', 'GNU gettext-tools')
+
+def has_git():
+    return matchoutput('git --version 2>&1', r'^git version')
+
+def has_docutils():
+    try:
+        from docutils.core import publish_cmdline
+        return True
+    except ImportError:
+        return False
+
+def getsvnversion():
+    m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)')
+    if not m:
+        return (0, 0)
+    return (int(m.group(1)), int(m.group(2)))
+
+def has_svn15():
+    return getsvnversion() >= (1, 5)
+
+def has_svn13():
+    return getsvnversion() >= (1, 3)
+
+def has_svn():
+    return matchoutput('svn --version 2>&1', r'^svn, version') and \
+        matchoutput('svnadmin --version 2>&1', r'^svnadmin, version')
+
+def has_svn_bindings():
+    try:
+        import svn.core
+        version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
+        if version < (1, 4):
+            return False
+        return True
+    except ImportError:
+        return False
+
+def has_p4():
+    return (matchoutput('p4 -V', r'Rev\. P4/') and
+            matchoutput('p4d -V', r'Rev\. P4D/'))
+
+def has_symlink():
+    if getattr(os, "symlink", None) is None:
+        return False
+    name = tempfile.mktemp(dir='.', prefix=tempprefix)
+    try:
+        os.symlink(".", name)
+        os.unlink(name)
+        return True
+    except (OSError, AttributeError):
+        return False
+
+def has_hardlink():
+    from mercurial import util
+    fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
+    os.close(fh)
+    name = tempfile.mktemp(dir='.', prefix=tempprefix)
+    try:
+        try:
+            util.oslink(fn, name)
+            os.unlink(name)
+            return True
+        except OSError:
+            return False
+    finally:
+        os.unlink(fn)
+
+def has_tla():
+    return matchoutput('tla --version 2>&1', r'The GNU Arch Revision')
+
+def has_gpg():
+    return matchoutput('gpg --version 2>&1', r'GnuPG')
+
+def has_unix_permissions():
+    d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
+    try:
+        fname = os.path.join(d, 'foo')
+        for umask in (077, 007, 022):
+            os.umask(umask)
+            f = open(fname, 'w')
+            f.close()
+            mode = os.stat(fname).st_mode
+            os.unlink(fname)
+            if mode & 0777 != ~umask & 0666:
+                return False
+        return True
+    finally:
+        os.rmdir(d)
+
+def has_pyflakes():
+    return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
+                       r"<stdin>:1: 're' imported but unused",
+                       True)
+
+def has_pygments():
+    try:
+        import pygments
+        return True
+    except ImportError:
+        return False
+
+def has_outer_repo():
+    return matchoutput('hg root 2>&1', r'')
+
+def has_ssl():
+    try:
+        import ssl
+        import OpenSSL
+        OpenSSL.SSL.Context
+        return True
+    except ImportError:
+        return False
+
+def has_windows():
+    return os.name == 'nt'
+
+def has_system_sh():
+    return os.name != 'nt'
+
+def has_serve():
+    return os.name != 'nt' # gross approximation
+
+def has_tic():
+    return matchoutput('test -x "`which tic`"', '')
+
+def has_msys():
+    return os.getenv('MSYSTEM')
+
+checks = {
+    "true": (lambda: True, "yak shaving"),
+    "false": (lambda: False, "nail clipper"),
+    "baz": (has_baz, "GNU Arch baz client"),
+    "bzr": (has_bzr, "Canonical's Bazaar client"),
+    "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
+    "cacheable": (has_cacheable_fs, "cacheable filesystem"),
+    "cvs": (has_cvs, "cvs client/server"),
+    "darcs": (has_darcs, "darcs client"),
+    "docutils": (has_docutils, "Docutils text processing library"),
+    "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"),
+    "execbit": (has_executablebit, "executable bit"),
+    "fifo": (has_fifo, "named pipes"),
+    "gettext": (has_gettext, "GNU Gettext (msgfmt)"),
+    "git": (has_git, "git command line client"),
+    "gpg": (has_gpg, "gpg client"),
+    "hardlink": (has_hardlink, "hardlinks"),
+    "icasefs": (has_icasefs, "case insensitive file system"),
+    "inotify": (has_inotify, "inotify extension support"),
+    "lsprof": (has_lsprof, "python lsprof module"),
+    "mtn": (has_mtn, "monotone client (>= 1.0)"),
+    "outer-repo": (has_outer_repo, "outer repo"),
+    "p4": (has_p4, "Perforce server and client"),
+    "pyflakes": (has_pyflakes, "Pyflakes python linter"),
+    "pygments": (has_pygments, "Pygments source highlighting library"),
+    "serve": (has_serve, "platform and python can manage 'hg serve -d'"),
+    "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"),
+    "svn": (has_svn, "subversion client and admin tools"),
+    "svn13": (has_svn13, "subversion client and admin tools >= 1.3"),
+    "svn15": (has_svn15, "subversion client and admin tools >= 1.5"),
+    "svn-bindings": (has_svn_bindings, "subversion python bindings"),
+    "symlink": (has_symlink, "symbolic links"),
+    "system-sh": (has_system_sh, "system() uses sh"),
+    "tic": (has_tic, "terminfo compiler"),
+    "tla": (has_tla, "GNU Arch tla client"),
+    "unix-permissions": (has_unix_permissions, "unix-style permissions"),
+    "windows": (has_windows, "Windows"),
+    "msys": (has_msys, "Windows with MSYS"),
+}
--- a/tests/printenv.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/printenv.py	Mon Jun 18 16:21:31 2012 -0300
@@ -32,13 +32,15 @@
 
 # variables with empty values may not exist on all platforms, filter
 # them now for portability sake.
-env = [k for k, v in os.environ.iteritems()
+env = [(k, v) for k, v in os.environ.iteritems()
        if k.startswith("HG_") and v]
 env.sort()
 
 out.write("%s hook: " % name)
-for v in env:
-    out.write("%s=%s " % (v, os.environ[v]))
+for k, v in env:
+    if os.name == 'nt':
+        v = v.replace('\\', '/')
+    out.write("%s=%s " % (k, v))
 out.write("\n")
 out.close()
 
--- a/tests/run-tests.py	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/run-tests.py	Mon Jun 18 16:21:31 2012 -0300
@@ -599,8 +599,9 @@
 
     def hghave(reqs):
         # TODO: do something smarter when all other uses of hghave is gone
+        tdir = TESTDIR.replace('\\', '/')
         proc = Popen4('%s -c "%s/hghave %s"' %
-                      (options.shell, TESTDIR, ' '.join(reqs)), TESTDIR, 0)
+                      (options.shell, tdir, ' '.join(reqs)), wd, 0)
         proc.communicate()
         ret = proc.wait()
         if wifexited(ret):
@@ -658,6 +659,9 @@
             prepos = pos
             pos = n
             addsalt(n, False)
+            cmd = l[4:].split()
+            if len(cmd) == 2 and cmd[0] == 'cd':
+                l = '  $ cd %s || exit 1\n' % cmd[1]
             script.append(l[4:])
         elif l.startswith('  > '): # continuations
             after.setdefault(prepos, []).append(l)
@@ -909,7 +913,7 @@
 
     # Make a tmp subdirectory to work in
     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
-        os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
+        os.path.join(HGTMP, os.path.basename(test))
 
     replacements = [
         (r':%s\b' % options.port, ':$HGPORT'),
@@ -1229,7 +1233,7 @@
             del os.environ[k]
 
     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
-    TESTDIR = os.environ["TESTDIR"] = os.getcwd().replace('\\', '/')
+    TESTDIR = os.environ["TESTDIR"] = os.getcwd()
     if options.tmpdir:
         options.keep_tmpdir = True
         tmpdir = options.tmpdir
@@ -1246,7 +1250,12 @@
             #shutil.rmtree(tmpdir)
         os.makedirs(tmpdir)
     else:
-        tmpdir = tempfile.mkdtemp('', 'hgtests.')
+        d = None
+        if os.name == 'nt':
+            # without this, we get the default temp dir location, but
+            # in all lowercase, which causes troubles with paths (issue3490)
+            d = os.getenv('TMP')
+        tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
     DAEMON_PIDS = None
     HGRCPATH = None
--- a/tests/test-1102.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-1102.t	Mon Jun 18 16:21:31 2012 -0300
@@ -14,3 +14,4 @@
   tip                                3:a49829c4fc11
   t1                                 0:f7b1eb17ad24
 
+  $ cd ..
--- a/tests/test-1993.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-1993.t	Mon Jun 18 16:21:31 2012 -0300
@@ -44,3 +44,5 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     Added tag default for changeset f7b1eb17ad24
   
+
+  $ cd ..
--- a/tests/test-586.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-586.t	Mon Jun 18 16:21:31 2012 -0300
@@ -89,3 +89,4 @@
   src/b
   tst/a
 
+  $ cd ..
--- a/tests/test-abort-checkin.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-abort-checkin.t	Mon Jun 18 16:21:31 2012 -0300
@@ -31,3 +31,5 @@
   rollback completed
   abort: no commits allowed
   [255]
+
+  $ cd ..
--- a/tests/test-acl.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-acl.t	Mon Jun 18 16:21:31 2012 -0300
@@ -70,9 +70,6 @@
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ echo '[extensions]' >> $HGRCPATH
-  $ echo 'acl =' >> $HGRCPATH
-
   $ config=b/.hg/hgrc
 
 Extension disabled for lack of a hook
@@ -1922,3 +1919,155 @@
   no rollback information available
   2:fb35475503ef
   
+User 'astro' must not be denied
+
+  $ init_config
+  $ echo "[acl.deny.branches]" >> $config
+  $ echo "default = !astro" >> $config
+  $ do_push astro
+  Pushing as user astro
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.deny.branches]
+  default = !astro
+  """
+  pushing to ../b
+  query 1; heads
+  searching for changes
+  all remote heads known locally
+  4 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
+  adding changesets
+  bundling: 1/4 changesets (25.00%)
+  bundling: 2/4 changesets (50.00%)
+  bundling: 3/4 changesets (75.00%)
+  bundling: 4/4 changesets (100.00%)
+  bundling: 1/4 manifests (25.00%)
+  bundling: 2/4 manifests (50.00%)
+  bundling: 3/4 manifests (75.00%)
+  bundling: 4/4 manifests (100.00%)
+  bundling: abc.txt 1/4 files (25.00%)
+  bundling: foo/Bar/file.txt 2/4 files (50.00%)
+  bundling: foo/file.txt 3/4 files (75.00%)
+  bundling: quux/file.py 4/4 files (100.00%)
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  changesets: 4 chunks
+  add changeset e8fc755d4d82
+  adding manifests
+  manifests: 1/4 chunks (25.00%)
+  manifests: 2/4 chunks (50.00%)
+  manifests: 3/4 chunks (75.00%)
+  manifests: 4/4 chunks (100.00%)
+  adding file changes
+  adding abc.txt revisions
+  files: 1/4 chunks (25.00%)
+  adding foo/Bar/file.txt revisions
+  files: 2/4 chunks (50.00%)
+  adding foo/file.txt revisions
+  files: 3/4 chunks (75.00%)
+  adding quux/file.py revisions
+  files: 4/4 chunks (100.00%)
+  added 4 changesets with 4 changes to 4 files (+1 heads)
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: checking access for user "astro"
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches enabled, 0 entries for user astro
+  acl: acl.allow not enabled
+  acl: acl.deny not enabled
+  acl: branch access granted: "ef1ea85a6374" on branch "default"
+  acl: path access granted: "ef1ea85a6374"
+  acl: branch access granted: "f9cafe1212c8" on branch "default"
+  acl: path access granted: "f9cafe1212c8"
+  acl: branch access granted: "911600dab2ae" on branch "default"
+  acl: path access granted: "911600dab2ae"
+  acl: branch access granted: "e8fc755d4d82" on branch "foobar"
+  acl: path access granted: "e8fc755d4d82"
+  updating the branch cache
+  checking for updated bookmarks
+  repository tip rolled back to revision 2 (undo push)
+  2:fb35475503ef
+  
+
+Non-astro users must be denied
+
+  $ do_push george
+  Pushing as user george
+  hgrc = """
+  [acl]
+  sources = push
+  [extensions]
+  [acl.deny.branches]
+  default = !astro
+  """
+  pushing to ../b
+  query 1; heads
+  searching for changes
+  all remote heads known locally
+  invalidating branch cache (tip differs)
+  4 changesets found
+  list of changesets:
+  ef1ea85a6374b77d6da9dcda9541f498f2d17df7
+  f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
+  911600dab2ae7a9baff75958b84fe606851ce955
+  e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
+  adding changesets
+  bundling: 1/4 changesets (25.00%)
+  bundling: 2/4 changesets (50.00%)
+  bundling: 3/4 changesets (75.00%)
+  bundling: 4/4 changesets (100.00%)
+  bundling: 1/4 manifests (25.00%)
+  bundling: 2/4 manifests (50.00%)
+  bundling: 3/4 manifests (75.00%)
+  bundling: 4/4 manifests (100.00%)
+  bundling: abc.txt 1/4 files (25.00%)
+  bundling: foo/Bar/file.txt 2/4 files (50.00%)
+  bundling: foo/file.txt 3/4 files (75.00%)
+  bundling: quux/file.py 4/4 files (100.00%)
+  changesets: 1 chunks
+  add changeset ef1ea85a6374
+  changesets: 2 chunks
+  add changeset f9cafe1212c8
+  changesets: 3 chunks
+  add changeset 911600dab2ae
+  changesets: 4 chunks
+  add changeset e8fc755d4d82
+  adding manifests
+  manifests: 1/4 chunks (25.00%)
+  manifests: 2/4 chunks (50.00%)
+  manifests: 3/4 chunks (75.00%)
+  manifests: 4/4 chunks (100.00%)
+  adding file changes
+  adding abc.txt revisions
+  files: 1/4 chunks (25.00%)
+  adding foo/Bar/file.txt revisions
+  files: 2/4 chunks (50.00%)
+  adding foo/file.txt revisions
+  files: 3/4 chunks (75.00%)
+  adding quux/file.py revisions
+  files: 4/4 chunks (100.00%)
+  added 4 changesets with 4 changes to 4 files (+1 heads)
+  calling hook pretxnchangegroup.acl: hgext.acl.hook
+  acl: checking access for user "george"
+  acl: acl.allow.branches not enabled
+  acl: acl.deny.branches enabled, 1 entries for user george
+  acl: acl.allow not enabled
+  acl: acl.deny not enabled
+  error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
+  transaction abort!
+  rollback completed
+  abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
+  no rollback information available
+  2:fb35475503ef
+  
+
--- a/tests/test-add.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-add.t	Mon Jun 18 16:21:31 2012 -0300
@@ -51,6 +51,11 @@
   A a
   A b
   A con.xml
+  $ hg forget con.xml
+  $ rm con.xml
+#endif
+
+#if eol-in-paths
   $ echo bla > 'hello:world'
   $ hg --config ui.portablefilenames=abort add
   adding hello:world
@@ -59,14 +64,12 @@
   $ hg st
   A a
   A b
-  A con.xml
   ? hello:world
   $ hg --config ui.portablefilenames=ignore add
   adding hello:world
   $ hg st
   A a
   A b
-  A con.xml
   A hello:world
 #endif
 
@@ -134,3 +137,4 @@
   A c
   ? a.orig
 
+  $ cd ..
--- a/tests/test-addremove-similar.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-addremove-similar.t	Mon Jun 18 16:21:31 2012 -0300
@@ -98,3 +98,5 @@
   $ hg addremove -s80
   adding c
   recording removal of d/a as rename to c (100% similar) (glob)
+
+  $ cd ..
--- a/tests/test-addremove.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-addremove.t	Mon Jun 18 16:21:31 2012 -0300
@@ -18,8 +18,8 @@
   dir/bar_2
   foo_2
   committed changeset 1:e65414bf35c5
+  $ cd ../..
 
-  $ cd ..
   $ hg init sim
   $ cd sim
   $ echo a > a
@@ -45,3 +45,4 @@
   adding d
   recording removal of a as rename to b (100% similar)
   $ hg commit -mb
+  $ cd ..
--- a/tests/test-alias.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-alias.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
   $ HGFOO=BAR; export HGFOO
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
@@ -26,14 +24,14 @@
   > dln = lognull --debug
   > nousage = rollback
   > put = export -r 0 -o "\$FOO/%R.diff"
-  > blank = !echo
-  > self = !echo '\$0'
-  > echo = !echo '\$@'
-  > echo1 = !echo '\$1'
-  > 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'
+  > blank = !printf '\n'
+  > self = !printf '\$0\n'
+  > echoall = !printf '\$@\n'
+  > echo1 = !printf '\$1\n'
+  > echo2 = !printf '\$2\n'
+  > echo13 = !printf '\$1 \$3\n'
+  > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
+  > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
   > rt = root
   > tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
   > idalias = id
@@ -41,10 +39,10 @@
   > idaliasshell = !echo test
   > parentsshell1 = !echo one
   > parentsshell2 = !echo two
-  > escaped1 = !echo 'test\$\$test'
-  > escaped2 = !echo "HGFOO is \$\$HGFOO"
-  > escaped3 = !echo "\$1 is \$\$\$1"
-  > escaped4 = !echo '\$\$0' '\$\$@'
+  > escaped1 = !printf 'test\$\$test\n'
+  > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
+  > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
+  > escaped4 = !printf '\$\$0 \$\$@\n'
   > 
   > [defaults]
   > mylog = -q
@@ -200,11 +198,11 @@
   
   $ hg self
   self
-  $ hg echo
+  $ hg echoall
   
-  $ hg echo foo
+  $ hg echoall foo
   foo
-  $ hg echo 'test $2' foo
+  $ hg echoall 'test $2' foo
   test $2 foo
   $ hg echo1 foo bar baz
   foo
@@ -270,7 +268,7 @@
   0
   $ hg --cwd .. count 'branch(default)'
   2
-  $ hg echo --cwd ..
+  $ hg echoall --cwd ..
   
 
 
@@ -278,11 +276,11 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [alias]
-  > subalias = !echo sub \$@
+  > subalias = !echo sub
   > EOF
   $ cat >> ../.hg/hgrc <<EOF
   > [alias]
-  > mainalias = !echo main \$@
+  > mainalias = !echo main
   > EOF
 
 
@@ -424,3 +422,5 @@
 This shouldn't:
 
   $ hg --config alias.log='id' history
+
+  $ cd ../..
--- a/tests/test-annotate.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-annotate.t	Mon Jun 18 16:21:31 2012 -0300
@@ -319,3 +319,4 @@
   1:  
   1: b  b
 
+  $ cd ..
--- a/tests/test-archive-symlinks.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-archive-symlinks.t	Mon Jun 18 16:21:31 2012 -0300
@@ -36,3 +36,5 @@
   $ cd zip
   $ "$TESTDIR/readlink.py" dangling
   dangling -> nothing
+
+  $ cd ..
--- a/tests/test-archive.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-archive.t	Mon Jun 18 16:21:31 2012 -0300
@@ -102,7 +102,10 @@
   test/baz/bletch
   test/foo
 
-  $ hg archive -t tbz2 -X baz test.tar.bz2
+  $ hg archive --debug -t tbz2 -X baz test.tar.bz2
+  archiving: 0/2 files (0.00%)
+  archiving: bar 1/2 files (50.00%)
+  archiving: foo 2/2 files (100.00%)
   $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null
   test/.hg_archival.txt
   test/bar
@@ -265,3 +268,5 @@
   *0*80*00:00*old/old (glob)
   *-----* (glob)
   \s*147\s+2 files (re)
+
+  $ cd ..
--- a/tests/test-audit-path.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-audit-path.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,28 +1,24 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ hg init
 
-should fail
+audit of .hg
 
   $ hg add .hg/00changelog.i
   abort: path contains illegal component: .hg/00changelog.i (glob)
   [255]
 
+#if symlink
+
+Symlinks
+
   $ mkdir a
   $ echo a > a/a
   $ hg ci -Ama
   adding a/a
   $ ln -s a b
   $ echo b > a/b
-
-should fail
-
   $ hg add b/b
   abort: path 'b/b' traverses symbolic link 'b' (glob)
   [255]
-
-should succeed
-
   $ hg add b
 
 should still fail - maybe
@@ -31,6 +27,9 @@
   abort: path 'b/b' traverses symbolic link 'b' (glob)
   [255]
 
+#endif
+
+
 unbundle tampered bundle
 
   $ hg init target
@@ -47,7 +46,7 @@
   $ hg manifest -r0
   .hg/test
   $ hg update -Cr0
-  abort: path contains illegal component: .hg/test
+  abort: path contains illegal component: .hg/test (glob)
   [255]
 
 attack foo/.hg/test
@@ -55,7 +54,7 @@
   $ hg manifest -r1
   foo/.hg/test
   $ hg update -Cr1
-  abort: path 'foo/.hg/test' is inside nested repo 'foo'
+  abort: path 'foo/.hg/test' is inside nested repo 'foo' (glob)
   [255]
 
 attack back/test where back symlinks to ..
@@ -63,16 +62,23 @@
   $ hg manifest -r2
   back
   back/test
+#if symlink
   $ hg update -Cr2
   abort: path 'back/test' traverses symbolic link 'back'
   [255]
+#else
+('back' will be a file and cause some other system specific error)
+  $ hg update -Cr2
+  abort: * (glob)
+  [255]
+#endif
 
 attack ../test
 
   $ hg manifest -r3
   ../test
   $ hg update -Cr3
-  abort: path contains illegal component: ../test
+  abort: path contains illegal component: ../test (glob)
   [255]
 
 attack /tmp/test
@@ -82,3 +88,5 @@
   $ hg update -Cr4
   abort: *: $TESTTMP/target//tmp/test (glob)
   [255]
+
+  $ cd ..
--- a/tests/test-backout.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-backout.t	Mon Jun 18 16:21:31 2012 -0300
@@ -117,6 +117,8 @@
   line 2
   line 3
 
+  $ cd ..
+
 backout should not back out subsequent changesets
 
   $ hg init onecs
@@ -288,3 +290,5 @@
   $ hg st -A
   C default
   C file1
+
+  $ cd ..
--- a/tests/test-basic.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-basic.t	Mon Jun 18 16:21:31 2012 -0300
@@ -53,3 +53,5 @@
   1 files, 1 changesets, 1 total revisions
 
 At the end...
+
+  $ cd ..
--- a/tests/test-bheads.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bheads.t	Mon Jun 18 16:21:31 2012 -0300
@@ -372,3 +372,4 @@
   $ hg merge -q 3
   $ hg ci -m "b12 (HH): merging two heads"
 
+  $ cd ..
--- a/tests/test-bisect.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bisect.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
   $ hg init
 
 
@@ -461,12 +459,12 @@
   $ hg bisect --bad 0
   Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ hg bisect --command "'`pwd`/script.py' and some parameters"
-  Changeset 15:e7fa0811edb0: good
-  Changeset 7:03750880c6b5: good
-  Changeset 3:b53bea5e2fcb: bad
-  Changeset 5:7874a09ea728: bad
-  Changeset 6:a3d5c6fdf0d3: good
+  $ hg bisect --command "python \"$TESTTMP/script.py\" and some parameters"
+  changeset 15:e7fa0811edb0: good
+  changeset 7:03750880c6b5: good
+  changeset 3:b53bea5e2fcb: bad
+  changeset 5:7874a09ea728: bad
+  changeset 6:a3d5c6fdf0d3: good
   The first good revision is:
   changeset:   6:a3d5c6fdf0d3
   user:        test
@@ -494,12 +492,12 @@
   $ hg bisect --good tip --noupdate
   $ hg bisect --bad 0 --noupdate
   Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
-  $ hg bisect --command "'`pwd`/script.sh' and some params" --noupdate
-  Changeset 15:e7fa0811edb0: good
-  Changeset 7:03750880c6b5: good
-  Changeset 3:b53bea5e2fcb: bad
-  Changeset 5:7874a09ea728: bad
-  Changeset 6:a3d5c6fdf0d3: good
+  $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate
+  changeset 15:e7fa0811edb0: good
+  changeset 7:03750880c6b5: good
+  changeset 3:b53bea5e2fcb: bad
+  changeset 5:7874a09ea728: bad
+  changeset 6:a3d5c6fdf0d3: good
   The first good revision is:
   changeset:   6:a3d5c6fdf0d3
   user:        test
--- a/tests/test-bookmarks-pushpull.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bookmarks-pushpull.t	Mon Jun 18 16:21:31 2012 -0300
@@ -252,3 +252,5 @@
      foobar                    1:9b140be10808
 
   $ kill `cat ../hg.pid`
+
+  $ cd ..
--- a/tests/test-branch-tag-confict.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-branch-tag-confict.t	Mon Jun 18 16:21:31 2012 -0300
@@ -61,3 +61,5 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     Create a branch with the same name as a tag.
   
+
+  $ cd ..
--- a/tests/test-branches.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-branches.t	Mon Jun 18 16:21:31 2012 -0300
@@ -408,3 +408,5 @@
   \x1b[0;34mc\x1b[0m \x1b[0;36m                            14:f894c25619d3\x1b[0m (closed) (esc)
   \x1b[0;35ma\x1b[0m \x1b[0;36m                             5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
   \x1b[0;35mdefault\x1b[0m \x1b[0;36m                       0:19709c5a4e75\x1b[0m (inactive) (esc)
+
+  $ cd ..
--- a/tests/test-bundle-r.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bundle-r.t	Mon Jun 18 16:21:31 2012 -0300
@@ -324,3 +324,5 @@
   crosschecking files in changesets and manifests
   checking files
   4 files, 10 changesets, 7 total revisions
+
+  $ cd ..
--- a/tests/test-bundle-vs-outgoing.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bundle-vs-outgoing.t	Mon Jun 18 16:21:31 2012 -0300
@@ -142,3 +142,4 @@
   $ hg bundle --base 3 foo.bundle
   5 changesets found
 
+  $ cd ..
--- a/tests/test-bundle.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-bundle.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
 Setting up test
 
   $ hg init test
@@ -207,8 +205,8 @@
 
 Pull ../full.hg into empty (with hook)
 
-  $ echo '[hooks]' >> .hg/hgrc
-  $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
+  $ echo "[hooks]" >> .hg/hgrc
+  $ echo "changegroup = python \"$TESTDIR\"/printenv.py changegroup" >> .hg/hgrc
 
 doesn't work (yet ?)
 
@@ -386,7 +384,7 @@
 Outgoing -R does-not-exist.hg vs partial2 in partial
 
   $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
-  abort: *: ../does-not-exist.hg (glob)
+  abort: *../does-not-exist.hg* (glob)
   [255]
   $ cd ..
 
@@ -598,3 +596,5 @@
   crosschecking files in changesets and manifests
   checking files
   4 files, 3 changesets, 5 total revisions
+
+  $ cd ..
--- a/tests/test-changelog-exec.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-changelog-exec.t	Mon Jun 18 16:21:31 2012 -0300
@@ -51,3 +51,5 @@
   $ hg debugindex bar
      rev    offset  length   base linkrev nodeid       p1           p2
        0         0       5      0       1 b004912a8510 000000000000 000000000000
+
+  $ cd ..
--- a/tests/test-children.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-children.t	Mon Jun 18 16:21:31 2012 -0300
@@ -121,3 +121,5 @@
   date:        Thu Jan 01 00:00:02 1970 +0000
   summary:     2
   
+
+  $ cd ..
--- a/tests/test-churn.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-churn.t	Mon Jun 18 16:21:31 2012 -0300
@@ -158,3 +158,5 @@
   user4@x.com      2 *****************************
   user2            2 *****************************
   with space       1 **************
+
+  $ cd ..
--- a/tests/test-clone-pull-corruption.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-clone-pull-corruption.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
 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.
 
@@ -17,8 +15,8 @@
 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
+  $ echo "[hooks]" >> .hg/hgrc
+  $ echo "pretxncommit = sh -c 'sleep 5; exit 1'" >> .hg/hgrc
 
 start a commit...
 
@@ -50,3 +48,5 @@
   crosschecking files in changesets and manifests
   checking files
   1 files, 2 changesets, 2 total revisions
+
+  $ cd ..
--- a/tests/test-clone.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-clone.t	Mon Jun 18 16:21:31 2012 -0300
@@ -48,8 +48,13 @@
 
 No update, with debug option:
 
+#if hardlink
   $ hg --debug clone -U . ../c
   linked 8 files
+#else
+  $ hg --debug clone -U . ../c
+  copied 8 files
+#endif
   $ cd ../c
   $ cat a 2>/dev/null || echo "a not present"
   a not present
@@ -503,16 +508,17 @@
 #endif
 
 
+#if fifo
+
 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!"
-  > fi
+  $ mkfifo a
+  $ hg clone a b
   abort: repository a not found!
+  [255]
+  $ rm a
+
+#endif
 
 Default destination, same directory
 
--- a/tests/test-command-template.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-command-template.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
   $ hg init a
   $ cd a
   $ echo a > a
@@ -444,11 +442,13 @@
 
 Error if style not readable:
 
+#if unix-permissions
   $ touch q
   $ chmod 0 q
   $ hg log --style ./q
   abort: Permission denied: ./q
   [255]
+#endif
 
 Error if no style:
 
@@ -466,13 +466,15 @@
 Error if include fails:
 
   $ echo 'changeset = q' >> t
+#if unix-permissions
   $ hg log --style ./t
   abort: template file ./q: Permission denied
   [255]
+  $ rm q
+#endif
 
 Include works:
 
-  $ rm q
   $ echo '{rev}' > q
   $ hg log --style ./t
   8
--- a/tests/test-commit-amend.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-commit-amend.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
   $ hg init
 
 Setup:
@@ -29,7 +27,7 @@
 
   $ echo a >> a
   $ hg ci --amend -m 'amend base1'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-amend-backup.hg (glob)
   $ hg diff -c .
   diff -r ad120869acf0 -r 9cd25b479c51 a
   --- a/a	Thu Jan 01 00:00:00 1970 +0000
@@ -56,13 +54,13 @@
   $ echo b > b
   $ hg ci --amend -Am 'amend base1 new file'
   adding b
-  saved backup bundle to $TESTTMP/.hg/strip-backup/9cd25b479c51-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/9cd25b479c51-amend-backup.hg (glob)
 
 Remove file that was added in amended commit:
 
   $ hg rm b
   $ hg ci --amend -m 'amend base1 remove new file'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/e2bb3ecffd2f-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/e2bb3ecffd2f-amend-backup.hg (glob)
 
   $ hg cat b
   b: no such file in rev 664a9b2d60cd
@@ -76,7 +74,7 @@
   a
   stripping amended changeset 664a9b2d60cd
   1 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/664a9b2d60cd-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/664a9b2d60cd-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
@@ -113,10 +111,10 @@
 Test -u/-d:
 
   $ hg ci --amend -u foo -d '1 0'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ea6e356ff2ad-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/ea6e356ff2ad-amend-backup.hg (glob)
   $ echo a >> a
   $ hg ci --amend -u foo -d '1 0'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/377b91ce8b56-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/377b91ce8b56-amend-backup.hg (glob)
   $ hg log -r .
   changeset:   1:2c94e4a5756f
   tag:         tip
@@ -127,13 +125,12 @@
 
 Open editor with old commit message if a message isn't given otherwise:
 
-  $ cat > editor << '__EOF__'
+  $ cat > editor.sh << '__EOF__'
   > #!/bin/sh
   > cat $1
   > echo "another precious commit message" > "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
   amending changeset 2c94e4a5756f
   copying changeset 2c94e4a5756f to ad120869acf0
   no changes, new message
@@ -148,7 +145,7 @@
   a
   stripping amended changeset 2c94e4a5756f
   1 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/2c94e4a5756f-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/2c94e4a5756f-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
@@ -160,7 +157,7 @@
 Same, but with changes in working dir (different code path):
 
   $ echo a >> a
-  $ HGEDITOR="'`pwd`'"/editor hg commit --amend -v
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
   amending changeset ffb49186f961
   another precious commit message
   
@@ -177,7 +174,7 @@
   stripping intermediate changeset 27f3aacd3011
   stripping amended changeset ffb49186f961
   2 changesets found
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ffb49186f961-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/ffb49186f961-amend-backup.hg (glob)
   1 changesets found
   adding branch
   adding changesets
@@ -186,7 +183,7 @@
   added 1 changesets with 1 changes to 1 files
   committed changeset 1:fb6cca43446f
 
-  $ rm editor
+  $ rm editor.sh
   $ hg log -r .
   changeset:   1:fb6cca43446f
   tag:         tip
@@ -200,13 +197,13 @@
   $ hg book book1
   $ hg book book2
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/fb6cca43446f-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/fb6cca43446f-amend-backup.hg (glob)
   $ hg book
      book1                     1:0cf1c7a51bcf
    * book2                     1:0cf1c7a51bcf
   $ echo a >> a
   $ hg ci --amend -m 'move bookmarks'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/0cf1c7a51bcf-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/0cf1c7a51bcf-amend-backup.hg (glob)
   $ hg book
      book1                     1:7344472bd951
    * book2                     1:7344472bd951
@@ -225,7 +222,7 @@
   marked working directory as branch default
   (branches are permanent and global, did you want a bookmark?)
   $ hg ci --amend -m 'back to default'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/1661ca36a2db-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/1661ca36a2db-amend-backup.hg (glob)
   $ hg branches
   default                        2:f24ee5961967
 
@@ -241,7 +238,7 @@
   $ echo b >> b
   $ hg ci -mb
   $ hg ci --amend --close-branch -m 'closing branch foo'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-amend-backup.hg (glob)
 
 Same thing, different code path:
 
@@ -250,7 +247,7 @@
   reopening closed branch head 4
   $ echo b >> b
   $ hg ci --amend --close-branch
-  saved backup bundle to $TESTTMP/.hg/strip-backup/5e302dcc12b8-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/5e302dcc12b8-amend-backup.hg (glob)
   $ hg branches
   default                        2:f24ee5961967
 
@@ -274,7 +271,7 @@
   $ hg ci -m 'b -> c'
   $ hg mv c d
   $ hg ci --amend -m 'b -> d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/9c207120aa98-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/9c207120aa98-amend-backup.hg (glob)
   $ hg st --rev '.^' --copies d
   A d
     b
@@ -282,7 +279,7 @@
   $ hg ci -m 'e = d'
   $ hg cp e f
   $ hg ci --amend -m 'f = d'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/fda2b3b27b22-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/fda2b3b27b22-amend-backup.hg (glob)
   $ hg st --rev '.^' --copies f
   A f
     d
@@ -293,7 +290,7 @@
   $ hg cp a f
   $ mv f.orig f
   $ hg ci --amend -m replacef
-  saved backup bundle to $TESTTMP/.hg/strip-backup/20a7413547f9-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/20a7413547f9-amend-backup.hg (glob)
   $ hg st --change . --copies
   $ hg log -r . --template "{file_copies}\n"
   
@@ -305,7 +302,7 @@
   adding g
   $ hg mv g h
   $ hg ci --amend
-  saved backup bundle to $TESTTMP/.hg/strip-backup/5daa77a5d616-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/5daa77a5d616-amend-backup.hg (glob)
   $ hg st --change . --copies h
   A h
   $ hg log -r . --template "{file_copies}\n"
@@ -325,11 +322,11 @@
   $ echo a >> a
   $ hg ci -ma
   $ hg ci --amend -m "a'"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/167f8e3031df-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/167f8e3031df-amend-backup.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
   $ hg ci --amend -m "a''"
-  saved backup bundle to $TESTTMP/.hg/strip-backup/ceac1a44c806-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/ceac1a44c806-amend-backup.hg (glob)
   $ hg log -r . --template "{branch}\n"
   a
 
@@ -346,7 +343,7 @@
   $ hg graft 12
   grafting revision 12
   $ hg ci --amend -m 'graft amend'
-  saved backup bundle to $TESTTMP/.hg/strip-backup/18a5124daf7a-amend-backup.hg
+  saved backup bundle to $TESTTMP/.hg/strip-backup/18a5124daf7a-amend-backup.hg (glob)
   $ hg log -r . --debug | grep extra
   extra:       branch=a
   extra:       source=2647734878ef0236dda712fae9c1651cf694ea8a
--- a/tests/test-commit-multiple.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-commit-multiple.t	Mon Jun 18 16:21:31 2012 -0300
@@ -129,3 +129,5 @@
   5  fix 2  bugfix file1
   6  x  bugfix file1
   7  y  file1
+
+  $ cd ..
--- a/tests/test-commit-unresolved.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-commit-unresolved.t	Mon Jun 18 16:21:31 2012 -0300
@@ -45,3 +45,5 @@
 
   $ hg resolve -m A
   $ hg commit -m "Merged"
+
+  $ cd ..
--- a/tests/test-commit.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-commit.t	Mon Jun 18 16:21:31 2012 -0300
@@ -222,7 +222,6 @@
 
 Issue1049: Hg permits partial commit of merge without warning
 
-  $ cd ..
   $ hg init issue1049
   $ cd issue1049
   $ echo a > a
@@ -304,3 +303,5 @@
      rev    offset  length   base linkrev nodeid       p1           p2
        0         0       6      0       0 26d3ca0dfd18 000000000000 000000000000
        1         6       7      1       1 d267bddd54f7 26d3ca0dfd18 000000000000
+
+  $ cd ..
--- a/tests/test-committer.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-committer.t	Mon Jun 18 16:21:31 2012 -0300
@@ -53,7 +53,7 @@
   [255]
   $ rm .hg/hgrc
   $ hg commit -m commit-1 2>&1
-  No username found, using '[^']*' instead (re)
+  no username found, using '[^']*' instead (re)
 
   $ echo space > asdf
   $ hg commit -u ' ' -m commit-1
@@ -61,3 +61,5 @@
   rollback completed
   abort: empty username!
   [255]
+
+  $ cd ..
--- a/tests/test-contrib.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-contrib.t	Mon Jun 18 16:21:31 2012 -0300
@@ -104,6 +104,8 @@
   [1]
 
 
+#if hardlink
+
 Test shrink-revlog:
   $ cd repo-a
   $ hg --config extensions.shrink="$CONTRIBDIR/shrink-revlog.py" shrink
@@ -127,6 +129,8 @@
   1 files, 3 changesets, 3 total revisions
   $ cd ..
 
+#endif
+
 Test simplemerge command:
 
   $ cp "$CONTRIBDIR/simplemerge" .
--- a/tests/test-convert-authormap.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-authormap.t	Mon Jun 18 16:21:31 2012 -0300
@@ -22,12 +22,12 @@
   > 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
+  ignoring bad line in author map file authormap.txt: this line is ignored
   scanning source...
   sorting...
   converting...
   0 foo
-  Writing author map file $TESTTMP/new/.hg/authormap (glob)
+  writing author map file $TESTTMP/new/.hg/authormap (glob)
   $ cat new/.hg/authormap
   user name=Long User Name
   $ hg -Rnew log
@@ -44,7 +44,7 @@
   $ hg init new
   $ mv authormap.txt new/.hg/authormap
   $ hg convert orig new
-  Ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored (glob)
+  ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored (glob)
   scanning source...
   sorting...
   converting...
--- a/tests/test-convert-baz.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-baz.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" baz || exit 80
+  $ "$TESTDIR/hghave" baz symlink || exit 80
 
   $ baz my-id "mercurial <mercurial@selenic.com>"
 
--- a/tests/test-convert-bzr-ghosts.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-bzr-ghosts.t	Mon Jun 18 16:21:31 2012 -0300
@@ -34,3 +34,5 @@
   |
   o  0@source "Initial layout setup" files: somefile
   
+
+  $ cd ..
--- a/tests/test-convert-bzr-merges.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-bzr-merges.t	Mon Jun 18 16:21:31 2012 -0300
@@ -66,3 +66,5 @@
   644   file-branch1
   644   file-branch2
   644   file-parent
+
+  $ cd ..
--- a/tests/test-convert-bzr-treeroot.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-bzr-treeroot.t	Mon Jun 18 16:21:31 2012 -0300
@@ -31,3 +31,5 @@
   $ manifest source-hg tip
   % manifest of tip
   644   file
+
+  $ cd ..
--- a/tests/test-convert-bzr.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-bzr.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink execbit || exit 80
-
   $ . "$TESTDIR/bzr-definitions"
 
 create and rename on the same file in the same step
@@ -157,6 +155,8 @@
   
   $ cd ..
 
+#if symlink execbit
+
 symlinks and executable files
 
   $ mkdir test-symlinks
@@ -199,14 +199,17 @@
   755 * newprog
   644   program
   644 @ syma
-  $ cd source-hg
 
 test the symlinks can be recreated
 
+  $ cd source-hg
   $ hg up
   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg cat syma; echo
   a
+  $ cd ../..
+
+#endif
 
 Multiple branches
 
--- a/tests/test-convert-cvs-branch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-cvs-branch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -190,3 +190,4 @@
   	b.txt:1.2->1.2.2.1 
   
 
+  $ cd ..
--- a/tests/test-convert-cvs.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-cvs.t	Mon Jun 18 16:21:31 2012 -0300
@@ -458,3 +458,4 @@
   	b/c:1.1.2.1->1.1.2.2 
   
 
+  $ cd ..
--- a/tests/test-convert-cvsnt-mergepoints.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-cvsnt-mergepoints.t	Mon Jun 18 16:21:31 2012 -0300
@@ -91,6 +91,8 @@
   $ echo xyzzy > foo.txt
   $ cvsci -m "merge1+clobber" foo.txt
 
+#if unix-permissions
+
 return to trunk and merge MYBRANCH1_2
 
   $ cvscall -Q update -P -A
@@ -200,3 +202,6 @@
   Members: 
   	foo.txt:1.1.4.1->1.1.4.2 
   
+#endif
+
+  $ cd ..
--- a/tests/test-convert-git.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-git.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,9 @@
 
   $ "$TESTDIR/hghave" git || exit 80
+  $ echo "[core]" >> $HOME/.gitconfig
+  $ echo "autocrlf = false" >> $HOME/.gitconfig
+  $ echo "[core]" >> $HOME/.gitconfig
+  $ echo "autocrlf = false" >> $HOME/.gitconfig
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "convert=" >> $HGRCPATH
   $ echo 'hgext.graphlog =' >> $HGRCPATH
@@ -281,9 +285,12 @@
 
   $ cat > damage.py <<EOF
   > import os
+  > import stat
   > for root, dirs, files in os.walk('git-repo4/.git/objects'):
   >     if files:
   >         path = os.path.join(root, files[0])
+  >         if os.name == 'nt':
+  >             os.chmod(path, stat.S_IWUSR)
   >         os.remove(path)
   >         break
   > EOF
--- a/tests/test-convert-hg-source.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-hg-source.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > convert=
@@ -33,7 +31,11 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'merge remote copy' -d '4 0'
   created new head
+#if execbit
   $ chmod +x baz
+#else
+  $ echo some other change to make sure we get a rev 5 > baz
+#endif
   $ hg ci -m 'mark baz executable' -d '5 0'
   $ cd ..
   $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
@@ -54,9 +56,16 @@
   searching for changes
   no changes found
   [1]
+#if execbit
   $ hg bookmarks
      premerge1                 3:973ef48a98a4
      premerge2                 5:13d9b87cf8f8
+#else
+Different hash because no x bit
+  $ hg bookmarks
+     premerge1                 3:973ef48a98a4
+     premerge2                 5:df0779bcf33c
+#endif
   $ cd ..
 
 check shamap LF and CRLF handling
--- a/tests/test-convert-svn-move.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-svn-move.t	Mon Jun 18 16:21:31 2012 -0300
@@ -247,3 +247,5 @@
   1 branch
   0 clobberdir
   
+
+  $ cd ..
--- a/tests/test-convert-svn-sink.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-svn-sink.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" svn13 no-outer-repo symlink execbit || exit 80
+  $ "$TESTDIR/hghave" svn13 no-outer-repo || exit 80
 
   $ fixpath()
   > {
@@ -31,18 +31,16 @@
   $ echo a > a/a
   $ mkdir -p a/d1/d2
   $ echo b > a/d1/d2/b
-  $ ln -s a/missing a/link
   $ hg --cwd a ci -d '0 0' -A -m 'add a file'
   adding a
   adding d1/d2/b
-  adding link
 
 Modify
 
   $ "$TESTDIR/svn-safe-append.py" a a/a
   $ hg --cwd a ci -d '1 0' -m 'modify a file'
   $ hg --cwd a tip -q
-  1:8231f652da37
+  1:e0e2b8a9156b
 
   $ hg convert -d svn a
   assuming destination a-hg
@@ -57,7 +55,6 @@
    2 1 test d1
    2 1 test d1/d2
    2 1 test d1/d2/b
-   2 1 test link
    2 2 test .
    2 2 test a
   revision: 2
@@ -71,27 +68,22 @@
    A /d1
    A /d1/d2
    A /d1/d2/b
-   A /link
   $ ls a a-hg-wc
   a:
   a
   d1
-  link
   
   a-hg-wc:
   a
   d1
-  link
   $ cmp a/a a-hg-wc/a
 
 Rename
 
   $ hg --cwd a mv a b
-  $ hg --cwd a mv link newlink
-
   $ hg --cwd a ci -d '2 0' -m 'rename a file'
   $ hg --cwd a tip -q
-  2:a67e26ccec09
+  2:eb5169441d43
 
   $ hg convert -d svn a
   assuming destination a-hg
@@ -106,24 +98,19 @@
    3 1 test d1/d2/b
    3 3 test .
    3 3 test b
-   3 3 test newlink
   revision: 3
   author: test
   msg: rename a file
    D /a
    A /b (from /a@2)
-   D /link
-   A /newlink (from /link@2)
   $ ls a a-hg-wc
   a:
   b
   d1
-  newlink
   
   a-hg-wc:
   b
   d1
-  newlink
 
 Copy
 
@@ -131,7 +118,7 @@
 
   $ hg --cwd a ci -d '3 0' -m 'copy a file'
   $ hg --cwd a tip -q
-  3:0cf087b9ab02
+  3:60effef6ab48
 
   $ hg convert -d svn a
   assuming destination a-hg
@@ -145,7 +132,6 @@
    4 1 test d1/d2
    4 1 test d1/d2/b
    4 3 test b
-   4 3 test newlink
    4 4 test .
    4 4 test c
   revision: 4
@@ -157,13 +143,11 @@
   b
   c
   d1
-  newlink
   
   a-hg-wc:
   b
   c
   d1
-  newlink
 
   $ hg --cwd a rm b
 
@@ -171,7 +155,7 @@
 
   $ hg --cwd a ci -d '4 0' -m 'remove a file'
   $ hg --cwd a tip -q
-  4:07b2e34a5b17
+  4:87bbe3013fb6
 
   $ hg convert -d svn a
   assuming destination a-hg
@@ -184,7 +168,6 @@
    5 1 test d1
    5 1 test d1/d2
    5 1 test d1/d2/b
-   5 3 test newlink
    5 4 test c
    5 5 test .
   revision: 5
@@ -195,19 +178,26 @@
   a:
   c
   d1
-  newlink
   
   a-hg-wc:
   c
   d1
-  newlink
 
-Exectutable
+Executable
 
+#if execbit
   $ chmod +x a/c
+#else
+  $ echo fake >> a/c
+#endif
   $ hg --cwd a ci -d '5 0' -m 'make a file executable'
+#if execbit
   $ hg --cwd a tip -q
-  5:31093672760b
+  5:ff42e473c340
+#else
+  $ hg --cwd a tip -q
+  5:817a700c8cf1
+#endif
 
   $ hg convert -d svn a
   assuming destination a-hg
@@ -220,23 +210,62 @@
    6 1 test d1
    6 1 test d1/d2
    6 1 test d1/d2/b
-   6 3 test newlink
    6 6 test .
    6 6 test c
   revision: 6
   author: test
   msg: make a file executable
    M /c
+#if execbit
   $ test -x a-hg-wc/c
+#endif
+
+#if symlink
+
+Symlinks
+
+  $ ln -s a/missing a/link
+  $ hg --cwd a commit -Am 'add symlink'
+  adding link
+  $ hg --cwd a mv link newlink
+  $ hg --cwd a commit -m 'move symlink'
+  $ hg convert -d svn a
+  assuming destination a-hg
+  initializing svn working copy 'a-hg-wc'
+  scanning source...
+  sorting...
+  converting...
+  1 add symlink
+  0 move symlink
+  $ svnupanddisplay a-hg-wc 1
+   8 1 test d1
+   8 1 test d1/d2
+   8 1 test d1/d2/b
+   8 6 test c
+   8 8 test .
+   8 8 test newlink
+  revision: 8
+  author: test
+  msg: move symlink
+   D /link
+   A /newlink (from /link@7)
+
+#endif
+
+  $ rm -rf a a-hg a-hg-wc
+
 
 Executable in new directory
 
-  $ rm -rf a a-hg a-hg-wc
   $ hg init a
 
   $ mkdir a/d1
   $ echo a > a/d1/a
+#if execbit
   $ chmod +x a/d1/a
+#else
+  $ echo fake >> a/d1/a
+#endif
   $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory'
   adding d1/a
 
@@ -257,7 +286,9 @@
   msg: add executable file in new directory
    A /d1
    A /d1/a
+#if execbit
   $ test -x a-hg-wc/d1/a
+#endif
 
 Copy to new directory
 
--- a/tests/test-convert-tagsbranch-topology.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-convert-tagsbranch-topology.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,9 @@
 
   $ "$TESTDIR/hghave" git || exit 80
+  $ echo "[core]" >> $HOME/.gitconfig
+  $ echo "autocrlf = false" >> $HOME/.gitconfig
+  $ echo "[core]" >> $HOME/.gitconfig
+  $ echo "autocrlf = false" >> $HOME/.gitconfig
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "convert=" >> $HGRCPATH
   $ echo 'hgext.graphlog =' >> $HGRCPATH
@@ -82,3 +86,5 @@
    /
   o  0 "rev1" files: a
   
+
+  $ cd ..
--- a/tests/test-copy-move-merge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-copy-move-merge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -60,3 +60,5 @@
   0
   1
   2
+
+  $ cd ..
--- a/tests/test-copy.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-copy.t	Mon Jun 18 16:21:31 2012 -0300
@@ -212,3 +212,5 @@
   $ hg st -AC foo
   M foo
     bar
+
+  $ cd ..
--- a/tests/test-debugbundle.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-debugbundle.t	Mon Jun 18 16:21:31 2012 -0300
@@ -34,3 +34,4 @@
   c
   b80de5d138758541c5f05265ad144ab9fa86d1db 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 991a3460af53952d10ec8a295d3d2cc2e5fa9690 0000000000000000000000000000000000000000 12
 
+  $ cd ..
--- a/tests/test-debugindexdot.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-debugindexdot.t	Mon Jun 18 16:21:31 2012 -0300
@@ -21,3 +21,5 @@
   	2 -> 3
   	1 -> 3
   }
+
+  $ cd ..
--- a/tests/test-diff-binary-file.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-binary-file.t	Mon Jun 18 16:21:31 2012 -0300
@@ -37,3 +37,4 @@
 
   $ hg diff --git -r 0 -r 2
 
+  $ cd ..
--- a/tests/test-diff-change.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-change.t	Mon Jun 18 16:21:31 2012 -0300
@@ -90,3 +90,4 @@
    9
    10
 
+  $ cd ..
--- a/tests/test-diff-color.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-color.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
 Setup
 
   $ echo "[color]" >> $HGRCPATH
@@ -74,6 +72,8 @@
   $ echo "[diff]" >> $HGRCPATH
   $ echo "git=True" >> $HGRCPATH
 
+#if execbit
+
 record
 
   $ chmod +x a
@@ -124,3 +124,7 @@
    a
    c
   \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m  (esc)
+
+#endif
+
+  $ cd ..
--- a/tests/test-diff-hashes.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-hashes.t	Mon Jun 18 16:21:31 2012 -0300
@@ -43,3 +43,4 @@
   -bar
   +foobar
 
+  $ cd ..
--- a/tests/test-diff-subdir.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-subdir.t	Mon Jun 18 16:21:31 2012 -0300
@@ -44,3 +44,4 @@
   @@ -0,0 +1,1 @@
   +2
 
+  $ cd ..
--- a/tests/test-diff-unified.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diff-unified.t	Mon Jun 18 16:21:31 2012 -0300
@@ -89,6 +89,9 @@
   abort: diff context lines count must be an integer, not 'foo'
   [255]
 
+  $ cd ..
+
+
 0 lines of context hunk header matches gnu diff hunk header
 
   $ hg init diffzero
@@ -191,3 +194,5 @@
   @@ -1,1 +1,1 @@
   -b
   +a
+
+  $ cd ..
--- a/tests/test-diffstat.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-diffstat.t	Mon Jun 18 16:21:31 2012 -0300
@@ -69,3 +69,4 @@
    file with spaces |  Bin 
    1 files changed, 0 insertions(+), 0 deletions(-)
 	
+  $ cd ..
--- a/tests/test-double-merge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-double-merge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -63,3 +63,5 @@
   line 0
   line 1
   line 2-2
+
+  $ cd ..
--- a/tests/test-empty-file.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-empty-file.t	Mon Jun 18 16:21:31 2012 -0300
@@ -44,3 +44,4 @@
   b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty2
   b80de5d138758541c5f05265ad144ab9fa86d1db 644   empty3
 
+  $ cd ..
--- a/tests/test-empty.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-empty.t	Mon Jun 18 16:21:31 2012 -0300
@@ -51,3 +51,5 @@
 Should be empty:
 
   $ ls .hg/store
+
+  $ cd ..
--- a/tests/test-encode.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-encode.t	Mon Jun 18 16:21:31 2012 -0300
@@ -59,3 +59,5 @@
   this is a test
   $ hg -R .. cat --decode ../a.gz | gunzip
   this is a test
+
+  $ cd ..
--- a/tests/test-encoding-align.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-encoding-align.t	Mon Jun 18 16:21:31 2012 -0300
@@ -141,3 +141,5 @@
   \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d                       4:9259be597f19 (esc)
   MIDDLE_                            3:b06c5b6def9e
   \xe7\x9f\xad\xe5\x90\x8d                               2:64a70663cee8 (esc)
+
+  $ cd ..
--- a/tests/test-encoding-textwrap.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-encoding-textwrap.t	Mon Jun 18 16:21:31 2012 -0300
@@ -255,3 +255,5 @@
       \xd0\x9d\xd0\xb0\xd1\x81\xd1\x82\xd1\x80\xd0\xbe\xd0\xb9\xd0\xba\xd0\xb8 (esc)
   
   use "hg -v help show_ambig_ru" to show more info
+
+  $ cd ..
--- a/tests/test-encoding.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-encoding.t	Mon Jun 18 16:21:31 2012 -0300
@@ -249,3 +249,4 @@
   $ HGENCODING=latin-1 hg up `cat latin-1-tag`
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  
+  $ cd ..
--- a/tests/test-eol-clone.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-eol-clone.t	Mon Jun 18 16:21:31 2012 -0300
@@ -72,3 +72,5 @@
   first\r (esc)
   second\r (esc)
   third\r (esc)
+
+  $ cd ..
--- a/tests/test-eol-hook.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-eol-hook.t	Mon Jun 18 16:21:31 2012 -0300
@@ -214,3 +214,5 @@
     d.txt in a7040e68714f should not have CRLF line endings
     b.txt in fbcf9b1025f5 should not have CRLF line endings
   [255]
+
+  $ cd ..
--- a/tests/test-eol-tag.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-eol-tag.t	Mon Jun 18 16:21:31 2012 -0300
@@ -35,3 +35,5 @@
 Touch .hgtags file again:
 
   $ hg tag 2.0
+
+  $ cd ..
--- a/tests/test-eol.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-eol.t	Mon Jun 18 16:21:31 2012 -0300
@@ -522,3 +522,4 @@
   fourth
   fifth
 
+  $ cd ..
--- a/tests/test-eolfilename.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-eolfilename.t	Mon Jun 18 16:21:31 2012 -0300
@@ -68,3 +68,5 @@
   \x1b[0;35;1;4mbar\x1b[0m (esc)
   \x1b[0;35;1;4m? foo\x1b[0m (esc)
   \x1b[0;35;1;4mbar.baz\x1b[0m (esc)
+
+  $ cd ..
--- a/tests/test-export.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-export.t	Mon Jun 18 16:21:31 2012 -0300
@@ -143,3 +143,5 @@
   $ hg export "not all()"
   abort: export requires at least one changeset
   [255]
+
+  $ cd ..
--- a/tests/test-extdiff.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-extdiff.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink execbit || exit 80
-
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "extdiff=" >> $HGRCPATH
 
@@ -94,6 +92,8 @@
   diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob)
   diff-like tools yield a non-zero exit code
 
+#if execbit
+
 Test extdiff of multiple files in tmp dir:
 
   $ hg update -C 0 > /dev/null
@@ -182,6 +182,10 @@
 
   $ cd ..
 
+#endif
+
+#if symlink
+
 Test symlinks handling (issue1909)
 
   $ hg init testsymlinks
@@ -196,3 +200,5 @@
   diffing testsymlinks.07f494440405 testsymlinks
   [1]
   $ cd ..
+
+#endif
--- a/tests/test-fetch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-fetch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -410,3 +410,5 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
+
+  $ cd ..
--- a/tests/test-filebranch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-filebranch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -146,3 +146,4 @@
   checking files
   4 files, 4 changesets, 10 total revisions
 
+  $ cd ..
--- a/tests/test-flags.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-flags.t	Mon Jun 18 16:21:31 2012 -0300
@@ -147,3 +147,5 @@
      rev    offset  length   base linkrev nodeid       p1           p2
        0         0       0      0       0 b80de5d13875 000000000000 000000000000
        1         0       5      1       1 7fe919cc0336 b80de5d13875 000000000000
+
+  $ cd ..
--- a/tests/test-git-export.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-git-export.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
   $ hg init
   $ echo start > start
   $ hg ci -Amstart
@@ -58,6 +56,8 @@
   $ hg ci -Amsrc
   adding src
 
+#if execbit
+
 chmod 644:
 
   $ chmod +x src
@@ -94,6 +94,17 @@
   old mode 100644
   new mode 100755
 
+#else
+
+Dummy changes when no exec bit, mocking the execbit commit structure
+
+  $ echo change >> src
+  $ hg ci -munexec
+  $ hg mv src dst
+  $ hg ci -mrenamemod
+
+#endif
+
 Binary diff:
 
   $ cp "$TESTDIR/binfile.bin" .
--- a/tests/test-globalopts.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-globalopts.t	Mon Jun 18 16:21:31 2012 -0300
@@ -265,7 +265,7 @@
 
   $ hg --cwd a --time id
   8580ff50825a tip
-  Time: real * (glob)
+  time: real * (glob)
 
 Testing --version:
 
--- a/tests/test-glog.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-glog.t	Mon Jun 18 16:21:31 2012 -0300
@@ -2056,3 +2056,5 @@
   $ testlog --hidden
   []
   []
+
+  $ cd ..
--- a/tests/test-gpg.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-gpg.t	Mon Jun 18 16:21:31 2012 -0300
@@ -17,7 +17,7 @@
   $ hg sigs
 
   $ hg sign 0
-  Signing 0:e63c23eaa88a
+  signing 0:e63c23eaa88a
 
   $ hg sigs
   hgtest                             0:e63c23eaa88ae77967edcf4ea194d31167c478b0
@@ -30,3 +30,5 @@
 the main hg working dir
   $ "$TESTDIR/md5sum.py" "$TESTDIR/gpg/trustdb.gpg"
   f6b9c78c65fa9536e7512bb2ceb338ae  */gpg/trustdb.gpg (glob)
+
+  $ cd ..
--- a/tests/test-graft.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-graft.t	Mon Jun 18 16:21:31 2012 -0300
@@ -287,3 +287,5 @@
   $ hg log --template '{rev} {parents} {desc}\n' -r tip
   14 1:5d205f8b35b6  3
   (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
+
+  $ cd ..
--- a/tests/test-grep.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-grep.t	Mon Jun 18 16:21:31 2012 -0300
@@ -163,6 +163,8 @@
   color:3:-:red
   color:1:+:red
 
+  $ cd ..
+
   $ hg init a
   $ cd a
   $ cp "$TESTDIR/binfile.bin" .
@@ -170,3 +172,5 @@
   $ hg ci -m 'add binfile.bin'
   $ hg grep "MaCam" --all
   binfile.bin:0:+: Binary file matches
+
+  $ cd ..
--- a/tests/test-hardlinks.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hardlinks.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,10 +1,11 @@
-  $ "$TESTDIR/hghave" no-windows || exit 80
+  $ "$TESTDIR/hghave" hardlink || exit 80
 
   $ cat > nlinks.py <<EOF
-  > import os, sys
+  > import sys
+  > from mercurial import util
   > for f in sorted(sys.stdin.readlines()):
   >     f = f[:-1]
-  >     print os.lstat(f).st_nlink, f
+  >     print util.nlinks(f), f
   > EOF
 
   $ nlinksdir()
@@ -104,7 +105,10 @@
 Create a non-inlined filelog in r3:
 
   $ cd r3/d1
-  $ python -c 'for x in range(10000): print x' >> data1
+  >>> f = open('data1', 'wb')
+  >>> for x in range(10000):
+  ...     f.write("%s\n" % str(x))
+  >>> f.close()
   $ for j in 0 1 2 3 4 5 6 7 8 9; do
   >   cat data1 >> f2
   >   hg commit -m$j
@@ -133,7 +137,7 @@
 
   $ cd r3
   $ hg push
-  pushing to $TESTTMP/r1
+  pushing to $TESTTMP/r1 (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -344,3 +348,4 @@
   $ cat ../b/.hg/localtags
   4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
 
+  $ cd ..
--- a/tests/test-help.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-help.t	Mon Jun 18 16:21:31 2012 -0300
@@ -598,6 +598,15 @@
   
   use "hg -v help nohelp" to show more info
 
+  $ hg help -k nohelp
+  Commands:
+  
+   nohelp hg nohelp
+  
+  Extension Commands:
+  
+   nohelp (no help text available)
+
 Test that default list of commands omits extension commands
 
   $ hg help
@@ -766,3 +775,30 @@
   $ hg help revsets | grep helphook
       helphook1
       helphook2
+
+Test keyword search help
+
+  $ hg help -k clone
+  Topics:
+  
+   config     Configuration Files
+   extensions Using Additional Features
+   glossary   Glossary
+   phases     Working with Phases
+   subrepo    Subrepositories
+   urls       URL Paths
+  
+  Commands:
+  
+   clone  make a copy of an existing repository
+   paths  show aliases for remote repositories
+   update update working directory (or switch revisions)
+  
+  Extensions:
+  
+   relink recreates hardlinks between repository clones
+  
+  Extension Commands:
+  
+   qclone clone main and patch repository at same time
+
--- a/tests/test-hgcia.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgcia.t	Mon Jun 18 16:21:31 2012 -0300
@@ -90,3 +90,5 @@
     </body>
     <timestamp>0</timestamp>
   </message>
+
+  $ cd ..
--- a/tests/test-hgignore.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgignore.t	Mon Jun 18 16:21:31 2012 -0300
@@ -122,3 +122,5 @@
 
   $ hg debugignore
   (?:(?:|.*/)[^/]*(?:/|$))
+
+  $ cd ..
--- a/tests/test-hgk.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgk.t	Mon Jun 18 16:21:31 2012 -0300
@@ -16,3 +16,5 @@
   branch default
   
   adda
+
+  $ cd ..
--- a/tests/test-hgrc.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgrc.t	Mon Jun 18 16:21:31 2012 -0300
@@ -117,7 +117,6 @@
 
 HGPLAIN
 
-  $ cd ..
   $ p=`pwd`
   $ echo "[ui]" > $HGRC
   $ echo "debug=true" >> $HGRC
--- a/tests/test-hgweb-commands.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-commands.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1286,3 +1286,5 @@
 ERRORS ENCOUNTERED
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-hgweb-descend-empties.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-descend-empties.t	Mon Jun 18 16:21:31 2012 -0300
@@ -140,3 +140,5 @@
   
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-hgweb-diffs.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-diffs.t	Mon Jun 18 16:21:31 2012 -0300
@@ -598,3 +598,5 @@
 errors
 
   $ cat ../test/errors.log
+
+  $ cd ..
--- a/tests/test-hgweb-empty.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-empty.t	Mon Jun 18 16:21:31 2012 -0300
@@ -395,3 +395,5 @@
   </body>
   </html>
   
+
+  $ cd ..
--- a/tests/test-hgweb-filelog.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-filelog.t	Mon Jun 18 16:21:31 2012 -0300
@@ -755,3 +755,5 @@
 errors
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-hgweb-no-path-info.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-no-path-info.t	Mon Jun 18 16:21:31 2012 -0300
@@ -105,3 +105,5 @@
   
   ---- ERRORS
   
+
+  $ cd ..
--- a/tests/test-hgweb-no-request-uri.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-no-request-uri.t	Mon Jun 18 16:21:31 2012 -0300
@@ -139,3 +139,5 @@
   
   ---- ERRORS
   
+
+  $ cd ..
--- a/tests/test-hgweb-non-interactive.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-non-interactive.t	Mon Jun 18 16:21:31 2012 -0300
@@ -78,3 +78,5 @@
   []
   ---- request.ENVIRON wsgi variables
   ['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version']
+
+  $ cd ..
--- a/tests/test-hgweb-raw.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-raw.t	Mon Jun 18 16:21:31 2012 -0300
@@ -5,20 +5,19 @@
   $ hg init test
   $ cd test
   $ mkdir sub
-  $ cat >'sub/some "text".txt' <<ENDSOME
+  $ 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'
-  warning: filename contains '"', which is reserved on Windows: 'sub/some "text".txt'
+  $ 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
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
 
   $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done
 
@@ -26,33 +25,34 @@
   200 Script output follows
   content-type: application/binary
   content-length: 157
-  content-disposition: inline; filename="some \"text\".txt"
+  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)
+  127.0.0.1 - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
 
   $ rm access.log error.log
   $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid \
   > --config web.guessmime=True
 
   $ 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
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
   $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done
 
   $ cat getoutput.txt
   200 Script output follows
   content-type: text/plain; charset="ascii"
   content-length: 157
-  content-disposition: inline; filename="some \"text\".txt"
+  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)
+  127.0.0.1 - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
 
+  $ cd ..
--- a/tests/test-hgweb-removed.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb-removed.t	Mon Jun 18 16:21:31 2012 -0300
@@ -231,3 +231,5 @@
   </body>
   </html>
   
+
+  $ cd ..
--- a/tests/test-hgweb.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hgweb.t	Mon Jun 18 16:21:31 2012 -0300
@@ -443,3 +443,5 @@
 errors
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-highlight.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-highlight.t	Mon Jun 18 16:21:31 2012 -0300
@@ -603,3 +603,5 @@
   % hgweb filerevision, html
   <div class="parity0 source"><a href="#l1" id="l1">     1</a> ??</div>
   % errors encountered
+
+  $ cd ..
--- a/tests/test-hook.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-hook.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,18 +1,18 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
 commit hooks can see env vars
 
   $ hg init a
   $ cd a
-  $ echo "[hooks]" > .hg/hgrc
-  $ echo 'commit = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py commit' >> .hg/hgrc
-  $ echo 'commit.b = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py commit.b' >> .hg/hgrc
-  $ echo 'precommit = unset HG_LOCAL HG_NODE HG_TAG; python "$TESTDIR"/printenv.py precommit' >> .hg/hgrc
-  $ echo 'pretxncommit = unset HG_LOCAL HG_TAG; python "$TESTDIR"/printenv.py pretxncommit' >> .hg/hgrc
-  $ echo 'pretxncommit.tip = hg -q tip' >> .hg/hgrc
-  $ echo 'pre-identify = python "$TESTDIR"/printenv.py pre-identify 1' >> .hg/hgrc
-  $ echo 'pre-cat = python "$TESTDIR"/printenv.py pre-cat' >> .hg/hgrc
-  $ echo 'post-cat = python "$TESTDIR"/printenv.py post-cat' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [hooks]
+  > commit = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" commit"
+  > commit.b = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" commit.b"
+  > precommit = sh -c  "HG_LOCAL= HG_NODE= HG_TAG= python \"$TESTDIR/printenv.py\" precommit"
+  > pretxncommit = sh -c "HG_LOCAL= HG_TAG= python \"$TESTDIR/printenv.py\" pretxncommit"
+  > pretxncommit.tip = hg -q tip
+  > pre-identify = python "$TESTDIR/printenv.py" pre-identify 1
+  > pre-cat = python "$TESTDIR/printenv.py" pre-cat
+  > post-cat = python "$TESTDIR/printenv.py" post-cat
+  > EOF
   $ echo a > a
   $ hg add a
   $ hg commit -m a
@@ -29,10 +29,12 @@
 
 changegroup hooks can see env vars
 
-  $ echo '[hooks]' > .hg/hgrc
-  $ echo 'prechangegroup = python "$TESTDIR"/printenv.py prechangegroup' >> .hg/hgrc
-  $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
-  $ echo 'incoming = python "$TESTDIR"/printenv.py incoming' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [hooks]
+  > prechangegroup = python "$TESTDIR/printenv.py" prechangegroup
+  > changegroup = python "$TESTDIR/printenv.py" changegroup
+  > incoming = python "$TESTDIR/printenv.py" incoming
+  > EOF
 
 pretxncommit and commit hooks can see both parents of merge
 
@@ -94,8 +96,10 @@
 tag hooks can see env vars
 
   $ cd ../a
-  $ echo 'pretag = python "$TESTDIR"/printenv.py pretag' >> .hg/hgrc
-  $ echo 'tag = unset HG_PARENT1 HG_PARENT2; python "$TESTDIR"/printenv.py tag' >> .hg/hgrc
+  $ cat >> .hg/hgrc <<EOF
+  > pretag = python "$TESTDIR/printenv.py" pretag
+  > tag = sh -c "HG_PARENT1= HG_PARENT2= python \"$TESTDIR/printenv.py\" tag"
+  > EOF
   $ hg tag -d '3 0' a
   pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a 
   precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 
@@ -110,7 +114,7 @@
 
 pretag hook can forbid tagging
 
-  $ echo 'pretag.forbid = python "$TESTDIR"/printenv.py pretag.forbid 1' >> .hg/hgrc
+  $ echo "pretag.forbid = python \"$TESTDIR/printenv.py\" pretag.forbid 1" >> .hg/hgrc
   $ hg tag -d '4 0' fa
   pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa 
   pretag.forbid hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa 
@@ -125,8 +129,8 @@
 pretxncommit hook can see changeset, can roll back txn, changeset no
 more there after
 
-  $ echo 'pretxncommit.forbid0 = hg tip -q' >> .hg/hgrc
-  $ echo 'pretxncommit.forbid1 = python "$TESTDIR"/printenv.py pretxncommit.forbid 1' >> .hg/hgrc
+  $ echo "pretxncommit.forbid0 = hg tip -q" >> .hg/hgrc
+  $ echo "pretxncommit.forbid1 = python \"$TESTDIR/printenv.py\" pretxncommit.forbid 1" >> .hg/hgrc
   $ echo z > z
   $ hg add z
   $ hg -q tip
@@ -146,7 +150,7 @@
 
 precommit hook can prevent commit
 
-  $ echo 'precommit.forbid = python "$TESTDIR"/printenv.py precommit.forbid 1' >> .hg/hgrc
+  $ echo "precommit.forbid = python \"$TESTDIR/printenv.py\" precommit.forbid 1" >> .hg/hgrc
   $ hg commit -m 'fail' -d '4 0'
   precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 
   precommit.forbid hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 
@@ -157,14 +161,14 @@
 
 preupdate hook can prevent update
 
-  $ echo 'preupdate = python "$TESTDIR"/printenv.py preupdate' >> .hg/hgrc
+  $ echo "preupdate = python \"$TESTDIR/printenv.py\" preupdate" >> .hg/hgrc
   $ hg update 1
   preupdate hook: HG_PARENT1=ab228980c14d 
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
 
 update hook
 
-  $ echo 'update = python "$TESTDIR"/printenv.py update' >> .hg/hgrc
+  $ echo "update = python \"$TESTDIR/printenv.py\" update" >> .hg/hgrc
   $ hg update
   preupdate hook: HG_PARENT1=539e4b31b6dc 
   update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc 
@@ -172,7 +176,7 @@
 
 pushkey hook
 
-  $ echo 'pushkey = python "$TESTDIR"/printenv.py pushkey' >> .hg/hgrc
+  $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey" >> .hg/hgrc
   $ cd ../b
   $ hg bookmark -r null foo
   $ hg push -B foo ../a
@@ -186,7 +190,7 @@
 
 listkeys hook
 
-  $ echo 'listkeys = python "$TESTDIR"/printenv.py listkeys' >> .hg/hgrc
+  $ echo "listkeys = python \"$TESTDIR/printenv.py\" listkeys" >> .hg/hgrc
   $ hg bookmark -r null bar
   $ cd ../b
   $ hg pull -B bar ../a
@@ -201,7 +205,7 @@
 
 test that prepushkey can prevent incoming keys
 
-  $ echo 'prepushkey = python "$TESTDIR"/printenv.py prepushkey.forbid 1' >> .hg/hgrc
+  $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey.forbid 1" >> .hg/hgrc
   $ cd ../b
   $ hg bookmark -r null baz
   $ hg push -B baz ../a
@@ -219,7 +223,7 @@
 
 test that prelistkeys can prevent listing keys
 
-  $ echo 'prelistkeys = python "$TESTDIR"/printenv.py prelistkeys.forbid 1' >> .hg/hgrc
+  $ echo "prelistkeys = python \"$TESTDIR/printenv.py\" prelistkeys.forbid 1" >> .hg/hgrc
   $ hg bookmark -r null quux
   $ cd ../b
   $ hg pull -B quux ../a
@@ -234,8 +238,10 @@
   $ cd ../b
   $ hg -q tip
   3:07f3376c1e65
-  $ echo '[hooks]' > .hg/hgrc
-  $ echo 'prechangegroup.forbid = python "$TESTDIR"/printenv.py prechangegroup.forbid 1' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [hooks]
+  > prechangegroup.forbid = python "$TESTDIR/printenv.py" prechangegroup.forbid 1
+  > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
@@ -246,9 +252,11 @@
 pretxnchangegroup hook can see incoming changes, can roll back txn,
 incoming changes no longer there after
 
-  $ echo '[hooks]' > .hg/hgrc
-  $ echo 'pretxnchangegroup.forbid0 = hg tip -q' >> .hg/hgrc
-  $ echo 'pretxnchangegroup.forbid1 = python "$TESTDIR"/printenv.py pretxnchangegroup.forbid 1' >> .hg/hgrc
+  $ cat > .hg/hgrc <<EOF
+  > [hooks]
+  > pretxnchangegroup.forbid0 = hg tip -q
+  > pretxnchangegroup.forbid1 = python "$TESTDIR/printenv.py" pretxnchangegroup.forbid 1
+  > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
@@ -268,9 +276,11 @@
 outgoing hooks can see env vars
 
   $ rm .hg/hgrc
-  $ echo '[hooks]' > ../a/.hg/hgrc
-  $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> ../a/.hg/hgrc
-  $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> ../a/.hg/hgrc
+  $ cat > ../a/.hg/hgrc <<EOF
+  > [hooks]
+  > preoutgoing = python "$TESTDIR/printenv.py" preoutgoing
+  > outgoing = python "$TESTDIR/printenv.py" outgoing
+  > EOF
   $ hg pull ../a
   pulling from ../a
   searching for changes
@@ -287,7 +297,7 @@
 
 preoutgoing hook can prevent outgoing changes
 
-  $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
+  $ echo "preoutgoing.forbid = python \"$TESTDIR/printenv.py\" preoutgoing.forbid 1" >> ../a/.hg/hgrc
   $ hg pull ../a
   pulling from ../a
   searching for changes
@@ -299,9 +309,11 @@
 outgoing hooks work for local clones
 
   $ cd ..
-  $ echo '[hooks]' > a/.hg/hgrc
-  $ echo 'preoutgoing = python "$TESTDIR"/printenv.py preoutgoing' >> a/.hg/hgrc
-  $ echo 'outgoing = python "$TESTDIR"/printenv.py outgoing' >> a/.hg/hgrc
+  $ cat > a/.hg/hgrc <<EOF
+  > [hooks]
+  > preoutgoing = python "$TESTDIR/printenv.py" preoutgoing
+  > outgoing = python "$TESTDIR/printenv.py" outgoing
+  > EOF
   $ hg clone a c
   preoutgoing hook: HG_SOURCE=clone 
   outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone 
@@ -311,13 +323,14 @@
 
 preoutgoing hook can prevent outgoing changes for local clones
 
-  $ echo 'preoutgoing.forbid = python "$TESTDIR"/printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
+  $ echo "preoutgoing.forbid = python \"$TESTDIR/printenv.py\" preoutgoing.forbid 1" >> a/.hg/hgrc
   $ hg clone a zzz
   preoutgoing hook: HG_SOURCE=clone 
   preoutgoing.forbid hook: HG_SOURCE=clone 
   abort: preoutgoing.forbid hook exited with status 1
   [255]
-  $ cd b
+
+  $ cd "$TESTTMP/b"
 
   $ cat > hooktests.py <<EOF
   > from mercurial import util
@@ -364,7 +377,11 @@
 
 test python hooks
 
-  $ PYTHONPATH="`pwd`:$PYTHONPATH"
+#if windows
+  $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
+#else
+  $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
+#endif
   $ export PYTHONPATH
 
   $ echo '[hooks]' > ../a/.hg/hgrc
@@ -597,7 +614,7 @@
   $ echo aa >> from/a
   $ hg --cwd from ci -mb
   $ hg --cwd from push
-  pushing to $TESTTMP/to
+  pushing to $TESTTMP/to (glob)
   searching for changes
   adding changesets
   adding manifests
--- a/tests/test-i18n.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-i18n.t	Mon Jun 18 16:21:31 2012 -0300
@@ -22,3 +22,15 @@
   $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip
   abortado: n\xe3o foi encontrado um reposit\xf3rio em '$TESTTMP' (.hg n\xe3o encontrado)! (esc)
   [255]
+
+Test keyword search in translated help text:
+
+  $ HGENCODING=UTF-8 LANGUAGE=de hg help -k blättern
+  Topics:
+  
+   extensions Using Additional Features
+  
+  Erweiterungen:
+  
+   pager Verwendet einen externen Pager zum Bl\xc3\xa4ttern in der Ausgabe von Befehlen (esc)
+
--- a/tests/test-impexp-branch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-impexp-branch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -69,3 +69,5 @@
   >>> file('../r1-ws.patch', 'wb').write(p)
   $ hg import --exact ../r1-ws.patch
   applying ../r1-ws.patch
+
+  $ cd ..
--- a/tests/test-import-bypass.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import-bypass.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink execbit || exit 80
-
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "purge=" >> $HGRCPATH
   $ echo "graphlog=" >> $HGRCPATH
@@ -218,6 +216,8 @@
 
   $ cd ..
 
+#if symlink execbit
+
 Test complicated patch with --exact
 
   $ hg init repo-exact
@@ -265,3 +265,6 @@
   |
   o  0:a0e19e636a43 test 0 0 - default - t
   
+#endif
+
+  $ cd ..
--- a/tests/test-import-context.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import-context.t	Mon Jun 18 16:21:31 2012 -0300
@@ -123,3 +123,4 @@
   $ python ../cat.py d
   'A\nA\nA\nA\n'
 
+  $ cd ..
--- a/tests/test-import-git.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import-git.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,6 +1,5 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
-  $ hg init
+  $ hg init repo
+  $ cd repo
 
 New file:
 
@@ -41,14 +40,19 @@
   > EOF
   applying patch from stdin
 
+#if execbit
   $ hg tip -q
   2:3a34410f282e
-
   $ test -x new
+  $ hg rollback -q
+#else
+  $ hg tip -q
+  1:ab199dc869b5
+#endif
 
-Copy:
+Copy and removing x bit:
 
-  $ hg import -d "1000000 0" -mcopy - <<EOF
+  $ hg import -f -d "1000000 0" -mcopy - <<EOF
   > diff --git a/new b/copy
   > old mode 100755
   > new mode 100644
@@ -62,15 +66,37 @@
   > EOF
   applying patch from stdin
 
+  $ test -f copy
+#if execbit
+  $ test ! -x copy
+  $ test -x copyx
   $ hg tip -q
-  3:37bacb7ca14d
+  2:21dfaae65c71
+#else
+  $ hg tip -q
+  2:0efdaa8e3bf3
+#endif
+
+  $ hg up -qCr1
+  $ hg rollback -q
+
+Copy (like above but independent of execbit):
 
-  $ if "$TESTDIR/hghave" -q execbit; then
-  >     test -f copy -a ! -x copy || echo bad
-  >     test -x copyx || echo bad
-  > else
-  >     test -f copy || echo bad
-  > fi
+  $ hg import -d "1000000 0" -mcopy - <<EOF
+  > diff --git a/new b/copy
+  > similarity index 100%
+  > copy from new
+  > copy to copy
+  > diff --git a/new b/copyx
+  > similarity index 100%
+  > copy from new
+  > copy to copyx
+  > EOF
+  applying patch from stdin
+
+  $ hg tip -q
+  2:0efdaa8e3bf3
+  $ test -f copy
 
   $ cat copy
   a
@@ -89,7 +115,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  4:47b81a94361d
+  3:b1f57753fad2
 
   $ hg locate
   copyx
@@ -111,7 +137,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  5:d9b001d98336
+  4:1bd1da94b9b2
 
   $ hg locate
   empty
@@ -138,7 +164,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  6:ebe901e7576b
+  5:46fe99cb3035
 
 Copy and modify:
 
@@ -161,7 +187,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  7:18f368958ecd
+  6:ffeb3197c12d
 
   $ hg cat copy2
   a
@@ -191,7 +217,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  8:c32b0d7e6f44
+  7:401aede9e6bb
 
   $ hg locate copy2
   [1]
@@ -215,10 +241,10 @@
   applying patch from stdin
 
   $ hg tip -q
-  9:034a6bf95330
+  8:2ef727e684e8
 
   $ hg log -vr. --template '{rev} {files} / {file_copies}\n'
-  9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
+  8 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
 
   $ hg locate rename2 rename3 rename3-2
   rename3
@@ -259,7 +285,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  11:c39bce63e786
+  10:27377172366e
 
   $ cat foo2
   foo
@@ -288,7 +314,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  12:30b530085242
+  11:18b73a84b4ab
 
   $ hg manifest --debug | grep mbinary
   045c85ba38952325e126c70962cc0f9d9077bc67 644   mbinary1
@@ -308,7 +334,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  13:04750ef42fb3
+  12:47500ce1614e
 
   $ cat "foo bar"
   foo
@@ -331,7 +357,7 @@
   applying patch from stdin
 
   $ hg tip -q
-  14:c4cd9cdeaa74
+  13:6757efb07ea9
 
   $ cat foo3
   foo
@@ -366,8 +392,8 @@
 Invalid base85 content
 
   $ hg rollback
-  repository tip rolled back to revision 15 (undo import)
-  working directory now based on revision 15
+  repository tip rolled back to revision 14 (undo import)
+  working directory now based on revision 14
   $ hg revert -aq
   $ hg import -d "1000000 0" -m invalid-binary - <<"EOF"
   > diff --git a/text2 b/binary2
@@ -532,6 +558,8 @@
   $ cat b
   b
 
+#if symlink
+
   $ ln -s b linkb
   $ hg add linkb
   $ hg ci -m addlinkb
@@ -554,6 +582,8 @@
   ? b.rej
   ? linkb.rej
 
+#endif
+
 Test corner case involving copies and multiple hunks (issue3384)
 
   $ hg revert -qa
--- a/tests/test-import-merge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import-merge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -112,3 +112,4 @@
   3:102a90ea7b4a addb
   $ hg strip --no-backup tip
 
+  $ cd ..
--- a/tests/test-import-unknown.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import-unknown.t	Mon Jun 18 16:21:31 2012 -0300
@@ -65,3 +65,5 @@
   applying ../unknown.diff
   abort: cannot create copied: destination already exists
   [255]
+
+  $ cd ..
--- a/tests/test-import.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-import.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
   $ hg init a
   $ mkdir a/d1
   $ mkdir a/d1/d2
@@ -54,7 +52,6 @@
   > print 'patching file a'
   > file('a', 'wb').write('line2\n')
   > EOF
-  $ chmod +x dummypatch.py
   $ hg clone -r0 a b
   adding changesets
   adding manifests
@@ -632,7 +629,7 @@
   > rename to bar
   > EOF
   applying patch from stdin
-  abort: path contains illegal component: ../outside/foo
+  abort: path contains illegal component: ../outside/foo (glob)
   [255]
   $ cd ..
 
@@ -757,6 +754,7 @@
   $ cat foo
   a
 
+  $ cd ..
 
 Issue1859: first line mistaken for email headers
 
@@ -791,7 +789,7 @@
   $ cd ..
 
 
---- in commit message
+in commit message
 
   $ hg init commitconfusion
   $ cd commitconfusion
@@ -907,12 +905,16 @@
   > new mode 100755
   > EOF
   applying patch from stdin
+
+#if execbit
+
   $ hg sum
   parent: 1:d59915696727 tip
    help management of empty pkg and lib directories in perforce
   branch: default
   commit: (clean)
   update: (current)
+
   $ hg diff --git -c tip
   diff --git a/lib/place-holder b/lib/place-holder
   new file mode 100644
@@ -931,6 +933,39 @@
   diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
   old mode 100644
   new mode 100755
+
+#else
+
+  $ hg sum
+  parent: 1:28f089cc9ccc tip
+   help management of empty pkg and lib directories in perforce
+  branch: default
+  commit: (clean)
+  update: (current)
+
+  $ hg diff --git -c tip
+  diff --git a/lib/place-holder b/lib/place-holder
+  new file mode 100644
+  --- /dev/null
+  +++ b/lib/place-holder
+  @@ -0,0 +1,2 @@
+  +perforce does not maintain empty directories.
+  +this file helps.
+  diff --git a/pkg/place-holder b/pkg/place-holder
+  new file mode 100644
+  --- /dev/null
+  +++ b/pkg/place-holder
+  @@ -0,0 +1,2 @@
+  +perforce does not maintain empty directories.
+  +this file helps.
+
+/* The mode change for mksys.bash is missing here, because on platforms  */
+/* that don't support execbits, mode changes in patches are ignored when */
+/* they are imported. This is obviously also the reason for why the hash */
+/* in the created changeset is different to the one you see above the    */
+/* #else clause */
+
+#endif
   $ cd ..
 
 
@@ -997,6 +1032,8 @@
   c3
   c4
 
+  $ cd ..
+
 no segfault while importing a unified diff which start line is zero but chunk
 size is non-zero
 
@@ -1115,3 +1152,4 @@
   4
   line
 
+  $ cd ..
--- a/tests/test-inherit-mode.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-inherit-mode.t	Mon Jun 18 16:21:31 2012 -0300
@@ -146,4 +146,7 @@
   $ dirmode=`python ../mode.py .hg/store/data/dir`
   $ if [ "$storemode" != "$dirmode" ]; then
   >  echo "$storemode != $dirmode"
-  $ fi
+  > fi
+  $ cd ..
+
+  $ cd .. # g-s dir
--- a/tests/test-init.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-init.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" no-windows || exit 80
-
 This test tries to exercise the ssh functionality with a dummy script
 
   $ checknewrepo()
@@ -124,7 +122,7 @@
 
 check names for repositories (clashes with URL schemes, special chars)
 
-  $ for i in bundle file hg http https old-http ssh static-http " " "with space"; do
+  $ for i in bundle file hg http https old-http ssh static-http "with space"; do
   >   printf "hg init \"$i\"... "
   >   hg init "$i"
   >   test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
@@ -137,8 +135,13 @@
   hg init "old-http"... ok
   hg init "ssh"... ok
   hg init "static-http"... ok
-  hg init " "... ok
   hg init "with space"... ok
+#if eol-in-paths
+/* " " is not a valid name for a directory on Windows */
+  $ hg init " "
+  $ test -d " "
+  $ test -d " /.hg"
+#endif
 
 creating 'local/sub/repo'
 
--- a/tests/test-inotify-dirty-dirstate.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-inotify-dirty-dirstate.t	Mon Jun 18 16:21:31 2012 -0300
@@ -68,3 +68,5 @@
   $ hg status
   $ hg qrefresh
   $ hg status
+
+  $ cd ..
--- a/tests/test-inotify-issue1208.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-inotify-issue1208.t	Mon Jun 18 16:21:31 2012 -0300
@@ -34,3 +34,5 @@
   abort: child process failed to start
   [255]
   $ kill `cat hg.pid`
+
+  $ cd ..
--- a/tests/test-inotify.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-inotify.t	Mon Jun 18 16:21:31 2012 -0300
@@ -158,3 +158,5 @@
 
   $ hg st
   $ kill `cat hg.pid`
+
+  $ cd ..
--- a/tests/test-install.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-install.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,19 +1,19 @@
 hg debuginstall
   $ hg debuginstall
-  Checking encoding (ascii)...
-  Checking installed modules (*mercurial)... (glob)
-  Checking templates (*mercurial?templates)... (glob)
-  Checking commit editor...
-  Checking username...
-  No problems detected
+  checking encoding (ascii)...
+  checking installed modules (*mercurial)... (glob)
+  checking templates (*mercurial?templates)... (glob)
+  checking commit editor...
+  checking username...
+  no problems detected
 
 hg debuginstall with no username
   $ HGUSER= hg debuginstall
-  Checking encoding (ascii)...
-  Checking installed modules (*mercurial)... (glob)
-  Checking templates (*mercurial?templates)... (glob)
-  Checking commit editor...
-  Checking username...
+  checking encoding (ascii)...
+  checking installed modules (*mercurial)... (glob)
+  checking templates (*mercurial?templates)... (glob)
+  checking commit editor...
+  checking username...
    no username supplied (see "hg help config")
    (specify a username in your configuration file)
   1 problems detected, please check your install!
--- a/tests/test-interhg.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-interhg.t	Mon Jun 18 16:21:31 2012 -0300
@@ -29,3 +29,5 @@
 errors
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-issue1089.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-issue1089.t	Mon Jun 18 16:21:31 2012 -0300
@@ -23,3 +23,4 @@
 
   $ hg ci -m m ../a
 
+  $ cd ..
--- a/tests/test-issue1802.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-issue1802.t	Mon Jun 18 16:21:31 2012 -0300
@@ -69,3 +69,5 @@
   $ hg manifest -v
   755 * a
   644   b
+
+  $ cd ..
--- a/tests/test-issue1877.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-issue1877.t	Mon Jun 18 16:21:31 2012 -0300
@@ -43,3 +43,4 @@
   $ hg book
      main                      2:d36c0562f908
 
+  $ cd ..
--- a/tests/test-issue2137.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-issue2137.t	Mon Jun 18 16:21:31 2012 -0300
@@ -52,3 +52,5 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     one more commit to demonstrate the bug
   
+
+  $ cd ..
--- a/tests/test-issue3084.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-issue3084.t	Mon Jun 18 16:21:31 2012 -0300
@@ -106,3 +106,5 @@
 
   $ cat foo
   large
+
+  $ cd ..
--- a/tests/test-journal-exists.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-journal-exists.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" unix-permissions || exit 80
-
   $ hg init
   $ echo a > a
   $ hg ci -Am0
@@ -24,6 +22,7 @@
 
 Check that zero-size journals are correctly aborted:
 
+#if unix-permissions
   $ hg bundle -qa repo.hg
   $ chmod -w foo/.hg/store/00changelog.i
 
@@ -33,4 +32,5 @@
   [255]
 
   $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
+#endif
 
--- a/tests/test-keyword.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-keyword.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
+  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
 
   $ cat <<EOF >> $HGRCPATH
   > [extensions]
@@ -658,6 +658,8 @@
   $ hg update --clean
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+#if symlink
+
 cp symlink file; hg cp -A symlink file (part2)
 - copied symlink points to kw ignored file: do not overwrite
 
@@ -679,6 +681,8 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm i symignored
 
+#endif
+
 Custom keywordmaps as argument to kwdemo
 
   $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
@@ -1123,3 +1127,5 @@
   $Xinfo$
   ignore $Id$
   a
+
+  $ cd ..
--- a/tests/test-largefiles-cache.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-largefiles-cache.t	Mon Jun 18 16:21:31 2012 -0300
@@ -49,7 +49,7 @@
   $ hg update
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
-  large: Can't get file locally
+  large: can't get file locally
   (no default or default-push path set in hgrc)
   0 largefiles updated, 0 removed
   $ hg status
@@ -67,7 +67,7 @@
   $ hg update
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
-  large: Can't get file locally
+  large: can't get file locally
   (no default or default-push path set in hgrc)
   0 largefiles updated, 0 removed
   $ hg status
@@ -119,3 +119,5 @@
 
   $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
   640
+
+  $ cd ..
--- a/tests/test-largefiles.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-largefiles.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,4 +1,4 @@
-  $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
+  $ "$TESTDIR/hghave" unix-permissions serve || exit 80
   $ USERCACHE=`pwd`/cache; export USERCACHE
   $ mkdir -p ${USERCACHE}
   $ cat >> $HGRCPATH <<EOF
@@ -514,7 +514,7 @@
   Invoking status precommit hook
   M sub/normal4
   M sub2/large6
-  saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg
+  saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
   nothing to rebase
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   9:598410d3eb9a  modify normal file largefile in repo d
@@ -552,7 +552,7 @@
   Invoking status precommit hook
   M sub/normal4
   M sub2/large6
-  saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg
+  saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   9:598410d3eb9a  modify normal file largefile in repo d
   8:a381d2c8c80e  modify normal file and largefile in repo b
@@ -1051,6 +1051,8 @@
   $ chmod -R u+w alice/pubrepo
   $ HOME="$ORIGHOME"
 
+#if symlink
+
 Symlink to a large largefile should behave the same as a symlink to a normal file
   $ hg init largesymlink
   $ cd largesymlink
@@ -1076,6 +1078,8 @@
   $ test -L largelink
   $ cd ..
 
+#endif
+
 test for pattern matching on 'hg status':
 to boost performance, largefiles checks whether specified patterns are
 related to largefiles in working directory (NOT to STANDIN) or not.
--- a/tests/test-lfconvert.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-lfconvert.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ cat >> $HGRCPATH <<EOF
   > [extensions]
   > largefiles =
@@ -33,6 +31,7 @@
   adding sub/normal2
   $ hg commit -m"add large, normal1" large normal1
   $ hg commit -m"add sub/*" sub
+
 Test tag parsing
   $ cat >> .hgtags <<EOF
   > IncorrectlyFormattedTag!
@@ -41,10 +40,8 @@
   > EOF
   $ hg add .hgtags
   $ hg commit -m"add large2" large2 .hgtags
-  $ hg rename large2 large3
+
 Test link+rename largefile codepath
-  $ ln -sf large large3
-  $ hg commit -m"make large2 a symlink" large2 large3
   $ [ -d .hg/largefiles ] && echo fail || echo pass
   pass
   $ cd ..
@@ -53,13 +50,24 @@
   skipping incorrectly formatted tag IncorrectlyFormattedTag!
   skipping incorrectly formatted id invalidhash
   no mapping for id 0123456789abcdef
+#if symlink
+  $ hg --cwd bigfile-repo rename large2 large3
+  $ ln -sf large bigfile-repo/large3
+  $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
+  $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
+  initializing destination largefiles-repo-symlink
+  skipping incorrectly formatted tag IncorrectlyFormattedTag!
+  skipping incorrectly formatted id invalidhash
+  no mapping for id 0123456789abcdef
   abort: renamed/copied largefile large3 becomes symlink
   [255]
+#endif
   $ cd bigfile-repo
   $ hg strip --no-backup 2
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   $ cd ..
-  $ rm -rf largefiles-repo
+  $ rm -rf largefiles-repo largefiles-repo-symlink
+
   $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
   initializing destination largefiles-repo
 
@@ -260,3 +268,5 @@
   stuff/normal2
   $ [ -d .hg/largefiles ] && echo fail || echo pass
   pass
+
+  $ cd ..
--- a/tests/test-locate.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-locate.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,5 @@
-  $ hg init t
-  $ cd t
+  $ hg init repo
+  $ cd repo
   $ echo 0 > a
   $ echo 0 > b
   $ echo 0 > t.h
@@ -118,3 +118,4 @@
   ../t.h (glob)
   ../t/e.h (glob)
 
+  $ cd ../..
--- a/tests/test-log.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-log.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
 The g is crafted to have 2 filelog topological heads in a linear
 changeset graph
 
@@ -275,10 +273,12 @@
 
 log copies, execute bit set
 
+#if execbit
   $ chmod +x e
   $ hg ci -me3 -d '7 0'
   $ hg log -v --template '{rev} {file_copies}\n' -r 6
   6 
+#endif
 
 
 log -p d
@@ -331,12 +331,12 @@
   a
   
   
-
+  $ cd ..
 
 log --follow tests
 
-  $ hg init ../follow
-  $ cd ../follow
+  $ hg init follow
+  $ cd follow
 
   $ echo base > base
   $ hg ci -Ambase -d '1 0'
@@ -539,34 +539,6 @@
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     r1
   
-log -d " " (whitespaces only)
-
-  $ hg log -d " "
-  abort: dates cannot consist entirely of whitespace
-  [255]
-
-log -d -1
-
-  $ hg log -d -1
-
-log -d ">"
-
-  $ hg log -d ">"
-  abort: invalid day spec, use '>DATE'
-  [255]
-
-log -d "<"
-
-  $ hg log -d "<"
-  abort: invalid day spec, use '<DATE'
-  [255]
-
-Negative ranges
-  $ hg log -d "--2"
-  abort: -2 must be nonnegative (see 'hg help dates')
-  [255]
-
-
 log -p -l2 --color=always
 
   $ hg --config extensions.color= --config color.mode=ansi \
@@ -614,6 +586,9 @@
 
   $ cd ..
 
+
+User
+
   $ hg init usertest
   $ cd usertest
 
@@ -898,12 +873,11 @@
   +a
   
 
+  $ cd ../..
 
-  $ cd ..
   $ hg init follow2
   $ cd follow2
 
-
 # Build the following history:
 # tip - o - x - o - x - x
 #    \                 /
@@ -1077,6 +1051,7 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add foo, related
   
+  $ cd ..
 
 Issue2383: hg log showing _less_ differences than hg diff
 
@@ -1153,7 +1128,8 @@
 
 'hg log -r rev fn' when last(filelog(fn)) != rev
 
-  $ hg init simplelog; cd simplelog
+  $ hg init simplelog
+  $ cd simplelog
   $ echo f > a
   $ hg ci -Am'a' -d '0 0'
   adding a
--- a/tests/test-mactext.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mactext.t	Mon Jun 18 16:21:31 2012 -0300
@@ -26,7 +26,7 @@
 
   $ python unix2mac.py f
   $ hg ci -m 2
-  Attempt to commit or push text file(s) using CR line endings
+  attempt to commit or push text file(s) using CR line endings
   in dea860dc51ec: f
   transaction abort!
   rollback completed
--- a/tests/test-manifest-merging.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-manifest-merging.t	Mon Jun 18 16:21:31 2012 -0300
@@ -34,3 +34,4 @@
   $ hg update --clean 1
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+  $ cd ..
--- a/tests/test-manifest.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-manifest.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
 Source bundle was generated with the following script:
 
 # hg init
--- a/tests/test-merge-closedheads.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge-closedheads.t	Mon Jun 18 16:21:31 2012 -0300
@@ -84,3 +84,4 @@
 hg commit (no reopening of some-branch)
   $ hgcommit -m 'merge with closed branch'
 
+  $ cd ..
--- a/tests/test-merge-commit.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge-commit.t	Mon Jun 18 16:21:31 2012 -0300
@@ -181,3 +181,4 @@
        2       153       7      2       4 ff4b45017382 d35118874825 000000000000
        3       160      13      3       5 3701b4893544 ff4b45017382 5345f5ab8abd
 
+  $ cd ..
--- a/tests/test-merge-symlinks.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge-symlinks.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ cat > echo.py <<EOF
   > #!/usr/bin/env python
   > import os, sys
@@ -61,3 +59,5 @@
   HG_OTHER_ISLINK 0
   HG_BASE_ISLINK 0
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+
+  $ cd ..
--- a/tests/test-merge-tools.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge-tools.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
 test merge-tools configuration - mostly exercising filemerge.py
 
   $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
@@ -46,12 +44,6 @@
   >   hg stat
   >   rm -f f.orig
   > }
-  $ domerge() {
-  >   beforemerge
-  >   echo "# hg merge $*"
-  >   hg merge $*
-  >   aftermerge
-  > }
 
 Tool selection
 
@@ -87,15 +79,17 @@
 simplest hgrc using false for merge:
 
   $ echo "false.whatever=" >> .hg/hgrc
-  $ domerge -r 2
+  $ beforemerge
   [merge-tools]
   false.whatever=
   # hg update -C 1
-  # hg merge -r 2
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -132,15 +126,16 @@
 true with higher .priority gets precedence:
 
   $ echo "true.priority=1" >> .hg/hgrc
-  $ domerge -r 2
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   # hg update -C 1
-  # hg merge -r 2
+  $ 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)
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -149,16 +144,18 @@
 
 unless lowered on command line:
 
-  $ domerge -r 2 --config merge-tools.true.priority=-7
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.true.priority=-7
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -168,16 +165,18 @@
 
 or false set higher on command line:
 
-  $ domerge -r 2 --config merge-tools.false.priority=117
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.false.priority=117
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -187,16 +186,18 @@
 
 or true.executable not found in PATH:
 
-  $ domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -206,16 +207,18 @@
 
 or true.executable with bogus path:
 
-  $ domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -226,13 +229,13 @@
 but true.executable set to cat found in PATH works:
 
   $ echo "true.executable=cat" >> .hg/hgrc
-  $ domerge -r 2
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2
+  $ hg merge -r 2
   merging f
   revision 1
   space
@@ -242,6 +245,7 @@
   space
   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
@@ -250,13 +254,13 @@
 
 and true.executable set to cat with path works:
 
-  $ domerge -r 2 --config merge-tools.true.executable=cat
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.true.executable=cat
+  $ hg merge -r 2 --config merge-tools.true.executable=cat
   merging f
   revision 1
   space
@@ -266,51 +270,57 @@
   space
   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
 
+#if unix-permissions
+
 environment variables in true.executable are handled:
 
-  $ cat > $HGTMP/merge.sh <<EOF
-  > #!/bin/sh
-  > echo 'custom merge tool'
-  > EOF
-  $ chmod +x $HGTMP/merge.sh
-  $ domerge -r 2 --config merge-tools.true.executable='$HGTMP/merge.sh'
+  $ echo 'echo "custom merge tool"' > "$HGTMP/merge.sh"
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config merge-tools.true.executable=$HGTMP/merge.sh
+  $ hg --config merge-tools.true.executable='sh' \
+  >    --config merge-tools.true.args="$HGTMP/merge.sh" \
+  >    merge -r 2
   merging f
   custom merge tool
   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
 
+#endif
+
 Tool selection and merge-patterns
 
 merge-patterns specifies new tool false:
 
-  $ domerge -r 2 --config merge-patterns.f=false
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config merge-patterns.f=false
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -320,18 +330,20 @@
 
 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
+  $ beforemerge
   [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
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -341,18 +353,20 @@
 
 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
+  $ beforemerge
   [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
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -364,17 +378,19 @@
 
 ui.merge specifies false:
 
-  $ domerge -r 2 --config ui.merge=false
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=false
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -384,15 +400,17 @@
 
 ui.merge specifies internal:fail:
 
-  $ domerge -r 2 --config ui.merge=internal:fail
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:fail
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -401,15 +419,16 @@
 
 ui.merge specifies internal:local:
 
-  $ domerge -r 2 --config ui.merge=internal:local
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:local
+  $ 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)
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -418,15 +437,16 @@
 
 ui.merge specifies internal:other:
 
-  $ domerge -r 2 --config ui.merge=internal:other
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:other
+  $ 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)
+  $ aftermerge
   # cat f
   revision 2
   space
@@ -435,17 +455,18 @@
 
 ui.merge specifies internal:prompt:
 
-  $ domerge -r 2 --config ui.merge=internal:prompt
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:prompt
+  $ 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)
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -454,16 +475,18 @@
 
 ui.merge specifies internal:dump:
 
-  $ domerge -r 2 --config ui.merge=internal:dump
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:dump
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -495,17 +518,19 @@
 
 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
+  $ beforemerge
   [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
+  $ 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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -517,17 +542,19 @@
 
 ui.merge specifies internal:other but is overruled by --tool=false
 
-  $ domerge -r 2 --config ui.merge=internal:other --tool=false
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --config ui.merge=internal:other --tool=false
+  $ hg merge -r 2 --config ui.merge=internal:other --tool=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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -538,17 +565,19 @@
 HGMERGE specifies internal:other but is overruled by --tool=false
 
   $ HGMERGE=internal:other ; export HGMERGE
-  $ domerge -r 2 --tool=false
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 2 --tool=false
+  $ hg merge -r 2 --tool=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
+  [1]
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -560,16 +589,17 @@
 
 Default is silent simplemerge:
 
-  $ domerge -r 3
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 3
+  $ 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)
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -579,16 +609,17 @@
 
 .premerge=True is same:
 
-  $ domerge -r 3 --config merge-tools.true.premerge=True
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 3 --config merge-tools.true.premerge=True
+  $ 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)
+  $ aftermerge
   # cat f
   revision 1
   space
@@ -598,13 +629,13 @@
 
 .premerge=False executes merge-tool:
 
-  $ domerge -r 3 --config merge-tools.true.premerge=False
+  $ beforemerge
   [merge-tools]
   false.whatever=
   true.priority=1
   true.executable=cat
   # hg update -C 1
-  # hg merge -r 3 --config merge-tools.true.premerge=False
+  $ hg merge -r 3 --config merge-tools.true.premerge=False
   merging f
   revision 1
   space
@@ -615,6 +646,7 @@
   revision 3
   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
@@ -721,11 +753,11 @@
   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'
+  $ hg --config merge-tools.true.executable='sh' \
+  >    --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \
+  >    merge -r 2
   merging f
   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -745,13 +777,13 @@
 
 cat is a bad merge-tool and doesn't change:
 
-  $ domerge -y -r 2 --config merge-tools.true.checkchanged=1
+  $ beforemerge
   [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
+  $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1
   merging f
   revision 1
   space
@@ -764,6 +796,8 @@
   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
   revision 1
   space
--- a/tests/test-merge1.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge1.t	Mon Jun 18 16:21:31 2012 -0300
@@ -172,3 +172,5 @@
   $ hg ci -md
   $ hg revert -r -2 b
   $ hg up -q -- -2
+
+  $ cd ..
--- a/tests/test-merge10.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge10.t	Mon Jun 18 16:21:31 2012 -0300
@@ -49,3 +49,5 @@
   @@ -1,1 +1,1 @@
   -a
   +alpha
+
+  $ cd ..
--- a/tests/test-merge2.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge2.t	Mon Jun 18 16:21:31 2012 -0300
@@ -49,3 +49,5 @@
   $ hg commit -A -m "commit #2"
   adding b
   created new head
+
+  $ cd ..
--- a/tests/test-merge6.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge6.t	Mon Jun 18 16:21:31 2012 -0300
@@ -66,3 +66,5 @@
 bar should remain deleted.
   $ hg manifest --debug
   f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644   foo
+
+  $ cd ..
--- a/tests/test-merge7.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge7.t	Mon Jun 18 16:21:31 2012 -0300
@@ -143,3 +143,5 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     Initial
   
+
+  $ cd ..
--- a/tests/test-merge8.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge8.t	Mon Jun 18 16:21:31 2012 -0300
@@ -25,3 +25,5 @@
   (run 'hg update' to get a working copy)
   $ hg update
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+
+  $ cd ..
--- a/tests/test-merge9.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-merge9.t	Mon Jun 18 16:21:31 2012 -0300
@@ -90,3 +90,5 @@
   $ hg resolve -l
   U bar
   R baz
+
+  $ cd ..
--- a/tests/test-mq-caches.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-caches.t	Mon Jun 18 16:21:31 2012 -0300
@@ -122,3 +122,4 @@
   dc25e3827021582e979f600811852e36cbe57341 0
   dc25e3827021582e979f600811852e36cbe57341 foo
 
+  $ cd ..
--- a/tests/test-mq-header-from.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-header-from.t	Mon Jun 18 16:21:31 2012 -0300
@@ -967,3 +967,5 @@
   2: Three (again) - maria
   1: imported patch 2.patch - jane
   0: imported patch 1.patch - mary
+
+  $ cd ..
--- a/tests/test-mq-qdelete.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qdelete.t	Mon Jun 18 16:21:31 2012 -0300
@@ -194,3 +194,4 @@
   revision 2b1c98802260 refers to unknown patches: 5.diff
   revision 33a6861311c0 refers to unknown patches: 4.diff
 
+  $ cd ..
--- a/tests/test-mq-qdiff.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qdiff.t	Mon Jun 18 16:21:31 2012 -0300
@@ -173,3 +173,5 @@
   $ hg qrefresh
   $ rm newfile
   $ hg qdiff
+
+  $ cd ..
--- a/tests/test-mq-qgoto.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qgoto.t	Mon Jun 18 16:21:31 2012 -0300
@@ -75,3 +75,4 @@
   abort: patch 14 not in series
   [255]
 
+  $ cd ..
--- a/tests/test-mq-qimport-fail-cleanup.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qimport-fail-cleanup.t	Mon Jun 18 16:21:31 2012 -0300
@@ -38,3 +38,5 @@
   abort: revision 0 is not mutable
   (see "hg help phases" for details)
   [255]
+
+  $ cd ..
--- a/tests/test-mq-qimport.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qimport.t	Mon Jun 18 16:21:31 2012 -0300
@@ -270,3 +270,5 @@
   $ hg qimport -r qparent
   $ hg phase qbase
   1: secret
+
+  $ cd ..
--- a/tests/test-mq-qpush-exact.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qpush-exact.t	Mon Jun 18 16:21:31 2012 -0300
@@ -286,3 +286,4 @@
   abort: p0 does not have a parent recorded
   [255]
 
+  $ cd ..
--- a/tests/test-mq-qpush-fail.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qpush-fail.t	Mon Jun 18 16:21:31 2012 -0300
@@ -422,3 +422,5 @@
   applying p2
   now at: p2
   $ hg st a
+
+  $ cd ..
--- a/tests/test-mq-qrefresh-interactive.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qrefresh-interactive.t	Mon Jun 18 16:21:31 2012 -0300
@@ -346,3 +346,5 @@
 After qrefresh 'diff'
 
   $ hg diff --nodates
+
+  $ cd ..
--- a/tests/test-mq-qrefresh.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-qrefresh.t	Mon Jun 18 16:21:31 2012 -0300
@@ -543,3 +543,4 @@
   $ hg phase p2.diff
   2: secret
 
+  $ cd ..
--- a/tests/test-mq-safety.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-safety.t	Mon Jun 18 16:21:31 2012 -0300
@@ -212,3 +212,5 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
+
+  $ cd ..
--- a/tests/test-mq-strip.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-strip.t	Mon Jun 18 16:21:31 2012 -0300
@@ -464,3 +464,5 @@
   $ hg id -ir 6:2702dd0c91e7
   abort: unknown revision '2702dd0c91e7'!
   [255]
+
+  $ cd ..
--- a/tests/test-mq-subrepo-svn.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-subrepo-svn.t	Mon Jun 18 16:21:31 2012 -0300
@@ -24,7 +24,7 @@
   $ svnurl="file://$curpath/svn-repo-2499/project"
   $ mkdir -p svn-project-2499/trunk
   $ svn import -m 'init project' svn-project-2499 "$svnurl"
-  Adding         svn-project-2499/trunk
+  Adding         svn-project-2499/trunk (glob)
   
   Committed revision 1.
 
@@ -48,3 +48,5 @@
   $ hg qnew -m1 1.diff
   abort: uncommitted changes in subrepository sub
   [255]
+
+  $ cd ..
--- a/tests/test-mq-subrepo.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq-subrepo.t	Mon Jun 18 16:21:31 2012 -0300
@@ -353,3 +353,5 @@
   $ echo sub = sub >> .hgsub
   $ hg add .hgsub
   $ hg qnew 0.diff
+
+  $ cd ..
--- a/tests/test-mq.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-mq.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
   $ checkundo()
   > {
   >     if [ -f .hg/store/undo ]; then
@@ -209,7 +207,7 @@
 try the --mq option on a command provided by an extension
 
   $ hg purge --mq --verbose --config extensions.purge=
-  Removing file flaf
+  removing file flaf
 
   $ cd ..
 
@@ -797,6 +795,7 @@
   $ hg strip -f tip
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
+  $ cd ..
 
 
 cd b; hg qrefresh
@@ -907,20 +906,27 @@
   no patches applied
   [1]
 
+  $ cd ..
+
+
+git patches
+
   $ cat >>$HGRCPATH <<EOF
   > [diff]
   > git = True
   > EOF
-  $ cd ..
   $ hg init git
   $ cd git
   $ hg qinit
 
   $ hg qnew -m'new file' new
   $ echo foo > new
+#if execbit
   $ chmod +x new
+#endif
   $ hg add new
   $ hg qrefresh
+#if execbit
   $ cat .hg/patches/new
   new file
   
@@ -930,6 +936,17 @@
   +++ b/new
   @@ -0,0 +1,1 @@
   +foo
+#else
+  $ cat .hg/patches/new
+  new file
+  
+  diff --git a/new b/new
+  new file mode 100644
+  --- /dev/null
+  +++ b/new
+  @@ -0,0 +1,1 @@
+  +foo
+#endif
 
   $ hg qnew -m'copy file' copy
   $ hg cp new copy
@@ -1181,7 +1198,7 @@
   
   $ hg strip 1
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
+  saved backup bundle to $TESTTMP/strip/.hg/strip-backup/*-backup.hg (glob)
   $ checkundo strip
   $ hg log
   changeset:   1:20cbbe65cff7
@@ -1527,3 +1544,5 @@
   0: draft
   1: secret
   2: secret
+
+  $ cd ..
--- a/tests/test-nested-repo.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-nested-repo.t	Mon Jun 18 16:21:31 2012 -0300
@@ -38,3 +38,4 @@
   [255]
   $ hg st
 
+  $ cd ..
--- a/tests/test-newbranch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-newbranch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -327,3 +327,4 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
+  $ cd ..
--- a/tests/test-notify.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-notify.t	Mon Jun 18 16:21:31 2012 -0300
@@ -19,12 +19,13 @@
   $ hg help notify
   notify extension - hooks for sending email push notifications
   
-  This extension let you run hooks sending email notifications when changesets
-  are being pushed, from the sending or receiving side.
+  This extension implements hooks to send email notifications when changesets
+  are sent from or received by the local repository.
   
   First, enable the extension as explained in "hg help extensions", and register
-  the hook you want to run. "incoming" and "changegroup" hooks are run by the
-  changesets receiver while the "outgoing" one is for the sender:
+  the hook you want to run. "incoming" and "changegroup" hooks are run when
+  changesets are received, while "outgoing" hooks are for changesets sent to
+  another repository:
   
     [hooks]
     # one email for each incoming changeset
@@ -35,12 +36,13 @@
     # one email for all outgoing changesets
     outgoing.notify = python:hgext.notify.hook
   
-  Now the hooks are running, subscribers must be assigned to repositories. Use
-  the "[usersubs]" section to map repositories to a given email or the
-  "[reposubs]" section to map emails to a single repository:
+  This registers the hooks. To enable notification, subscribers must be assigned
+  to repositories. The "[usersubs]" section maps multiple repositories to a
+  given recipient. The "[reposubs]" section maps multiple recipients to a single
+  repository:
   
     [usersubs]
-    # key is subscriber email, value is a comma-separated list of glob
+    # key is subscriber email, value is a comma-separated list of repo glob
     # patterns
     user@host = pattern
   
@@ -49,17 +51,17 @@
     # emails
     pattern = user@host
   
-  Glob patterns are matched against absolute path to repository root. The
-  subscriptions can be defined in their own file and referenced with:
+  Glob patterns are matched against absolute path to repository root.
+  
+  In order to place them under direct user management, "[usersubs]" and
+  "[reposubs]" sections may be placed in a separate "hgrc" file and incorporated
+  by reference:
   
     [notify]
     config = /path/to/subscriptionsfile
   
-  Alternatively, they can be added to Mercurial configuration files by setting
-  the previous entry to an empty value.
-  
-  At this point, notifications should be generated but will not be sent until
-  you set the "notify.test" entry to "False".
+  Notifications will not be sent until the "notify.test" value is set to
+  "False"; see below.
   
   Notifications content can be tweaked with the following configuration entries:
   
@@ -67,22 +69,25 @@
     If "True", print messages to stdout instead of sending them. Default: True.
   
   notify.sources
-    Space separated list of change sources. Notifications are sent only if it
-    includes the incoming or outgoing changes source. Incoming sources can be
-    "serve" for changes coming from http or ssh, "pull" for pulled changes,
-    "unbundle" for changes added by "hg unbundle" or "push" for changes being
-    pushed locally. Outgoing sources are the same except for "unbundle" which is
-    replaced by "bundle". Default: serve.
+    Space-separated list of change sources. Notifications are activated only
+    when a changeset's source is in this list. Sources may be:
+  
+    "serve"       changesets received via http or ssh
+    "pull"        changesets received via "hg pull"
+    "unbundle"    changesets received via "hg unbundle"
+    "push"        changesets sent or received via "hg push"
+    "bundle"      changesets sent via "hg unbundle"
+  
+    Default: serve.
   
   notify.strip
     Number of leading slashes to strip from url paths. By default, notifications
-    references repositories with their absolute path. "notify.strip" let you
+    reference repositories with their absolute path. "notify.strip" lets you
     turn them into relative paths. For example, "notify.strip=3" will change
     "/long/path/repository" into "repository". Default: 0.
   
   notify.domain
-    If subscribers emails or the from email have no domain set, complete them
-    with this value.
+    Default email domain for sender or recipients with no explicit domain.
   
   notify.style
     Style file to use when formatting emails.
@@ -91,21 +96,21 @@
     Template to use when formatting emails.
   
   notify.incoming
-    Template to use when run as incoming hook, override "notify.template".
+    Template to use when run as an incoming hook, overriding "notify.template".
   
   notify.outgoing
-    Template to use when run as outgoing hook, override "notify.template".
+    Template to use when run as an outgoing hook, overriding "notify.template".
   
   notify.changegroup
-    Template to use when running as changegroup hook, override
+    Template to use when running as a changegroup hook, overriding
     "notify.template".
   
   notify.maxdiff
     Maximum number of diff lines to include in notification email. Set to 0 to
-    disable the diff, -1 to include all of it. Default: 300.
+    disable the diff, or -1 to include all of it. Default: 300.
   
   notify.maxsubject
-    Maximum number of characters in emails subject line. Default: 67.
+    Maximum number of characters in email's subject line. Default: 67.
   
   notify.diffstat
     Set to True to include a diffstat before diff content. Default: True.
@@ -117,19 +122,20 @@
     If set, append mails to this mbox file instead of sending. Default: None.
   
   notify.fromauthor
-    If set, use the first committer of the changegroup for the "From" field of
-    the notification mail. If not set, take the user from the pushing repo.
-    Default: False.
+    If set, use the committer of the first changeset in a changegroup for the
+    "From" field of the notification mail. If not set, take the user from the
+    pushing repo.  Default: False.
   
   If set, the following entries will also be used to customize the
   notifications:
   
   email.from
-    Email "From" address to use if none can be found in generated email content.
+    Email "From" address to use if none can be found in the generated email
+    content.
   
   web.baseurl
-    Root repository browsing URL to combine with repository paths when making
-    references. See also "notify.strip".
+    Root repository URL to combine with repository paths when making references.
+    See also "notify.strip".
   
   no commands defined
   $ hg init a
--- a/tests/test-parents.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-parents.t	Mon Jun 18 16:21:31 2012 -0300
@@ -150,3 +150,5 @@
   date:        Thu Jan 01 00:00:04 1970 +0000
   summary:     c2
   
+
+  $ cd ..
--- a/tests/test-parse-date.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-parse-date.t	Mon Jun 18 16:21:31 2012 -0300
@@ -93,13 +93,29 @@
   standard: Wed Feb 01 13:00:30 2006 +0000
   $ hg debugdate "1:00:30PM" > /dev/null
 
+Normal range
+
+  $ hg log -d -1
+
+Negative range
+
+  $ hg log -d "--2"
+  abort: -2 must be nonnegative (see 'hg help dates')
+  [255]
+
+Whitespace only
+
+  $ hg log -d " "
+  abort: dates cannot consist entirely of whitespace
+  [255]
+
 Test date formats with '>' or '<' accompanied by space characters
 
   $ hg log -d '>' --template '{date|date}\n'
   abort: invalid day spec, use '>DATE'
   [255]
-  $ hg log -d '<' hg log -d '>' --template '{date|date}\n'
-  abort: invalid day spec, use '>DATE'
+  $ hg log -d '<' --template '{date|date}\n'
+  abort: invalid day spec, use '<DATE'
   [255]
 
   $ hg log -d ' >' --template '{date|date}\n'
--- a/tests/test-parseindex.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-parseindex.t	Mon Jun 18 16:21:31 2012 -0300
@@ -57,3 +57,5 @@
   2 revisions:
   7c31755bf9b5
   26333235a41c
+
+  $ cd ..
--- a/tests/test-patch-offset.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-patch-offset.t	Mon Jun 18 16:21:31 2012 -0300
@@ -75,3 +75,5 @@
 
   $ 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
+
+  $ cd ..
--- a/tests/test-patchbomb.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-patchbomb.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "patchbomb=" >> $HGRCPATH
 
@@ -10,10 +8,10 @@
   adding a
 
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] a ...
+  displaying [PATCH] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -43,7 +41,7 @@
   $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
   > n
   > EOF
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
   Final summary:
@@ -63,13 +61,13 @@
   adding b
 
   $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2] test ...
+  displaying [PATCH 0 of 2] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -82,7 +80,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -110,7 +108,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -141,12 +139,10 @@
 
 .hg/last-email.txt
 
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > echo "a precious introductory message" > "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg email -n -t foo -s test -r 0:tip > /dev/null
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null
   $ cat .hg/last-email.txt
   a precious introductory message
 
@@ -155,7 +151,7 @@
   > --config progress.delay=0 --config progress.refresh=0 \
   > --config progress.width=60 2>&1 | \
   > python "$TESTDIR/filtercr.py"
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
@@ -172,9 +168,9 @@
   sending [=============================>               ] 2/3
   sending [=============================>               ] 2/3
                                                               \r (esc)
-  Sending [PATCH 0 of 2] test ...
-  Sending [PATCH 1 of 2] a ...
-  Sending [PATCH 2 of 2] b ...
+  sending [PATCH 0 of 2] test ...
+  sending [PATCH 1 of 2] a ...
+  sending [PATCH 2 of 2] b ...
   
 
   $ cd ..
@@ -198,7 +194,7 @@
   searching for changes
   1 changesets found
   
-  Displaying test ...
+  displaying test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: test
@@ -241,10 +237,10 @@
 
 no mime encoding for email --test:
   $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] utf-8 content ...
+  displaying [PATCH] utf-8 content ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 8bit
@@ -280,10 +276,10 @@
 
 mime encoded mbox (base64):
   $ hg email --date '1970-1-1 0:4' -f 'Q <quux>' -t foo -c bar -r tip -m mbox
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Sending [PATCH] utf-8 content ...
+  sending [PATCH] utf-8 content ...
 
   $ cat mbox
   From quux ... ... .. ..:..:.. .... (re)
@@ -340,10 +336,10 @@
 
 no mime encoding for email --test:
   $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] long line ...
+  displaying [PATCH] long line ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: quoted-printable
@@ -388,10 +384,10 @@
 
 mime encoded mbox (quoted-printable):
   $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Sending [PATCH] long line ...
+  sending [PATCH] long line ...
   $ cat mbox
   From quux ... ... .. ..:..:.. .... (re)
   Content-Type: text/plain; charset="us-ascii"
@@ -446,10 +442,10 @@
 
 fake ascii mbox:
   $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Sending [PATCH] isolatin 8-bit encoding ...
+  sending [PATCH] isolatin 8-bit encoding ...
   $ cat mbox
   From quux ... ... .. ..:..:.. .... (re)
   Content-Type: text/plain; charset="us-ascii"
@@ -481,7 +477,7 @@
 
 test diffstat for single patch:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
   Final summary:
@@ -495,7 +491,7 @@
   
   are you sure you want to send (yn)? y
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -529,7 +525,7 @@
 test diffstat for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
   >  -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
@@ -553,7 +549,7 @@
   
   are you sure you want to send (yn)? y
   
-  Displaying [PATCH 0 of 2] test ...
+  displaying [PATCH 0 of 2] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -570,7 +566,7 @@
    b |  1 +
    2 files changed, 2 insertions(+), 0 deletions(-)
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -602,7 +598,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -637,10 +633,10 @@
 
 test inline for single patch:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -676,10 +672,10 @@
 
 test inline for single patch (quoted-printable):
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -731,13 +727,13 @@
 test inline for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
   >  -r 0:1 -r 4
-  This patch series consists of 3 patches.
+  this patch series consists of 3 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 3] test ...
+  displaying [PATCH 0 of 3] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -750,7 +746,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 3] a ...
+  displaying [PATCH 1 of 3] a ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 1 of 3] a
@@ -784,7 +780,7 @@
   +a
   
   --===*-- (glob)
-  Displaying [PATCH 2 of 3] b ...
+  displaying [PATCH 2 of 3] b ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 2 of 3] b
@@ -818,7 +814,7 @@
   +b
   
   --===*-- (glob)
-  Displaying [PATCH 3 of 3] long line ...
+  displaying [PATCH 3 of 3] long line ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 3 of 3] long line
@@ -871,10 +867,10 @@
 
 test attach for single patch:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -918,10 +914,10 @@
 
 test attach for single patch (quoted-printable):
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -981,10 +977,10 @@
 
 test attach and body for single patch:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -1038,13 +1034,13 @@
 test attach for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
   >  -r 0:1 -r 4
-  This patch series consists of 3 patches.
+  this patch series consists of 3 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 3] test ...
+  displaying [PATCH 0 of 3] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1057,7 +1053,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 3] a ...
+  displaying [PATCH 1 of 3] a ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 1 of 3] a
@@ -1100,7 +1096,7 @@
   +a
   
   --===*-- (glob)
-  Displaying [PATCH 2 of 3] b ...
+  displaying [PATCH 2 of 3] b ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 2 of 3] b
@@ -1143,7 +1139,7 @@
   +b
   
   --===*-- (glob)
-  Displaying [PATCH 3 of 3] long line ...
+  displaying [PATCH 3 of 3] long line ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 3 of 3] long line
@@ -1206,13 +1202,13 @@
 test intro for single patch:
   $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
   >  -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 1] test ...
+  displaying [PATCH 0 of 1] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1225,7 +1221,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 1] c ...
+  displaying [PATCH 1 of 1] c ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1258,10 +1254,10 @@
   $ echo foo > intro.text
   $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
   >  -s test -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH 0 of 1] test ...
+  displaying [PATCH 0 of 1] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1275,7 +1271,7 @@
   
   foo
   
-  Displaying [PATCH 1 of 1] c ...
+  displaying [PATCH 1 of 1] c ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1307,13 +1303,13 @@
 test intro for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
   >  -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2] test ...
+  displaying [PATCH 0 of 2] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1326,7 +1322,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1354,7 +1350,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1386,10 +1382,10 @@
 test reply-to via config:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
   >  --config patchbomb.reply-to='baz@example.com'
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1420,10 +1416,10 @@
 test reply-to via command line:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
   >  --reply-to baz --reply-to fred
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1458,10 +1454,10 @@
 
 test inline for single named patch:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH] test
@@ -1496,13 +1492,13 @@
 
 test inline for multiple named/unnamed patches:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2] test ...
+  displaying [PATCH 0 of 2] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1515,7 +1511,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 1 of 2] a
@@ -1549,7 +1545,7 @@
   +a
   
   --===*-- (glob)
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: multipart/mixed; boundary="===*" (glob)
   MIME-Version: 1.0
   Subject: [PATCH 2 of 2] b
@@ -1588,10 +1584,10 @@
 test inreplyto:
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
   >  -r tip
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
+  displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1626,11 +1622,11 @@
 no intro message in non-interactive mode
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
   >  -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   (optional) Subject: [PATCH 0 of 2] 
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1658,7 +1654,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1691,13 +1687,13 @@
 
   $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
   >  -s test -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2] test ...
+  displaying [PATCH 0 of 2] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1712,7 +1708,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2] a ...
+  displaying [PATCH 1 of 2] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1740,7 +1736,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2] b ...
+  displaying [PATCH 2 of 2] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1772,10 +1768,10 @@
 test single flag for single patch:
   $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
   >  -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH fooFlag] test ...
+  displaying [PATCH fooFlag] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1805,13 +1801,13 @@
 test single flag for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
   >  -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2 fooFlag] test ...
+  displaying [PATCH 0 of 2 fooFlag] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1824,7 +1820,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2 fooFlag] a ...
+  displaying [PATCH 1 of 2 fooFlag] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1852,7 +1848,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2 fooFlag] b ...
+  displaying [PATCH 2 of 2 fooFlag] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1884,10 +1880,10 @@
 test mutiple flags for single patch:
   $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
   >  -c bar -s test -r 2
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Displaying [PATCH fooFlag barFlag] test ...
+  displaying [PATCH fooFlag barFlag] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1917,13 +1913,13 @@
 test multiple flags for multiple patches:
   $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
   >  -c bar -s test -r 0:1
-  This patch series consists of 2 patches.
+  this patch series consists of 2 patches.
   
   
   Write the introductory message for the patch series.
   
   
-  Displaying [PATCH 0 of 2 fooFlag barFlag] test ...
+  displaying [PATCH 0 of 2 fooFlag barFlag] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1936,7 +1932,7 @@
   Cc: bar
   
   
-  Displaying [PATCH 1 of 2 fooFlag barFlag] a ...
+  displaying [PATCH 1 of 2 fooFlag barFlag] a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1964,7 +1960,7 @@
   @@ -0,0 +1,1 @@
   +a
   
-  Displaying [PATCH 2 of 2 fooFlag barFlag] b ...
+  displaying [PATCH 2 of 2 fooFlag barFlag] b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -1997,10 +1993,10 @@
   $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
   >  -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
   >  --config email.bcc='"Quux, A." <quux>'
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   
-  Sending [PATCH] test ...
+  sending [PATCH] test ...
   $ cat < tmp.mbox
   From quux ... ... .. ..:..:.. .... (re)
   Content-Type: text/plain; charset="us-ascii"
@@ -2036,11 +2032,11 @@
   $ HGENCODING=iso-8859-1
   $ export HGENCODING
   $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   Cc: 
   
-  Sending [PATCH] test ...
+  sending [PATCH] test ...
 
   $ cat tmp.mbox
   From quux ... ... .. ..:..:.. .... (re)
@@ -2085,14 +2081,14 @@
   comparing with ../t
   searching for changes
   From [test]: test
-  This patch series consists of 8 patches.
+  this patch series consists of 8 patches.
   
   
   Write the introductory message for the patch series.
   
   Cc: 
   
-  Displaying [PATCH 0 of 8] test ...
+  displaying [PATCH 0 of 8] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2104,7 +2100,7 @@
   To: foo
   
   
-  Displaying [PATCH 1 of 8] c ...
+  displaying [PATCH 1 of 8] c ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2131,7 +2127,7 @@
   @@ -0,0 +1,1 @@
   +c
   
-  Displaying [PATCH 2 of 8] utf-8 content ...
+  displaying [PATCH 2 of 8] utf-8 content ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 8bit
@@ -2165,7 +2161,7 @@
   @@ -0,0 +1,1 @@
   +h\xc3\xb6mma! (esc)
   
-  Displaying [PATCH 3 of 8] long line ...
+  displaying [PATCH 3 of 8] long line ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: quoted-printable
@@ -2208,7 +2204,7 @@
   +
   +bar
   
-  Displaying [PATCH 4 of 8] isolatin 8-bit encoding ...
+  displaying [PATCH 4 of 8] isolatin 8-bit encoding ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 8bit
@@ -2235,7 +2231,7 @@
   @@ -0,0 +1,1 @@
   +h\xf6mma! (esc)
   
-  Displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
+  displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2263,7 +2259,7 @@
   +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
   +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
   
-  Displaying [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7 ...
+  displaying [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7 ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2293,7 +2289,7 @@
   +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
   +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
   
-  Displaying [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b ...
+  displaying [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2324,7 +2320,7 @@
   +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
   +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
   
-  Displaying [PATCH 8 of 8] d ...
+  displaying [PATCH 8 of 8] d ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2358,11 +2354,11 @@
   comparing with ../t
   searching for changes
   From [test]: test
-  This patch series consists of 1 patches.
+  this patch series consists of 1 patches.
   
   Cc: 
   
-  Displaying [PATCH] test ...
+  displaying [PATCH] test ...
   Content-Type: text/plain; charset="us-ascii"
   MIME-Version: 1.0
   Content-Transfer-Encoding: 7bit
@@ -2388,3 +2384,5 @@
   @@ -0,0 +1,1 @@
   +d
   
+
+  $ cd ..
--- a/tests/test-paths.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-paths.t	Mon Jun 18 16:21:31 2012 -0300
@@ -62,3 +62,4 @@
   $ hg -q id
   000000000000
 
+  $ cd ..
--- a/tests/test-pending.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pending.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
 Verify that pending changesets are seen by pretxn* hooks but not by other
 processes that access the destination repo while the hooks are running.
 
@@ -62,7 +60,6 @@
 external hook
 
   $ cat <<EOF > reject.sh
-  > #! /bin/sh
   > printf 'hook '; hg tip --template '{node}\\n'
   > # create the notify file so caller knows we're running
   > fpath=$d/notify
@@ -75,7 +72,6 @@
   > done
   > exit 1 # reject the changesets
   > EOF
-  $ chmod +x reject.sh
 
 create repos
 
@@ -107,7 +103,7 @@
 
   $ cat <<EOF > parent/.hg/hgrc
   > [hooks]
-  > pretxnchangegroup = $d/reject.sh
+  > pretxnchangegroup = sh $d/reject.sh
   > EOF
 
   $ dotest
--- a/tests/test-permissions.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-permissions.t	Mon Jun 18 16:21:31 2012 -0300
@@ -69,3 +69,4 @@
 
   $ chmod +rx dir
 
+  $ cd ..
--- a/tests/test-phases.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-phases.t	Mon Jun 18 16:21:31 2012 -0300
@@ -475,3 +475,5 @@
   cannot move 1 changesets to a more permissive phase, use --force
   no phases changed
   [1]
+
+  $ cd ..
--- a/tests/test-profile.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-profile.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,31 +1,31 @@
 test --time
 
-  $ hg --time help -q help 2>&1 | grep Time > /dev/null
+  $ hg --time help -q help 2>&1 | grep time > /dev/null
   $ hg init a
   $ cd a
 
+#if lsprof
+
 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
+  $ hg --profile st 2>../out
+  $ grep CallCount ../out > /dev/null || cat ../out
+
+  $ hg --profile --config profiling.output=../out st
+  $ grep CallCount ../out > /dev/null || cat ../out
+
+  $ hg --profile --config profiling.format=text st 2>../out
+  $ grep CallCount ../out > /dev/null || cat ../out
+
+  $ echo "[profiling]" >> $HGRCPATH
+  $ echo "format=kcachegrind" >> $HGRCPATH
+
+  $ hg --profile st 2>../out
+  $ grep 'events: Ticks' ../out > /dev/null || cat ../out
+
+  $ hg --profile --config profiling.output=../out st
+  $ grep 'events: Ticks' ../out > /dev/null || cat ../out
+
+#endif
+
+  $ cd ..
--- a/tests/test-pull-branch.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-branch.t	Mon Jun 18 16:21:31 2012 -0300
@@ -212,3 +212,5 @@
   adding file changes
   added 2 changesets with 2 changes to 2 files (+2 heads)
   (run 'hg heads .' to see heads, 'hg merge' to merge)
+
+  $ cd ..
--- a/tests/test-pull-http.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-http.t	Mon Jun 18 16:21:31 2012 -0300
@@ -61,3 +61,5 @@
   searching for changes
   abort: authorization failed
   % serve errors
+
+  $ cd ..
--- a/tests/test-pull-permission.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-permission.t	Mon Jun 18 16:21:31 2012 -0300
@@ -29,3 +29,4 @@
   checking files
   1 files, 1 changesets, 1 total revisions
 
+  $ cd ..
--- a/tests/test-pull-pull-corruption.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-pull-corruption.t	Mon Jun 18 16:21:31 2012 -0300
@@ -68,3 +68,5 @@
   crosschecking files in changesets and manifests
   checking files
   1 files, 11 changesets, 11 total revisions
+
+  $ cd ..
--- a/tests/test-pull-r.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-r.t	Mon Jun 18 16:21:31 2012 -0300
@@ -101,3 +101,4 @@
 
   $ hg pull -qr 1 ../repo
 
+  $ cd ..
--- a/tests/test-pull-update.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull-update.t	Mon Jun 18 16:21:31 2012 -0300
@@ -59,3 +59,4 @@
   added 1 changesets with 1 changes to 1 files (-1 heads)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+  $ cd ..
--- a/tests/test-pull.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-pull.t	Mon Jun 18 16:21:31 2012 -0300
@@ -88,3 +88,5 @@
 
   $ URL=`python -c "import os; print 'file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"`
   $ hg pull -q "$URL"
+
+  $ cd ..
--- a/tests/test-purge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-purge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -24,7 +24,7 @@
   $ hg purge -p
   empty_dir
   $ hg purge -v
-  Removing directory empty_dir
+  removing directory empty_dir
   $ ls
   directory
   r1
@@ -38,9 +38,9 @@
   untracked_dir/untracked_file1
   untracked_dir/untracked_file2
   $ hg purge -v
-  Removing file untracked_dir/untracked_file1
-  Removing file untracked_dir/untracked_file2
-  Removing directory untracked_dir
+  removing file untracked_dir/untracked_file1
+  removing file untracked_dir/untracked_file2
+  removing directory untracked_dir
   $ ls
   directory
   r1
@@ -58,8 +58,8 @@
   untracked_file
   untracked_file_readonly
   $ hg purge -v
-  Removing file untracked_file
-  Removing file untracked_file_readonly
+  removing file untracked_file
+  removing file untracked_file_readonly
   $ ls
   directory
   r1
@@ -70,7 +70,7 @@
   $ hg purge -p
   directory/untracked_file
   $ hg purge -v
-  Removing file directory/untracked_file
+  removing file directory/untracked_file
   $ ls
   directory
   r1
@@ -81,8 +81,8 @@
   $ hg purge -p
   untracked_directory/nested_directory
   $ hg purge -v
-  Removing directory untracked_directory/nested_directory
-  Removing directory untracked_directory
+  removing directory untracked_directory/nested_directory
+  removing directory untracked_directory
   $ ls
   directory
   r1
@@ -94,8 +94,8 @@
   $ hg purge -p
   untracked_directory/nested_directory
   $ hg purge -v
-  Removing directory untracked_directory/nested_directory
-  Removing directory untracked_directory
+  removing directory untracked_directory/nested_directory
+  removing directory untracked_directory
   $ cd ..
   $ ls
   directory
@@ -109,8 +109,8 @@
   $ hg purge -p ../untracked_directory
   untracked_directory/nested_directory
   $ hg purge -v ../untracked_directory
-  Removing directory untracked_directory/nested_directory
-  Removing directory untracked_directory
+  removing directory untracked_directory/nested_directory
+  removing directory untracked_directory
   $ cd ..
   $ ls
   directory
@@ -131,7 +131,7 @@
   $ hg purge -p --all
   ignored
   $ hg purge -v --all
-  Removing file ignored
+  removing file ignored
   $ ls
   directory
   r1
@@ -152,7 +152,7 @@
   $ hg purge -p
   untracked_file
   $ hg purge -v 2> /dev/null
-  Removing file untracked_file
+  removing file untracked_file
   $ hg st
   ! r1
 
@@ -168,7 +168,7 @@
   $ hg purge -p
   untracked_file
   $ hg purge -v
-  Removing file untracked_file
+  removing file untracked_file
 
 skip excluded files
 
@@ -214,3 +214,5 @@
   $ touch directory/.svn/foo
   $ hg purge -p -X .svn -X '*/.svn'
   $ hg purge -p -X re:.*.svn
+
+  $ cd ..
--- a/tests/test-push-cgi.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-push-cgi.t	Mon Jun 18 16:21:31 2012 -0300
@@ -88,3 +88,5 @@
   adding manifests
   adding file changes
   added 0 changesets with 0 changes to 1 files
+
+  $ cd ..
--- a/tests/test-push-http.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-push-http.t	Mon Jun 18 16:21:31 2012 -0300
@@ -119,3 +119,5 @@
   searching for changes
   abort: authorization failed
   % serve errors
+
+  $ cd ..
--- a/tests/test-push-r.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-push-r.t	Mon Jun 18 16:21:31 2012 -0300
@@ -146,3 +146,4 @@
   checking files
   4 files, 9 changesets, 7 total revisions
 
+  $ cd ..
--- a/tests/test-push-validation.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-push-validation.t	Mon Jun 18 16:21:31 2012 -0300
@@ -50,3 +50,4 @@
   abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
   [255]
 
+  $ cd ..
--- a/tests/test-push-warn.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-push-warn.t	Mon Jun 18 16:21:31 2012 -0300
@@ -727,3 +727,5 @@
   searching for changes
   no changes found
   [1]
+
+  $ cd ..
--- a/tests/test-qrecord.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-qrecord.t	Mon Jun 18 16:21:31 2012 -0300
@@ -398,3 +398,5 @@
 After qrecord b.patch 'diff'
 
   $ hg diff --nodates
+
+  $ cd ..
--- a/tests/test-rebase-abort.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-abort.t	Mon Jun 18 16:21:31 2012 -0300
@@ -154,3 +154,5 @@
   |/
   o  0:public 'A'
   
+
+  $ cd ..
--- a/tests/test-rebase-bookmarks.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-bookmarks.t	Mon Jun 18 16:21:31 2012 -0300
@@ -86,3 +86,5 @@
   |
   o  0: 'A' bookmarks:
   
+
+  $ cd ..
--- a/tests/test-rebase-cache.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-cache.t	Mon Jun 18 16:21:31 2012 -0300
@@ -262,3 +262,4 @@
   
   $ hg verify -q
 
+  $ cd ..
--- a/tests/test-rebase-check-restore.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-check-restore.t	Mon Jun 18 16:21:31 2012 -0300
@@ -146,3 +146,5 @@
   |/
   o  0:draft 'A'
   
+
+  $ cd ..
--- a/tests/test-rebase-conflicts.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-conflicts.t	Mon Jun 18 16:21:31 2012 -0300
@@ -118,3 +118,4 @@
   $ hg cat -r 5 common
   resolved merge
 
+  $ cd ..
--- a/tests/test-rebase-detach.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-detach.t	Mon Jun 18 16:21:31 2012 -0300
@@ -396,3 +396,5 @@
   |/
   o  0:draft 'A'
   
+
+  $ cd ..
--- a/tests/test-rebase-issue-noparam-single-rev.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-issue-noparam-single-rev.t	Mon Jun 18 16:21:31 2012 -0300
@@ -124,3 +124,5 @@
   |
   o  0: 'c1'
   
+
+  $ cd ..
--- a/tests/test-rebase-mq-skip.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-mq-skip.t	Mon Jun 18 16:21:31 2012 -0300
@@ -135,3 +135,5 @@
   |
   o  0: 'r0' tags:
   
+
+  $ cd ..
--- a/tests/test-rebase-mq.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-mq.t	Mon Jun 18 16:21:31 2012 -0300
@@ -235,6 +235,7 @@
   -mq1
   +mq2
 
+  $ cd ..
 
 Rebase with guards
 
@@ -339,3 +340,4 @@
   |
   o  0:* 'a' tags: (glob)
   
+  $ cd ..
--- a/tests/test-rebase-newancestor.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-newancestor.t	Mon Jun 18 16:21:31 2012 -0300
@@ -52,3 +52,5 @@
   |
   o  0: 'A'
   
+
+  $ cd ..
--- a/tests/test-rebase-parameters.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-parameters.t	Mon Jun 18 16:21:31 2012 -0300
@@ -427,3 +427,4 @@
   tool option will be ignored
   saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob)
 
+  $ cd ..
--- a/tests/test-rebase-pull.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-pull.t	Mon Jun 18 16:21:31 2012 -0300
@@ -113,3 +113,4 @@
   o  2: 'R1'
   |
 
+  $ cd ..
--- a/tests/test-rebase-rename.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebase-rename.t	Mon Jun 18 16:21:31 2012 -0300
@@ -168,3 +168,4 @@
    unrelated.txt |  1 +
    1 files changed, 1 insertions(+), 0 deletions(-)
 
+  $ cd ..
--- a/tests/test-rebuildstate.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rebuildstate.t	Mon Jun 18 16:21:31 2012 -0300
@@ -27,3 +27,4 @@
   ? baz
   C foo
 
+  $ cd ..
--- a/tests/test-record.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-record.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
 Set up a repo
 
   $ echo "[ui]" >> $HGRCPATH
@@ -772,6 +770,8 @@
   +a
   
 
+#if execbit
+
 Preserve chmod +x
 
   $ chmod +x f1
@@ -885,8 +885,120 @@
   +c
   
 
+#else
+
+Slightly bogus tests to get almost same repo structure as when x bit is used
+- but with different hashes.
+
+Mock "Preserve chmod +x"
+
+  $ echo a >> f1
+  $ hg record -d '20 0' -mz <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  @@ -1,2 +1,3 @@
+   a
+   a
+  +a
+  record this change to 'subdir/f1'? [Ynesfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   22:0d463bd428f5
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:20 1970 +0000
+  summary:     z
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -1,2 +1,3 @@
+   a
+   a
+  +a
+  
+
+Mock "Preserve execute permission on original"
+
+  $ echo b >> f1
+  $ hg record -d '21 0' -maa <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  @@ -1,3 +1,4 @@
+   a
+   a
+   a
+  +b
+  record this change to 'subdir/f1'? [Ynesfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   23:0eab41a3e524
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:21 1970 +0000
+  summary:     aa
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -1,3 +1,4 @@
+   a
+   a
+   a
+  +b
+  
+
+Mock "Preserve chmod -x"
+
+  $ chmod -x f1
+  $ echo c >> f1
+  $ hg record -d '22 0' -mab <<EOF
+  > y
+  > y
+  > y
+  > EOF
+  diff --git a/subdir/f1 b/subdir/f1
+  1 hunks, 1 lines changed
+  examine changes to 'subdir/f1'? [Ynesfdaq?] 
+  @@ -2,3 +2,4 @@
+   a
+   a
+   b
+  +c
+  record this change to 'subdir/f1'? [Ynesfdaq?] 
+
+  $ hg tip --config diff.git=True -p
+  changeset:   24:f4f718f27b7c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:22 1970 +0000
+  summary:     ab
+  
+  diff --git a/subdir/f1 b/subdir/f1
+  --- a/subdir/f1
+  +++ b/subdir/f1
+  @@ -2,3 +2,4 @@
+   a
+   a
+   b
+  +c
+  
+
+#endif
+
   $ cd ..
 
+
 Abort early when a merge is in progress
 
   $ hg up 4
@@ -917,12 +1029,10 @@
 
 Editing patch
 
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > sed -e 7d -e '5s/^-/ /' "$1" > tmp
   > mv tmp "$1"
   > __EOF__
-  $ chmod +x editor
   $ cat > editedfile << '__EOF__'
   > This is the first line
   > This is the second line
@@ -935,7 +1045,7 @@
   > This change will be committed
   > This is the third line
   > __EOF__
-  $ HGEDITOR="'`pwd`'"/editor hg record -d '23 0' -medit-patch-2 <<EOF
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF
   > y
   > e
   > EOF
@@ -980,13 +1090,11 @@
   $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
   $ mv tmp editedfile
   $ echo "This line has been added" >> editedfile
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > sed -e 's/^[-+]/ /' "$1" > tmp
   > mv tmp "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
   > y
   > e
   > EOF
@@ -1017,13 +1125,11 @@
   $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
   $ mv tmp editedfile
   $ echo "This line has been added" >> editedfile
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > sed s/This/That/ "$1" > tmp
   > mv tmp "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
   > y
   > e
   > EOF
@@ -1096,13 +1202,13 @@
   record this change to 'subdir/f1'? [Ynesfdaq?] 
 
   $ hg tip -p
-  changeset:   28:287ad1f41a72
+  changeset:   28:* (glob)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:24 1970 +0000
   summary:     w1
   
-  diff -r 65ce23a81197 -r 287ad1f41a72 subdir/f1
+  diff -r ???????????? -r ???????????? subdir/f1 (glob)
   --- a/subdir/f1	Thu Jan 01 00:00:23 1970 +0000
   +++ b/subdir/f1	Thu Jan 01 00:00:24 1970 +0000
   @@ -3,3 +3,4 @@
@@ -1111,3 +1217,5 @@
    c
   +d
   
+
+  $ cd ..
--- a/tests/test-relink.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-relink.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,3 +1,5 @@
+  $ "$TESTDIR/hghave" hardlink || exit 80
+
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "relink=" >> $HGRCPATH
 
--- a/tests/test-remove-new.t	Mon Jun 18 20:07:25 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-test that 'hg commit' does not crash if the user removes a newly added file
-
-  $ hg init
-  $ echo This is file a1 > a
-  $ hg add a
-  $ hg commit -m "commit #0"
-  $ touch b
-  $ hg add b
-  $ rm b
-  $ hg commit -A -m"comment #1"
-  removing b
-  nothing changed
-  [1]
--- a/tests/test-remove.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-remove.t	Mon Jun 18 16:21:31 2012 -0300
@@ -254,3 +254,15 @@
   $ hg ci -m remove
   $ ls issue1861
   x
+
+test that commit does not crash if the user removes a newly added file
+
+  $ touch f1
+  $ hg add f1
+  $ rm f1
+  $ hg ci -A -mx
+  removing f1
+  nothing changed
+  [1]
+
+  $ cd ..
--- a/tests/test-rename-after-merge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rename-after-merge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -118,3 +118,4 @@
   $ hg log -r tip -C -v | grep copies
   copies:      b2 (b1)
 
+  $ cd ..
--- a/tests/test-rename-dir-merge.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rename-dir-merge.t	Mon Jun 18 16:21:31 2012 -0300
@@ -155,3 +155,5 @@
     a/aa/g
   R a/aa/g
   R a/f
+
+  $ cd ..
--- a/tests/test-rename-merge2.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rename-merge2.t	Mon Jun 18 16:21:31 2012 -0300
@@ -750,3 +750,5 @@
   M c
   --------------
   
+
+  $ cd ..
--- a/tests/test-rename.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rename.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" symlink || exit 80
-
   $ hg init
   $ mkdir d1 d1/d11 d2
   $ echo d1/a > d1/a
@@ -390,6 +388,7 @@
 
 attempt to overwrite an existing broken symlink
 
+#if symlink
   $ ln -s ba d1/ca
   $ hg rename --traceback d1/ba d1/ca
   d1/ca: not overwriting - file exists
@@ -410,6 +409,7 @@
   $ hg update -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm d1/ca
+#endif
 
 do not copy more than one source file to the same destination file
 
--- a/tests/test-repair-strip.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-repair-strip.t	Mon Jun 18 16:21:31 2012 -0300
@@ -129,3 +129,4 @@
   checking files
   2 files, 2 changesets, 2 total revisions
 
+  $ cd ..
--- a/tests/test-requires.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-requires.t	Mon Jun 18 16:21:31 2012 -0300
@@ -15,3 +15,5 @@
   $ hg tip
   abort: unknown repository format: requires features 'indoor-pool', 'outdoor-pool' (upgrade Mercurial)!
   [255]
+
+  $ cd ..
--- a/tests/test-resolve.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-resolve.t	Mon Jun 18 16:21:31 2012 -0300
@@ -42,3 +42,5 @@
 resolve -l, should be empty
 
   $ hg resolve -l
+
+  $ cd ..
--- a/tests/test-revert-flags.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revert-flags.t	Mon Jun 18 16:21:31 2012 -0300
@@ -19,3 +19,5 @@
   diff --git a/foo b/foo
   old mode 100755
   new mode 100644
+
+  $ cd ..
--- a/tests/test-revert.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revert.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" execbit || exit 80
-
   $ hg init repo
   $ cd repo
   $ echo 123 > a
@@ -155,6 +153,7 @@
 
   $ hg update -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+#if execbit
   $ chmod +x c
   $ hg revert --all
   reverting c
@@ -175,6 +174,7 @@
 
   $ test -x c && echo executable
   executable
+#endif
 
   $ cd ..
 
@@ -274,3 +274,5 @@
 
   $ hg revert --no-backup ignored removed
   $ hg st -mardi
+
+  $ cd ..
--- a/tests/test-revlog-group-emptyiter.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revlog-group-emptyiter.t	Mon Jun 18 16:21:31 2012 -0300
@@ -32,3 +32,4 @@
   adding file changes
   added 1 changesets with 0 changes to 0 files (+1 heads)
 
+  $ cd ..
--- a/tests/test-revlog-packentry.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revlog-packentry.t	Mon Jun 18 16:21:31 2012 -0300
@@ -19,3 +19,5 @@
      rev    offset  length   base linkrev nodeid       p1           p2
        0         0       0      0       0 b80de5d13875 000000000000 000000000000
        1         0      24      0       1 0376abec49b8 000000000000 000000000000
+
+  $ cd ..
--- a/tests/test-revset-dirstate-parents.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revset-dirstate-parents.t	Mon Jun 18 16:21:31 2012 -0300
@@ -56,3 +56,5 @@
   $ log 'parents()'
   1
   2
+
+  $ cd ..
--- a/tests/test-revset-outgoing.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-revset-outgoing.t	Mon Jun 18 16:21:31 2012 -0300
@@ -91,3 +91,4 @@
   $ hg tlog -r 'outgoing("green")'
   3:f0461977a3db: '4' 
 
+  $ cd ..
--- a/tests/test-rollback.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-rollback.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" serve || exit 80
-
 setup repo
   $ hg init t
   $ cd t
@@ -110,12 +108,10 @@
 
 same thing, but run $EDITOR
 
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > echo "another precious commit message" > "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1
   transaction abort!
   rollback completed
   note: commit message saved in .hg/last-message.txt
@@ -126,6 +122,7 @@
 
 test rollback on served repository
 
+#if serve
   $ hg commit -m "precious commit message"
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
   $ cat hg.pid >> $DAEMON_PIDS
@@ -150,6 +147,7 @@
   working directory now based on revision 0
   $ hg id default
   791dd2169706
+#endif
 
 update to older changeset and then refuse rollback, because
 that would lose data (issue2998)
@@ -185,3 +183,5 @@
   rolling back unknown transaction
   $ cat a
   a
+
+  $ cd ..
--- a/tests/test-run-tests.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-run-tests.t	Mon Jun 18 16:21:31 2012 -0300
@@ -52,9 +52,41 @@
   $ echo 'foo (re)'
   foo (re)
 
+testing hghave
+
+  $ "$TESTDIR/hghave" true
+  $ "$TESTDIR/hghave" false
+  skipped: missing feature: nail clipper
+  [1]
+  $ "$TESTDIR/hghave" no-true
+  skipped: system supports yak shaving
+  [1]
+  $ "$TESTDIR/hghave" no-false
+
 Conditional sections based on hghave:
 
-#if fifo no-fifo
+#if true
+  $ echo tested
+  tested
+#else
+  $ echo skipped
+#endif
+
+#if false
+  $ echo skipped
+#else
+  $ echo tested
+  tested
+#endif
+
+#if no-false
+  $ echo tested
+  tested
+#else
+  $ echo skipped
+#endif
+
+#if no-true
   $ echo skipped
 #else
   $ echo tested
--- a/tests/test-schemes.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-schemes.t	Mon Jun 18 16:21:31 2012 -0300
@@ -46,3 +46,5 @@
 errors
 
   $ cat errors.log
+
+  $ cd ..
--- a/tests/test-serve.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-serve.t	Mon Jun 18 16:21:31 2012 -0300
@@ -80,3 +80,5 @@
   $ hgserve --prefix /foo/
   listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1)
   % errors
+
+  $ cd ..
--- a/tests/test-setdiscovery.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-setdiscovery.t	Mon Jun 18 16:21:31 2012 -0300
@@ -324,3 +324,4 @@
   5 total queries
   common heads: 3ee37d65064a
 
+  $ cd ..
--- a/tests/test-share.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-share.t	Mon Jun 18 16:21:31 2012 -0300
@@ -125,3 +125,5 @@
   $ cd ../repo1
   $ hg id -r tip
   c2e0ac586386 tip
+
+  $ cd ..
--- a/tests/test-simple-update.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-simple-update.t	Mon Jun 18 16:21:31 2012 -0300
@@ -54,3 +54,5 @@
   $ hg upd -d foo 0
   abort: you can't specify a revision and a date
   [255]
+
+  $ cd ..
--- a/tests/test-ssh-clone-r.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-ssh-clone-r.t	Mon Jun 18 16:21:31 2012 -0300
@@ -191,3 +191,5 @@
   crosschecking files in changesets and manifests
   checking files
   4 files, 9 changesets, 7 total revisions
+
+  $ cd ..
--- a/tests/test-ssh.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-ssh.t	Mon Jun 18 16:21:31 2012 -0300
@@ -21,14 +21,14 @@
 repo not found error
 
   $ hg clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
-  remote: abort: There is no Mercurial repository here (.hg not found)!
+  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 \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local
-  remote: abort: There is no Mercurial repository here (.hg not found)!
+  remote: abort: there is no Mercurial repository here (.hg not found)!
   abort: no suitable response from remote hg!
   [255]
 
@@ -332,7 +332,7 @@
   $ echo "baz" > bar
   $ hg ci -A -m "unpushable commit" bar
   $ hg push --ssh "sh ../ssh.sh"
-  pushing to ssh://user@dummy/$TESTTMP/remote
+  pushing to ssh://user@dummy/*/remote (glob)
   searching for changes
   remote: Permission denied
   remote: abort: prechangegroup.hg-ssh hook failed
--- a/tests/test-status-color.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-status-color.t	Mon Jun 18 16:21:31 2012 -0300
@@ -296,3 +296,5 @@
   $ hg resolve --color=always -l
   \x1b[0;31;1mU a\x1b[0m (esc)
   \x1b[0;32;1mR b\x1b[0m (esc)
+
+  $ cd ..
--- a/tests/test-subrepo-git.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo-git.t	Mon Jun 18 16:21:31 2012 -0300
@@ -512,3 +512,5 @@
   $ hg forget 'notafile*'
   notafile*: No such file or directory
   [1]
+
+  $ cd ..
--- a/tests/test-subrepo-missing.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo-missing.t	Mon Jun 18 16:21:31 2012 -0300
@@ -67,3 +67,5 @@
   $ hg st
   $ ls subrepo
   a
+
+  $ cd ..
--- a/tests/test-subrepo-paths.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo-paths.t	Mon Jun 18 16:21:31 2012 -0300
@@ -57,3 +57,5 @@
   $ hg debugsub
   abort: bad subrepository pattern in $TESTTMP/outer/.hg/hgrc:2: invalid group reference (glob)
   [255]
+
+  $ cd ..
--- a/tests/test-subrepo-recursion.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo-recursion.t	Mon Jun 18 16:21:31 2012 -0300
@@ -490,3 +490,5 @@
   $ hg add .hgsub
   $ touch a x/a
   $ hg add a x/a
+
+  $ cd ..
--- a/tests/test-subrepo-svn.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo-svn.t	Mon Jun 18 16:21:31 2012 -0300
@@ -456,9 +456,7 @@
   
   Checked out revision 5.
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ if "$TESTDIR/hghave" -q svn15; then
-  > hg up 2 >/dev/null 2>&1 || echo update failed
-  > fi
+  $ hg up -q 2
 
 Modify one of the externals to point to a different path so we can
 test having obstructions when switching branches on checkout:
--- a/tests/test-subrepo.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-subrepo.t	Mon Jun 18 16:21:31 2012 -0300
@@ -3,9 +3,6 @@
   $ echo "[ui]" >> $HGRCPATH
   $ echo "commitsubrepos = Yes" >> $HGRCPATH
 
-  $ rm -rf sub
-  $ mkdir sub
-  $ cd sub
   $ hg init t
   $ cd t
 
@@ -266,9 +263,9 @@
   $ cd ..
   $ hg clone t tc
   updating to branch default
-  cloning subrepo s from $TESTTMP/sub/t/s (glob)
-  cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
-  cloning subrepo t from $TESTTMP/sub/t/t (glob)
+  cloning subrepo s from $TESTTMP/t/s (glob)
+  cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
+  cloning subrepo t from $TESTTMP/t/t (glob)
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd tc
   $ hg debugsub
@@ -285,14 +282,14 @@
   $ hg ci -m11
   committing subrepository t
   $ hg push
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   no changes found
-  pushing subrepo t to $TESTTMP/sub/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -310,27 +307,27 @@
   $ hg ci -m12
   committing subrepository s
   $ hg push
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   abort: push creates new remote head 12a213df6fa9!
   (did you forget to merge? use push -f to force)
   [255]
   $ hg push -f
-  pushing to $TESTTMP/sub/t (glob)
-  pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
+  pushing to $TESTTMP/t (glob)
+  pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/sub/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s (glob)
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  pushing subrepo t to $TESTTMP/sub/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t (glob)
   searching for changes
   no changes found
   searching for changes
@@ -352,7 +349,7 @@
 
   $ cd ../tc
   $ hg pull
-  pulling from $TESTTMP/sub/t (glob)
+  pulling from $TESTTMP/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -363,7 +360,7 @@
 should pull t
 
   $ hg up
-  pulling subrepo t from $TESTTMP/sub/t/t (glob)
+  pulling subrepo t from $TESTTMP/t/t (glob)
   searching for changes
   adding changesets
   adding manifests
@@ -552,9 +549,9 @@
   $ cat mercurial2/main/nested_absolute/.hg/hgrc \
   >     mercurial2/main/nested_relative/.hg/hgrc
   [paths]
-  default = $TESTTMP/sub/mercurial/nested_absolute
+  default = $TESTTMP/mercurial/nested_absolute
   [paths]
-  default = $TESTTMP/sub/mercurial/nested_relative
+  default = $TESTTMP/mercurial/nested_relative
   $ rm -rf mercurial mercurial2
 
 Issue1977: multirepo push should fail if subrepo push fails
@@ -569,7 +566,7 @@
   adding .hgsub
   $ hg clone repo repo2
   updating to branch default
-  cloning subrepo s from $TESTTMP/sub/repo/s (glob)
+  cloning subrepo s from $TESTTMP/repo/s (glob)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg -q -R repo2 pull -u
   $ echo 1 > repo2/s/a
@@ -645,8 +642,8 @@
 Try to push from the other side
 
   $ hg -R issue1852a push `pwd`/issue1852c
-  pushing to $TESTTMP/sub/issue1852c
-  pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
+  pushing to $TESTTMP/issue1852c
+  pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
   searching for changes
   no changes found
   searching for changes
@@ -694,7 +691,7 @@
   $ hg st subrepo-2/file
 
 Check hg update --clean
-  $ cd $TESTTMP/sub/t
+  $ cd $TESTTMP/t
   $ rm -r t/t.orig
   $ hg status -S --all
   C .hgsub
@@ -722,7 +719,7 @@
   ? s/c
 
 Sticky subrepositories, no changes
-  $ cd $TESTTMP/sub/t
+  $ cd $TESTTMP/t
   $ hg id
   925c17564ef8 tip
   $ hg -R s id
@@ -1017,3 +1014,4 @@
   $ hg st -S
   ? s/f19
   $ rm s/f19
+  $ cd ..
--- a/tests/test-symlink-placeholder.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-symlink-placeholder.t	Mon Jun 18 16:21:31 2012 -0300
@@ -68,3 +68,5 @@
   $ hg manifest tip --verbose
   644   a
   644 @ b
+
+  $ cd ..
--- a/tests/test-symlinks.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-symlinks.t	Mon Jun 18 16:21:31 2012 -0300
@@ -253,3 +253,4 @@
   $ mv dirlink newdir/dirlink
   $ hg mv -A dirlink newdir/dirlink
 
+  $ cd ..
--- a/tests/test-tag.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-tag.t	Mon Jun 18 16:21:31 2012 -0300
@@ -1,5 +1,3 @@
-  $ "$TESTDIR/hghave" system-sh || exit 80
-
   $ hg init test
   $ cd test
 
@@ -214,13 +212,11 @@
 
 test custom commit messages
 
-  $ cat > editor << '__EOF__'
-  > #!/bin/sh
+  $ cat > editor.sh << '__EOF__'
   > echo "custom tag message" > "$1"
   > echo "second line" >> "$1"
   > __EOF__
-  $ chmod +x editor
-  $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg tag custom-tag -e
   $ hg log -l1 --template "{desc}\n"
   custom tag message
   second line
@@ -235,7 +231,7 @@
   $ hg st
   M .hgtags
   ? .hgtags.orig
-  ? editor
+  ? editor.sh
   $ hg tag --local baz
   $ hg revert --no-backup .hgtags
 
@@ -305,7 +301,7 @@
 
   $ hg init repo-tag
   $ hg init repo-tag-target
-  $ hg -R repo-tag --config hooks.commit="hg push \"`pwd`/repo-tag-target\"" tag tag
+  $ hg -R repo-tag --config hooks.commit="\"hg\" push \"`pwd`/repo-tag-target\"" tag tag
   pushing to $TESTTMP/repo-tag-target
   searching for changes
   adding changesets
--- a/tests/test-tags.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-tags.t	Mon Jun 18 16:21:31 2012 -0300
@@ -380,3 +380,5 @@
   tip                                1:a0b6fe111088
   localtag                           0:bbd179dfa0a7 local
   globaltag                          0:bbd179dfa0a7
+
+  $ cd ..
--- a/tests/test-template-engine.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-template-engine.t	Mon Jun 18 16:21:31 2012 -0300
@@ -35,3 +35,5 @@
   adding mymap
   $ hg log --style=./mymap
   0 97e5f848f0936960273bbf75be6388cd0350a32b test
+
+  $ cd ..
--- a/tests/test-transplant.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-transplant.t	Mon Jun 18 16:21:31 2012 -0300
@@ -356,6 +356,8 @@
   $ cd ..
 
 
+#if unix-permissions system-sh
+
 test filter
 
   $ hg init filter
@@ -441,6 +443,10 @@
   filtering * (glob)
   abort: filter corrupted changeset (no user or date)
   [255]
+  $ cd ..
+
+#endif
+
 
 test with a win32ext like setup (differing EOLs)
 
@@ -499,6 +505,7 @@
   $ hg init merge1b
   $ cd merge1b
   $ hg transplant -s ../merge1a tip
+  $ cd ..
 
 test transplant with merge changeset accepts --parent
 
@@ -527,3 +534,4 @@
   $ hg transplant -s ../merge2a --parent 0 tip
   applying be9f9b39483f
   be9f9b39483f transplanted to 9959e51f94d1
+  $ cd ..
--- a/tests/test-trusted.py.out	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-trusted.py.out	Mon Jun 18 16:21:31 2012 -0300
@@ -15,7 +15,7 @@
 . . local = /another/path
 
 # different user, same group
-Not trusting file .hg/hgrc from untrusted user abc, group bar
+not trusting file .hg/hgrc from untrusted user abc, group bar
 trusted
     global = /some/path
 untrusted
@@ -31,7 +31,7 @@
 . . local = /another/path
 
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 trusted
     global = /some/path
 untrusted
@@ -91,7 +91,7 @@
 
 # we don't get confused by users and groups with the same name
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 trusted
     global = /some/path
 untrusted
@@ -118,7 +118,7 @@
 
 # Can't figure out the name of the user running this process
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 trusted
     global = /some/path
 untrusted
@@ -127,7 +127,7 @@
 
 # prints debug warnings
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 trusted
 ignoring untrusted configuration option paths.local = /another/path
     global = /some/path
@@ -146,7 +146,7 @@
 
 # report_untrusted enabled with debug shows warnings
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 trusted
 ignoring untrusted configuration option paths.local = /another/path
     global = /some/path
@@ -159,7 +159,7 @@
 quux
 
 # read trusted, untrusted, new ui, trusted
-Not trusting file foobar from untrusted user abc, group def
+not trusting file foobar from untrusted user abc, group def
 trusted:
 ignoring untrusted configuration option foobar.baz = quux
 None
@@ -173,7 +173,7 @@
 
 # parse error
 # different user, different group
-Not trusting file .hg/hgrc from untrusted user abc, group def
+not trusting file .hg/hgrc from untrusted user abc, group def
 ('foo', '.hg/hgrc:1')
 # same user, same group
 ('foo', '.hg/hgrc:1')
--- a/tests/test-unrelated-pull.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-unrelated-pull.t	Mon Jun 18 16:21:31 2012 -0300
@@ -41,3 +41,5 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     b
   
+
+  $ cd ..
--- a/tests/test-up-local-change.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-up-local-change.t	Mon Jun 18 16:21:31 2012 -0300
@@ -234,3 +234,5 @@
   added 1 changesets with 1 changes to 1 files
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg st
+
+  $ cd ..
--- a/tests/test-update-issue1456.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-update-issue1456.t	Mon Jun 18 16:21:31 2012 -0300
@@ -33,3 +33,4 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg st
 
+  $ cd ..
--- a/tests/test-update-renames.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-update-renames.t	Mon Jun 18 16:21:31 2012 -0300
@@ -25,6 +25,3 @@
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges
   [1]
-
-  $ cd ..
-
--- a/tests/test-url-rev.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-url-rev.t	Mon Jun 18 16:21:31 2012 -0300
@@ -206,3 +206,5 @@
   $ hg id http://foo/?bar
   abort: unsupported URL component: "bar"
   [255]
+
+  $ cd ..
--- a/tests/test-verify.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-verify.t	Mon Jun 18 16:21:31 2012 -0300
@@ -58,6 +58,7 @@
   (first damaged changeset appears to be 0)
   [1]
 
+  $ cd ../../..
   $ cd ..
 
 test revlog corruption
@@ -99,3 +100,4 @@
   crosschecking files in changesets and manifests
   checking files
   1 files, 1 changesets, 1 total revisions
+  $ cd ..
--- a/tests/test-walk.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-walk.t	Mon Jun 18 16:21:31 2012 -0300
@@ -276,9 +276,11 @@
   $ hg debugwalk NOEXIST
   NOEXIST: * (glob)
 
+#if fifo
   $ mkfifo fifo
   $ hg debugwalk fifo
   fifo: unsupported file type (type is fifo)
+#endif
 
   $ rm fenugreek
   $ hg debugwalk fenugreek
@@ -318,3 +320,5 @@
   f  mammals/skunk  ../t/mammals/skunk  exact
   $ hg debugwalk --cwd ../t mammals/skunk
   f  mammals/skunk  mammals/skunk  exact
+
+  $ cd ..
--- a/tests/test-win32text.t	Mon Jun 18 20:07:25 2012 +0200
+++ b/tests/test-win32text.t	Mon Jun 18 16:21:31 2012 -0300
@@ -33,7 +33,7 @@
 commit should fail
 
   $ hg ci -m 2.1
-  Attempt to commit or push text file(s) using CRLF line endings
+  attempt to commit or push text file(s) using CRLF line endings
   in f583ea08d42a: f
   transaction abort!
   rollback completed
@@ -57,7 +57,7 @@
   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
+  attempt to commit or push text file(s) using CRLF line endings
   in bc2d09796734: g
   in b1aa5cde7ff4: f
   
@@ -105,7 +105,7 @@
   $ 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
+  attempt to commit or push text file(s) using CRLF line endings
   in 053ba1a3035a: d/f2
   transaction abort!
   rollback completed
@@ -266,7 +266,7 @@
   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
+  attempt to commit or push text file(s) using CRLF line endings
   in 67ac5962ab43: d
   in 68c127d1834e: b
   in 68c127d1834e: c
@@ -422,3 +422,5 @@
   $ hg st -q
   $ cat linefeed
   % just linefeed\r (esc)
+
+  $ cd ..