changeset 47142:bea4717415c0

merge with stable
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 07 May 2021 22:06:25 -0400
parents 5ffc6c18fb96 (current diff) ea563187ee7c (diff)
children 93eb6c8035a9
files hgext/convert/git.py hgext/convert/hg.py hgext/gpg.py mercurial/branchmap.py mercurial/bundle2.py mercurial/cmdutil.py mercurial/debugcommands.py mercurial/mergestate.py mercurial/scmutil.py mercurial/upgrade_utils/engine.py mercurial/util.py tests/test-copies-chain-merge.t tests/test-fix.t
diffstat 43 files changed, 111 insertions(+), 108 deletions(-) [+]
line wrap: on
line diff
--- a/doc/hgmanpage.py	Fri May 07 08:38:17 2021 -0700
+++ b/doc/hgmanpage.py	Fri May 07 22:06:25 2021 -0400
@@ -168,7 +168,7 @@
 
 
 class Translator(nodes.NodeVisitor):
-    """"""
+    """ """
 
     words_and_spaces = re.compile(r'\S+| +|\n')
     document_start = """Man page generated from reStructuredText."""
--- a/hgext/convert/git.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/convert/git.py	Fri May 07 22:06:25 2021 -0400
@@ -527,5 +527,5 @@
         return bookmarks
 
     def checkrevformat(self, revstr, mapname=b'splicemap'):
-        """ git revision string is a 40 byte hex """
+        """git revision string is a 40 byte hex"""
         self.checkhexformat(revstr, mapname)
--- a/hgext/convert/hg.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/convert/hg.py	Fri May 07 22:06:25 2021 -0400
@@ -728,5 +728,5 @@
         return bookmarks.listbookmarks(self.repo)
 
     def checkrevformat(self, revstr, mapname=b'splicemap'):
-        """ Mercurial, revision string is a 40 byte hex """
+        """Mercurial, revision string is a 40 byte hex"""
         self.checkhexformat(revstr, mapname)
--- a/hgext/convert/subversion.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/convert/subversion.py	Fri May 07 22:06:25 2021 -0400
@@ -778,7 +778,7 @@
         return revcommit
 
     def checkrevformat(self, revstr, mapname=b'splicemap'):
-        """ fails if revision format does not match the correct format"""
+        """fails if revision format does not match the correct format"""
         if not re.match(
             br'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-'
             br'[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]'
--- a/hgext/convert/transport.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/convert/transport.py	Fri May 07 22:06:25 2021 -0400
@@ -37,7 +37,7 @@
 
 
 def _create_auth_baton(pool):
-    """Create a Subversion authentication baton. """
+    """Create a Subversion authentication baton."""
     import svn.client
 
     # Give the client context baton a suite of authentication
--- a/hgext/fsmonitor/pywatchman/__init__.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/fsmonitor/pywatchman/__init__.py	Fri May 07 22:06:25 2021 -0400
@@ -221,7 +221,7 @@
 
 
 def _win32_strerror(err):
-    """ expand a win32 error code into a human readable message """
+    """expand a win32 error code into a human readable message"""
 
     # FormatMessage will allocate memory and assign it here
     buf = ctypes.c_char_p()
@@ -303,20 +303,20 @@
 
 
 class Transport(object):
-    """ communication transport to the watchman server """
+    """communication transport to the watchman server"""
 
     buf = None
 
     def close(self):
-        """ tear it down """
+        """tear it down"""
         raise NotImplementedError()
 
     def readBytes(self, size):
-        """ read size bytes """
+        """read size bytes"""
         raise NotImplementedError()
 
     def write(self, buf):
-        """ write some data """
+        """write some data"""
         raise NotImplementedError()
 
     def setTimeout(self, value):
@@ -348,7 +348,7 @@
 
 
 class Codec(object):
-    """ communication encoding for the watchman server """
+    """communication encoding for the watchman server"""
 
     transport = None
 
@@ -366,7 +366,7 @@
 
 
 class UnixSocketTransport(Transport):
-    """ local unix domain socket transport """
+    """local unix domain socket transport"""
 
     sock = None
 
@@ -449,7 +449,7 @@
 
 
 class WindowsNamedPipeTransport(Transport):
-    """ connect to a named pipe """
+    """connect to a named pipe"""
 
     def __init__(self, sockpath, timeout):
         self.sockpath = sockpath
@@ -700,7 +700,7 @@
 
 
 class BserCodec(Codec):
-    """ use the BSER encoding.  This is the default, preferred codec """
+    """use the BSER encoding.  This is the default, preferred codec"""
 
     def __init__(self, transport, value_encoding, value_errors):
         super(BserCodec, self).__init__(transport)
@@ -752,7 +752,7 @@
 
 
 class Bser2WithFallbackCodec(BserCodec):
-    """ use BSER v2 encoding """
+    """use BSER v2 encoding"""
 
     def __init__(self, transport, value_encoding, value_errors):
         super(Bser2WithFallbackCodec, self).__init__(
@@ -824,7 +824,7 @@
 
 
 class JsonCodec(Codec):
-    """ Use json codec.  This is here primarily for testing purposes """
+    """Use json codec.  This is here primarily for testing purposes"""
 
     json = None
 
@@ -861,7 +861,7 @@
 
 
 class client(object):
-    """ Handles the communication with the watchman service """
+    """Handles the communication with the watchman service"""
 
     sockpath = None
     transport = None
@@ -1011,7 +1011,7 @@
         return result["sockname"]
 
     def _connect(self):
-        """ establish transport connection """
+        """establish transport connection"""
 
         if self.recvConn:
             if self.pid != os.getpid():
@@ -1176,7 +1176,7 @@
             raise
 
     def capabilityCheck(self, optional=None, required=None):
-        """ Perform a server capability check """
+        """Perform a server capability check"""
         res = self.query(
             "version", {"optional": optional or [], "required": required or []}
         )
--- a/hgext/gpg.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/gpg.py	Fri May 07 22:06:25 2021 -0400
@@ -75,7 +75,7 @@
         return procutil.filter(data, gpgcmd)
 
     def verify(self, data, sig):
-        """ returns of the good and bad signatures"""
+        """returns of the good and bad signatures"""
         sigfile = datafile = None
         try:
             # create temporary files
--- a/hgext/histedit.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/histedit.py	Fri May 07 22:06:25 2021 -0400
@@ -510,7 +510,7 @@
         return cls(state, rev)
 
     def verify(self, prev, expected, seen):
-        """ Verifies semantic correctness of the rule"""
+        """Verifies semantic correctness of the rule"""
         repo = self.repo
         ha = hex(self.node)
         self.node = scmutil.resolvehexnodeidprefix(repo, ha)
@@ -819,7 +819,7 @@
 @action([b'fold', b'f'], _(b'use commit, but combine it with the one above'))
 class fold(histeditaction):
     def verify(self, prev, expected, seen):
-        """ Verifies semantic correctness of the fold rule"""
+        """Verifies semantic correctness of the fold rule"""
         super(fold, self).verify(prev, expected, seen)
         repo = self.repo
         if not prev:
@@ -2403,7 +2403,7 @@
 
 
 def parserules(rules, state):
-    """Read the histedit rules string and return list of action objects """
+    """Read the histedit rules string and return list of action objects"""
     rules = [
         l
         for l in (r.strip() for r in rules.splitlines())
--- a/hgext/remotenames.py	Fri May 07 08:38:17 2021 -0700
+++ b/hgext/remotenames.py	Fri May 07 22:06:25 2021 -0400
@@ -102,7 +102,7 @@
         self.loaded = False
 
     def _load(self):
-        """ Read the remotenames file, store entries matching selected kind """
+        """Read the remotenames file, store entries matching selected kind"""
         self.loaded = True
         repo = self._repo
         for node, rpath, rname in logexchange.readremotenamefile(
@@ -112,7 +112,7 @@
             self.potentialentries[name] = (node, rpath, name)
 
     def _resolvedata(self, potentialentry):
-        """ Check that the node for potentialentry exists and return it """
+        """Check that the node for potentialentry exists and return it"""
         if not potentialentry in self.potentialentries:
             return None
         node, remote, name = self.potentialentries[potentialentry]
@@ -160,13 +160,13 @@
             return None
 
     def keys(self):
-        """ Get a list of bookmark or branch names """
+        """Get a list of bookmark or branch names"""
         if not self.loaded:
             self._load()
         return self.potentialentries.keys()
 
     def iteritems(self):
-        """ Iterate over (name, node) tuples """
+        """Iterate over (name, node) tuples"""
 
         if not self.loaded:
             self._load()
@@ -190,7 +190,7 @@
         self.clearnames()
 
     def clearnames(self):
-        """ Clear all remote names state """
+        """Clear all remote names state"""
         self.bookmarks = lazyremotenamedict(b"bookmarks", self._repo)
         self.branches = lazyremotenamedict(b"branches", self._repo)
         self._invalidatecache()
--- a/mercurial/branchmap.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/branchmap.py	Fri May 07 22:06:25 2021 -0400
@@ -222,7 +222,7 @@
             self._hasnode = lambda x: True
 
     def _verifyclosed(self):
-        """ verify the closed nodes we have """
+        """verify the closed nodes we have"""
         if self._closedverified:
             return
         for node in self._closednodes:
@@ -232,7 +232,7 @@
         self._closedverified = True
 
     def _verifybranch(self, branch):
-        """ verify head nodes for the given branch. """
+        """verify head nodes for the given branch."""
         if branch not in self._entries or branch in self._verifiedbranches:
             return
         for n in self._entries[branch]:
@@ -242,7 +242,7 @@
         self._verifiedbranches.add(branch)
 
     def _verifyall(self):
-        """ verifies nodes of all the branches """
+        """verifies nodes of all the branches"""
         needverification = set(self._entries.keys()) - self._verifiedbranches
         for b in needverification:
             self._verifybranch(b)
@@ -269,7 +269,7 @@
     items = iteritems
 
     def hasbranch(self, label):
-        """ checks whether a branch of this name exists or not """
+        """checks whether a branch of this name exists or not"""
         self._verifybranch(label)
         return label in self._entries
 
@@ -387,7 +387,7 @@
             yield (bn, heads) + self._branchtip(heads)
 
     def iterheads(self):
-        """ returns all the heads """
+        """returns all the heads"""
         self._verifyall()
         return pycompat.itervalues(self._entries)
 
@@ -786,7 +786,7 @@
                 wlock.release()
 
     def _writenames(self, repo):
-        """ write the new branch names to revbranchcache """
+        """write the new branch names to revbranchcache"""
         if self._rbcnamescount != 0:
             f = repo.cachevfs.open(_rbcnames, b'ab')
             if f.tell() == self._rbcsnameslen:
@@ -811,7 +811,7 @@
         self._rbcnamescount = len(self._names)
 
     def _writerevs(self, repo, start):
-        """ write the new revs to revbranchcache """
+        """write the new revs to revbranchcache"""
         revs = min(len(repo.changelog), len(self._rbcrevs) // _rbcrecsize)
         with repo.cachevfs.open(_rbcrevs, b'ab') as f:
             if f.tell() != start:
--- a/mercurial/bundle2.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/bundle2.py	Fri May 07 22:06:25 2021 -0400
@@ -828,7 +828,7 @@
         return params
 
     def _processallparams(self, paramsblock):
-        """"""
+        """ """
         params = util.sortdict()
         for p in paramsblock.split(b' '):
             p = p.split(b'=', 1)
--- a/mercurial/cmdutil.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/cmdutil.py	Fri May 07 22:06:25 2021 -0400
@@ -329,7 +329,7 @@
 
 
 def checknotesize(ui, opts):
-    """ make sure note is of valid format """
+    """make sure note is of valid format"""
 
     note = opts.get(b'note')
     if not note:
@@ -975,7 +975,7 @@
 
 
 def changebranch(ui, repo, revs, label, opts):
-    """ Change the branch name of given revs to label """
+    """Change the branch name of given revs to label"""
 
     with repo.wlock(), repo.lock(), repo.transaction(b'branches'):
         # abort in case of uncommitted merge or dirty wdir
@@ -1106,7 +1106,7 @@
 
 
 def logmessage(ui, opts):
-    """ get the log message according to -m and -l option """
+    """get the log message according to -m and -l option"""
 
     check_at_most_one_arg(opts, b'message', b'logfile')
 
@@ -3925,7 +3925,7 @@
 
 
 def hgabortgraft(ui, repo):
-    """ abort logic for aborting graft using 'hg abort'"""
+    """abort logic for aborting graft using 'hg abort'"""
     with repo.wlock():
         graftstate = statemod.cmdstate(repo, b'graftstate')
         return abortgraft(ui, repo, graftstate)
--- a/mercurial/commandserver.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/commandserver.py	Fri May 07 22:06:25 2021 -0400
@@ -366,7 +366,7 @@
                 os.chdir(self.cwd)
 
     def getencoding(self):
-        """ writes the current encoding to the result channel """
+        """writes the current encoding to the result channel"""
         self.cresult.write(encoding.encoding)
 
     def serveone(self):
--- a/mercurial/crecord.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/crecord.py	Fri May 07 22:06:25 2021 -0400
@@ -331,7 +331,7 @@
 
 
 class uihunk(patchnode):
-    """ui patch hunk, wraps a hunk and keep track of ui behavior """
+    """ui patch hunk, wraps a hunk and keep track of ui behavior"""
 
     maxcontext = 3
 
--- a/mercurial/debugcommands.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/debugcommands.py	Fri May 07 22:06:25 2021 -0400
@@ -2908,7 +2908,7 @@
 
 @command(b'debugrequires|debugrequirements', [], b'')
 def debugrequirements(ui, repo):
-    """ print the current repo requirements """
+    """print the current repo requirements"""
     for r in sorted(repo.requirements):
         ui.write(b"%s\n" % r)
 
@@ -4086,7 +4086,7 @@
     should complete almost instantaneously and the chances of a consumer being
     unable to access the repository should be low.
 
-    By default, all revlog will be upgraded. You can restrict this using flag
+    By default, all revlogs will be upgraded. You can restrict this using flags
     such as `--manifest`:
 
       * `--manifest`: only optimize the manifest
--- a/mercurial/mail.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/mail.py	Fri May 07 22:06:25 2021 -0400
@@ -269,7 +269,7 @@
 
 def codec2iana(cs):
     # type: (str) -> str
-    ''''''
+    ''' '''
     cs = email.charset.Charset(cs).input_charset.lower()
 
     # "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"
--- a/mercurial/mergestate.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/mergestate.py	Fri May 07 22:06:25 2021 -0400
@@ -306,11 +306,11 @@
                 yield f
 
     def allextras(self):
-        """ return all extras information stored with the mergestate """
+        """return all extras information stored with the mergestate"""
         return self._stateextras
 
     def extras(self, filename):
-        """ return extras stored with the mergestate for the given filename """
+        """return extras stored with the mergestate for the given filename"""
         return self._stateextras[filename]
 
     def _resolve(self, preresolve, dfile, wctx):
--- a/mercurial/revlogutils/nodemap.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/revlogutils/nodemap.py	Fri May 07 22:06:25 2021 -0400
@@ -133,7 +133,7 @@
 
 
 def delete_nodemap(tr, repo, revlog):
-    """ Delete nodemap data on disk for a given revlog"""
+    """Delete nodemap data on disk for a given revlog"""
     if revlog.nodemap_file is None:
         msg = "calling persist nodemap on a revlog without the feature enabled"
         raise error.ProgrammingError(msg)
--- a/mercurial/scmutil.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/scmutil.py	Fri May 07 22:06:25 2021 -0400
@@ -1561,7 +1561,7 @@
 
 
 def istreemanifest(repo):
-    """ returns whether the repository is using treemanifest or not """
+    """returns whether the repository is using treemanifest or not"""
     return requirementsmod.TREEMANIFEST_REQUIREMENT in repo.requirements
 
 
--- a/mercurial/state.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/state.py	Fri May 07 22:06:25 2021 -0400
@@ -188,7 +188,7 @@
         return self._cmdmsg
 
     def continuemsg(self):
-        """ returns appropriate continue message corresponding to command"""
+        """returns appropriate continue message corresponding to command"""
         return _(b'hg %s --continue') % (self._opname)
 
     def isunfinished(self, repo):
--- a/mercurial/store.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/store.py	Fri May 07 22:06:25 2021 -0400
@@ -629,7 +629,7 @@
         fp.close()
 
     def _checkentries(self, fp, warn):
-        """ make sure there is no empty string in entries """
+        """make sure there is no empty string in entries"""
         if b'' in self.entries:
             fp.seek(0)
             for n, line in enumerate(util.iterfile(fp)):
--- a/mercurial/upgrade_utils/actions.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/upgrade_utils/actions.py	Fri May 07 22:06:25 2021 -0400
@@ -847,11 +847,11 @@
             self.ui.status(_(b'%s\n   %s\n\n') % (i.name, i.description))
 
     def has_upgrade_action(self, name):
-        """ Check whether the upgrade operation will perform this action """
+        """Check whether the upgrade operation will perform this action"""
         return name in self._upgrade_actions_names
 
     def print_post_op_messages(self):
-        """ print post upgrade operation warning messages """
+        """print post upgrade operation warning messages"""
         for a in self.upgrade_actions:
             if a.postupgrademessage is not None:
                 self.ui.warn(b'%s\n' % a.postupgrademessage)
--- a/mercurial/upgrade_utils/engine.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/upgrade_utils/engine.py	Fri May 07 22:06:25 2021 -0400
@@ -134,7 +134,7 @@
     sidedata_helpers,
     oncopiedrevision,
 ):
-    """ returns the new revlog object created"""
+    """returns the new revlog object created"""
     newrl = None
     if matchrevlog(upgrade_op.revlogs_to_process, rl_type):
         ui.note(
--- a/mercurial/util.py	Fri May 07 08:38:17 2021 -0700
+++ b/mercurial/util.py	Fri May 07 22:06:25 2021 -0400
@@ -144,7 +144,7 @@
 
 def setumask(val):
     # type: (int) -> None
-    ''' updates the umask. used by chg server '''
+    '''updates the umask. used by chg server'''
     if pycompat.iswindows:
         return
     os.umask(val)
--- a/tests/library-infinitepush.sh	Fri May 07 08:38:17 2021 -0700
+++ b/tests/library-infinitepush.sh	Fri May 07 22:06:25 2021 -0400
@@ -15,7 +15,7 @@
 [extensions]
 infinitepush=
 [ui]
-ssh = $PYTHON "$TESTDIR/dummyssh"
+ssh = "$PYTHON" "$TESTDIR/dummyssh"
 [infinitepush]
 branchpattern=re:scratch/.*
 EOF
--- a/tests/narrow-library.sh	Fri May 07 08:38:17 2021 -0700
+++ b/tests/narrow-library.sh	Fri May 07 22:06:25 2021 -0400
@@ -2,7 +2,7 @@
 [extensions]
 narrow=
 [ui]
-ssh=$PYTHON "$RUNTESTDIR/dummyssh"
+ssh="$PYTHON" "$RUNTESTDIR/dummyssh"
 [experimental]
 changegroup3 = True
 EOF
--- a/tests/remotefilelog-library.sh	Fri May 07 08:38:17 2021 -0700
+++ b/tests/remotefilelog-library.sh	Fri May 07 22:06:25 2021 -0400
@@ -8,7 +8,7 @@
 rebase=
 strip=
 [ui]
-ssh=$PYTHON "$TESTDIR/dummyssh"
+ssh="$PYTHON" "$TESTDIR/dummyssh"
 [server]
 preferuncompressed=True
 [experimental]
@@ -67,7 +67,7 @@
 }
 
 ls_l() {
-  $PYTHON $TESTDIR/ls-l.py "$@"
+  "$PYTHON" $TESTDIR/ls-l.py "$@"
 }
 
 identifyrflcaps() {
--- a/tests/test-check-pyflakes.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-check-pyflakes.t	Fri May 07 22:06:25 2021 -0400
@@ -8,7 +8,7 @@
   $ cat > test.py <<EOF
   > print(undefinedname)
   > EOF
-  $ $PYTHON -m pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py"
+  $ "$PYTHON" -m pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   test.py:1:* undefined name 'undefinedname' (glob)
   
   $ cd "`dirname "$TESTDIR"`"
@@ -18,7 +18,7 @@
   > -X mercurial/pycompat.py -X contrib/python-zstandard \
   > -X mercurial/thirdparty \
   > 2>/dev/null \
-  > | xargs $PYTHON -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
+  > | xargs "$PYTHON" -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
   contrib/perf.py:*:* undefined name 'xrange' (glob) (?)
   mercurial/hgweb/server.py:*:* undefined name 'reload' (glob) (?)
   mercurial/util.py:*:* undefined name 'file' (glob) (?)
--- a/tests/test-convert-svn-encoding.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-convert-svn-encoding.t	Fri May 07 22:06:25 2021 -0400
@@ -155,7 +155,7 @@
 
 Subversion sources don't support non-ASCII characters in HTTP(S) URLs.
 
-  $ XFF=$($PYTHON -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")')
+  $ XFF=$("$PYTHON" -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")')
   $ hg convert --source-type=svn http://localhost:$HGPORT/$XFF test
   initializing destination test repository
   Subversion sources don't support non-ASCII characters in HTTP(S) URLs. Please percent-encode them.
--- a/tests/test-copies-chain-merge.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-copies-chain-merge.t	Fri May 07 22:06:25 2021 -0400
@@ -25,7 +25,6 @@
   >         l = "%s       *%s" % (line[:6], line[14:].rstrip())
   >         print(l)
   > EOF
-  $ chmod +x no-linkrev
 
   $ cat << EOF >> $HGRCPATH
   > [diff]
@@ -516,7 +515,7 @@
   created new head
   $ hg mv --force i d
   $ hg commit -m "f-2: rename i -> d"
-  $ hg debugindex d | ../no-linkrev
+  $ hg debugindex d | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * d8252ab2e760 000000000000 000000000000 (no-changeset !)
        0       * ae258f702dfe 000000000000 000000000000 (changeset !)
@@ -572,7 +571,7 @@
   created new head
   $ hg mv --force x t
   $ hg commit -m "r-2: rename t -> x"
-  $ hg debugindex t | ../no-linkrev
+  $ hg debugindex t | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * d74efbf65309 000000000000 000000000000 (no-changeset !)
        1       * 02a930b9d7ad 000000000000 000000000000 (no-changeset !)
@@ -939,7 +938,7 @@
   $ hg up 'desc("f-2")'
   2 files updated, 0 files merged, 2 files removed, 0 files unresolved
 #if no-changeset
-  $ hg debugindex d | ../no-linkrev
+  $ hg debugindex d | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * d8252ab2e760 000000000000 000000000000
        1       * b004912a8510 000000000000 000000000000
@@ -950,7 +949,7 @@
        6       * 89c873a01d97 7b79e2fe0c89 17ec97e60577
        7       * d55cb4e9ef57 000000000000 000000000000
 #else
-  $ hg debugindex d | ../no-linkrev
+  $ hg debugindex d | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * ae258f702dfe 000000000000 000000000000
        1       * b004912a8510 000000000000 000000000000
@@ -984,7 +983,7 @@
   1c334238bd42ec85c6a0d83fd1b2a898a6a3215d 644   d (no-changeset !)
   cea2d99c0fde64672ef61953786fdff34f16e230 644   d (changeset !)
 #if no-changeset
-  $ hg debugindex d | ../no-linkrev
+  $ hg debugindex d | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * d8252ab2e760 000000000000 000000000000
        1       * b004912a8510 000000000000 000000000000
@@ -996,7 +995,7 @@
        7       * d55cb4e9ef57 000000000000 000000000000
        8       * 1c334238bd42 7b79e2fe0c89 000000000000
 #else
-  $ hg debugindex d | ../no-linkrev
+  $ hg debugindex d | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * ae258f702dfe 000000000000 000000000000
        1       * b004912a8510 000000000000 000000000000
@@ -2437,7 +2436,7 @@
   $ hg manifest --debug --rev 'desc("b-1")' | grep '644   d'
   d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644   d (no-changeset !)
   ae258f702dfeca05bf9b6a22a97a4b5645570f11 644   d (changeset !)
-  $ hg debugindex d | head -n 4 | ../no-linkrev
+  $ hg debugindex d | head -n 4 | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * d8252ab2e760 000000000000 000000000000 (no-changeset !)
        0       * ae258f702dfe 000000000000 000000000000 (changeset !)
@@ -2510,7 +2509,7 @@
   b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   e8825b386367b29fec957283a80bb47b47483fe1 644   f
-  $ hg debugindex f | ../no-linkrev
+  $ hg debugindex f | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * b76eb76580df 000000000000 000000000000
        1       * e8825b386367 000000000000 000000000000
@@ -2526,7 +2525,7 @@
   ae258f702dfeca05bf9b6a22a97a4b5645570f11 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   ae258f702dfeca05bf9b6a22a97a4b5645570f11 644   f
-  $ hg debugindex f | ../no-linkrev
+  $ hg debugindex f | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * ae258f702dfe 000000000000 000000000000
        1       * d3613c1ec831 ae258f702dfe 000000000000
@@ -3098,7 +3097,7 @@
   3f91841cd75cadc9a1f1b4e7c1aa6d411f76032e 644   v
   $ hg manifest --debug --rev 'desc("q-2")' | grep '644   v'
   c43c088b811fd27983c0a9aadf44f3343cd4cd7e 644   v
-  $ hg debugindex v | ../no-linkrev
+  $ hg debugindex v | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * 3f91841cd75c 000000000000 000000000000
        1       * c43c088b811f 000000000000 000000000000
@@ -3113,7 +3112,7 @@
   5aed6a8dbff0301328c08360d24354d3d064cf0d 644   v
   $ hg manifest --debug --rev 'desc("q-2")' | grep '644   v'
   a38b2fa170219750dac9bc7d19df831f213ba708 644   v
-  $ hg debugindex v | ../no-linkrev
+  $ hg debugindex v | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * 5aed6a8dbff0 000000000000 000000000000
        1       * a38b2fa17021 000000000000 000000000000
@@ -3396,7 +3395,7 @@
   b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   e8825b386367b29fec957283a80bb47b47483fe1 644   f
-  $ hg debugindex f | ../no-linkrev
+  $ hg debugindex f | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * b76eb76580df 000000000000 000000000000
        1       * e8825b386367 000000000000 000000000000
@@ -3412,7 +3411,7 @@
   ae258f702dfeca05bf9b6a22a97a4b5645570f11 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   ae258f702dfeca05bf9b6a22a97a4b5645570f11 644   f
-  $ hg debugindex f | ../no-linkrev
+  $ hg debugindex f | "$PYTHON" ../no-linkrev
      rev linkrev nodeid       p1           p2
        0       * ae258f702dfe 000000000000 000000000000
        1       * d3613c1ec831 ae258f702dfe 000000000000
--- a/tests/test-fix-topology.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-fix-topology.t	Fri May 07 22:06:25 2021 -0400
@@ -6,7 +6,9 @@
   > from mercurial.utils.procutil import setbinary
   > setbinary(sys.stdin)
   > setbinary(sys.stdout)
-  > sys.stdout.write(sys.stdin.read().upper())
+  > stdin = getattr(sys.stdin, 'buffer', sys.stdin)
+  > stdout = getattr(sys.stdout, 'buffer', sys.stdout)
+  > stdout.write(stdin.read().upper())
   > EOF
   $ TESTLINES="foo\nbar\nbaz\n"
   $ printf $TESTLINES | "$PYTHON" $UPPERCASEPY
--- a/tests/test-fix.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-fix.t	Fri May 07 22:06:25 2021 -0400
@@ -7,19 +7,21 @@
   > from mercurial.utils.procutil import setbinary
   > setbinary(sys.stdin)
   > setbinary(sys.stdout)
+  > stdin = getattr(sys.stdin, 'buffer', sys.stdin)
+  > stdout = getattr(sys.stdout, 'buffer', sys.stdout)
   > lines = set()
   > for arg in sys.argv[1:]:
   >   if arg == 'all':
-  >     sys.stdout.write(sys.stdin.read().upper())
+  >     stdout.write(stdin.read().upper())
   >     sys.exit(0)
   >   else:
   >     first, last = arg.split('-')
   >     lines.update(range(int(first), int(last) + 1))
-  > for i, line in enumerate(sys.stdin.readlines()):
+  > for i, line in enumerate(stdin.readlines()):
   >   if i + 1 in lines:
-  >     sys.stdout.write(line.upper())
+  >     stdout.write(line.upper())
   >   else:
-  >     sys.stdout.write(line)
+  >     stdout.write(line)
   > EOF
   $ TESTLINES="foo\nbar\nbaz\nqux\n"
   $ printf $TESTLINES | "$PYTHON" $UPPERCASEPY
--- a/tests/test-fuzz-targets.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-fuzz-targets.t	Fri May 07 22:06:25 2021 -0400
@@ -29,7 +29,7 @@
 Try to find a python3-config that's next to our sys.executable. If
 that doesn't work, fall back to looking for a global python3-config
 and hope that works out for the best.
-  $ PYBIN=`$PYTHON -c 'import sys, os; print(os.path.dirname(sys.executable))'`
+  $ PYBIN=`"$PYTHON" -c 'import sys, os; print(os.path.dirname(sys.executable))'`
   $ if [ -x "$PYBIN/python3-config" ] ; then
   >   PYTHON_CONFIG="$PYBIN/python3-config"
   > else
--- a/tests/test-infinitepush-ci.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-infinitepush-ci.t	Fri May 07 22:06:25 2021 -0400
@@ -10,7 +10,7 @@
   $ . "$TESTDIR/library-infinitepush.sh"
   $ cat >> $HGRCPATH <<EOF
   > [ui]
-  > ssh = $PYTHON "$TESTDIR/dummyssh"
+  > ssh = "$PYTHON" "$TESTDIR/dummyssh"
   > [alias]
   > glog = log -GT "{rev}:{node|short} {desc}\n{phase}"
   > EOF
--- a/tests/test-nointerrupt.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-nointerrupt.t	Fri May 07 22:06:25 2021 -0400
@@ -59,7 +59,7 @@
   > EOF
 
 Test ctrl-c
-  $ $PYTHON $TESTTMP/timeout.py -s INT 1 hg sleep 2
+  $ "$PYTHON" $TESTTMP/timeout.py -s INT 1 hg sleep 2
   interrupted!
   [124]
 
@@ -68,7 +68,7 @@
   > nointerrupt = yes
   > EOF
 
-  $ $PYTHON $TESTTMP/timeout.py -s INT 1 hg sleep 2
+  $ "$PYTHON" $TESTTMP/timeout.py -s INT 1 hg sleep 2
   interrupted!
   [124]
 
@@ -77,7 +77,7 @@
   > nointerrupt-interactiveonly = False
   > EOF
 
-  $ $PYTHON $TESTTMP/timeout.py -s INT 1 hg sleep 2
+  $ "$PYTHON" $TESTTMP/timeout.py -s INT 1 hg sleep 2
   shutting down cleanly
   press ^C again to terminate immediately (dangerous)
   end of unsafe operation
--- a/tests/test-persistent-nodemap.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-persistent-nodemap.t	Fri May 07 22:06:25 2021 -0400
@@ -474,17 +474,16 @@
 
 Another process does not see the pending nodemap content during run.
 
-  $ PATH=$RUNTESTDIR/testlib/:$PATH
   $ echo qpoasp > a
   $ hg ci -m a2 \
-  > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
+  > --config "hooks.pretxnclose=sh \"$RUNTESTDIR/testlib/wait-on-file\" 20 sync-repo-read sync-txn-pending" \
   > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
 
 (read the repository while the commit transaction is pending)
 
-  $ wait-on-file 20 sync-txn-pending && \
+  $ sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-pending && \
   > hg debugnodemap --metadata && \
-  > wait-on-file 20 sync-txn-close sync-repo-read
+  > sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-close sync-repo-read
   uid: ???????????????? (glob)
   tip-rev: 5004
   tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
@@ -792,7 +791,9 @@
   $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd`
   $ f -s $datafilepath
   corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob)
-  $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=none
+  $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp status=noxfer
+  10+0 records in
+  10+0 records out
   $ mv $datafilepath-tmp $datafilepath
   $ f -s $datafilepath
   corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob)
--- a/tests/test-racy-mutations.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-racy-mutations.t	Fri May 07 22:06:25 2021 -0400
@@ -26,7 +26,6 @@
   >         cat "\$@"
   >     fi
   > EOF
-  $ chmod +x "$TESTTMP/waitlock_editor.sh"
 
 Things behave differently if we don't already have a 00changelog.i file when
 this all starts, so let's make one.
@@ -49,11 +48,11 @@
   $ echo foo > foo
   $ (WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \
   >      WAITLOCK_FILE="${MISCHIEF_MANAGED}" \
-  >           HGEDITOR="$TESTTMP/waitlock_editor.sh" \
+  >           HGEDITOR="sh $TESTTMP/waitlock_editor.sh" \
   >           hg commit -qAm 'r1 (foo)' --edit foo > .foo_commit_out 2>&1 ; touch "${JOBS_FINISHED}") &
 
 Wait for the "editor" to actually start
-  $ WAITLOCK_FILE="${EDITOR_STARTED}" "$TESTTMP/waitlock_editor.sh"
+  $ WAITLOCK_FILE="${EDITOR_STARTED}" sh "$TESTTMP/waitlock_editor.sh"
 
 Break the locks, and make another commit.
   $ hg debuglocks -LW
@@ -67,7 +66,7 @@
 Awaken the editor from that first commit
   $ touch "${MISCHIEF_MANAGED}"
 And wait for it to finish
-  $ WAITLOCK_FILE="${JOBS_FINISHED}" "$TESTTMP/waitlock_editor.sh"
+  $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP/waitlock_editor.sh"
 
 #if skip-detection
 (Ensure there was no output)
--- a/tests/test-remotefilelog-cacheprocess.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-remotefilelog-cacheprocess.t	Fri May 07 22:06:25 2021 -0400
@@ -66,7 +66,7 @@
 
   $ cat >> $HGRCPATH <<EOF
   > [remotefilelog]
-  > cacheprocess = $PYTHON $TESTTMP/cacheprocess-logger.py
+  > cacheprocess = "$PYTHON" $TESTTMP/cacheprocess-logger.py
   > EOF
 
 Test cache keys and cache misses.
--- a/tests/test-remotefilelog-gc.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-remotefilelog-gc.t	Fri May 07 22:06:25 2021 -0400
@@ -40,7 +40,7 @@
 
 # gc client cache
 
-  $ lastweek=`$PYTHON -c 'import datetime,time; print(datetime.datetime.fromtimestamp(time.time() - (86400 * 7)).strftime("%y%m%d%H%M"))'`
+  $ lastweek=`"$PYTHON" -c 'import datetime,time; print(datetime.datetime.fromtimestamp(time.time() - (86400 * 7)).strftime("%y%m%d%H%M"))'`
   $ find $CACHEDIR -type f -exec touch -t $lastweek {} \;
 
   $ find $CACHEDIR -type f | sort
--- a/tests/test-remotefilelog-http.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-remotefilelog-http.t	Fri May 07 22:06:25 2021 -0400
@@ -14,7 +14,7 @@
   $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log -A ../access.log
 
 Build a query string for later use:
-  $ GET=`hg debugdata -m 0 | $PYTHON -c \
+  $ GET=`hg debugdata -m 0 | "$PYTHON" -c \
   > 'import sys ; print([("?cmd=x_rfl_getfile&file=%s&node=%s" % tuple(s.split("\0"))) for s in sys.stdin.read().splitlines()][0])'`
 
   $ cd ..
--- a/tests/test-unified-test.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-unified-test.t	Fri May 07 22:06:25 2021 -0400
@@ -77,12 +77,12 @@
 
 Escapes:
 
-  $ $PYTHON -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")'
+  $ "$PYTHON" -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")'
   \xff (no-eol) (esc)
 
 Escapes with conditions:
 
-  $ $PYTHON -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")'
+  $ "$PYTHON" -c 'from mercurial.utils.procutil import stdout; stdout.write(b"\xff")'
   \xff (no-eol) (esc) (true !)
 
 Combining esc with other markups - and handling lines ending with \r instead of \n:
--- a/tests/test-update-atomic.t	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-update-atomic.t	Fri May 07 22:06:25 2021 -0400
@@ -54,7 +54,7 @@
   $ hg update -r 1 --config extensions.showwrites=.hg/showwrites.py 2>&1 | grep "a1'.*wb"
   ('vfs open', ('a1', 'wb'), [('atomictemp', False), ('backgroundclose', True)])
 
-  $ $PYTHON $TESTTMP/show_mode.py *
+  $ "$PYTHON" $TESTTMP/show_mode.py *
   a1:0644
   a2:0755
   b1:0644
@@ -76,7 +76,7 @@
   $ hg update -r 1
   6 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
-  $ $PYTHON $TESTTMP/show_mode.py *
+  $ "$PYTHON" $TESTTMP/show_mode.py *
   a1:0644
   a2:0755
   b1:0644
@@ -88,7 +88,7 @@
 
   $ chmod a-w ro
 
-  $ $PYTHON $TESTTMP/show_mode.py ro
+  $ "$PYTHON" $TESTTMP/show_mode.py ro
   ro:0444
 
 Now the file is present, try to update and check the permissions of the file
@@ -96,7 +96,7 @@
   $ hg up -r 2
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ $PYTHON $TESTTMP/show_mode.py ro
+  $ "$PYTHON" $TESTTMP/show_mode.py ro
   ro:0644
 
 # The file which was read-only is now writable in the default behavior
@@ -121,7 +121,7 @@
   C ro
 
 Check the file permission after update
-  $ $PYTHON $TESTTMP/show_mode.py *
+  $ "$PYTHON" $TESTTMP/show_mode.py *
   a1:0644
   a2:0755
   b1:0644
@@ -133,7 +133,7 @@
 
   $ chmod a-w ro
 
-  $ $PYTHON $TESTTMP/show_mode.py ro
+  $ "$PYTHON" $TESTTMP/show_mode.py ro
   ro:0444
 
 Now the file is present, try to update and check the permissions of the file
@@ -141,7 +141,7 @@
   $ hg update -r 2 --traceback
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
-  $ $PYTHON $TESTTMP/show_mode.py ro
+  $ "$PYTHON" $TESTTMP/show_mode.py ro
   ro:0644
 
 # The behavior is the same as without atomic update
--- a/tests/test-verify-repo-operations.py	Fri May 07 08:38:17 2021 -0700
+++ b/tests/test-verify-repo-operations.py	Fri May 07 22:06:25 2021 -0400
@@ -354,7 +354,7 @@
             o.write(content)
         self.log.append(
             (
-                "$ $PYTHON -c 'import binascii; "
+                "$ \"$PYTHON\" -c 'import binascii; "
                 "print(binascii.unhexlify(\"%s\"))' > %s"
             )
             % (