serve: correct meta variable of --daemon-pipefds option

It was changed to lock path at e22695b4472f.

--HG--
branch : stable
extdiff: quote user-supplied options passed to shell

$ hg extdiff -p cmd -o "name <user@example.com>"
resulted in a shell redirection error (due to the less-than sign),
rather than passing the single option to cmd. This was due to options
not being quoted for passing to the shell, via util.system(). Apply
util.shellquote() to each of the user-specified options (-o) to the
comparison program before they are concatenated and passed to
util.system(). The requested external diff command (-p) and the
files/directories being compared are already quoted correctly.

The discussion at the time of changeset be98c5ce4022 correctly noted
that this course of action breaks whitespace-separated options specified
for external diff commands in the configuration. The lower part of the
patch corrects this by lexing options read from the configuration file
into separate options rather than reading them all into the first
option.

Update test to cover these conditions.

Related changesets (reverse-chronological):
- be98c5ce4022 (fix reverted to make configuration file options work)
- 453097750fbf (issue fixed but without fix for configuration file)

--HG--
branch : stable
keyword: use parent of working copy as base for status

Instead of calling repo[None].status(), use the more common form that
uses the parent of the working copy as the base:
repo['.'].status(). Note that the former defaults to comparing to
revision '.', while the latter defaults to revision None, so the
contexts being compared are the same.

It might seem like this would result in a reverse diff, but it turns
out that workingctx.status() incorrectly reverses the result. That bug
will be fixed in a later commit.

--HG--
branch : stable
context.status: remove incorrect swapping of added/removed in workingctx

The comment in workingctx.status() says that "calling 'super' subtly
reveresed the contexts", but that is simply not true, so we should not
be swapping added and removed fields.

--HG--
branch : stable
bookmarks: explicitly track identical bookmarks

bookmarks.compare() previously lumped identical bookmarks in the
"invalid" bucket. This patch adds a "same" bucket.

An 8-tuple for holding this state is pretty gnarly. The return value
should probably be converted into a class to increase readability. But
that is beyond the scope of a patch intended to be a late arrival to
stable.

--HG--
branch : stable
extra : rebase_source : 44b6ca263e3183f436634f412198a4c09da5d364
exchange: don't report failure from identical bookmarks

b901645a8784 regressed the behavior of pushing an unchanged bookmark to
a remote. Before that commit, pushing a unchanged bookmark would result
in "exporting bookmark @" being printed. After that commit, we now see
an incorrect message "bookmark %s does not exist on the local or remote
repository!"

This patch fixes the regression introduced by b901645a8784 by having
the bookmark error reporting code filter identical bookmarks and adds
a test for the behavior.

--HG--
branch : stable
extra : rebase_source : 4dc8d11b52879900c321d0d2bb487101556ed8ac
setdiscovery: extract sample limitation in a `_limitsample` function

We need to reuse this logic for the initial query. We extract it in a function
to unsure sample limiting is applied consistently in all cases.

--HG--
branch : stable
setdiscovery: limit the size of the initial sample (issue4411)

The set discovery start by sending a "known" command with all local heads. When
the number of local heads is massive (eg: using hidden changesets) such request
becomes too large. This lead to 414 error over http, aborting the whole
process.

We limit the size of the sample used by the first query to fix this.

The test are impacted because they do test massive number of heads. But they do
not test it over real world http setup.

--HG--
branch : stable
status: make 'hg status --rev' faster when there are deleted files

In order not to avoid listing files as both added and deleted, for
example, we check for every file in the manifest if it is in the
_list_ of deleted files. This can get quite slow when there are many
deleted files. Change it to a set to make the containment check
faster. On a somewhat contrived example of the Mozilla repo with the
entire testing/ directory deleted (~14k files), this makes
'hg status --rev .^' go from 26s to 2s.

--HG--
branch : stable
extra : rebase_source : 221543f4a2362dc6d2499ffb65da53bce3193d3e
httppeer: close the temporary bundle file after two-way streaming it

This fixes several push tests in test-bundle2-exchange.t that were failing on
Windows with messages like the following:

   $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 \
        --bookmark book_32af
   pushing to http://localhost:$HGPORT2/
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
   remote: 1 new obsolescence markers
   updating bookmark book_32af
   abort: The process cannot access the file because it is being used by another
            process: 'C:\path\to\tmp\bundle.hg'
   [255]

--HG--
branch : stable
extra : rebase_source : 2a440d8462a9bf9ef9d5fefb8710d9f118388477
parsers: introduce headrevsfiltered in C extension

All extensions that have this function do support filtering. The existing
headrevs function may support filtering but we cannot reliably detect whether
it does.

--HG--
branch : stable
extra : rebase_source : 1e610e38ed85ce8a8f1d649a105b838a320b88e2
changelog: use headrevsfiltered

2b5940f64750 introduced use of the new filtering headrevs C implementation. It
caught TypeError to detect when to fall back to the implementation that was
compatible with old extensions. That method was however not reliable.

Instead, use the new headrevsfiltered function when passing a filter. It will
reliably fail with AttributeError when an old extension that predates
headrevsfiltered is used.

--HG--
branch : stable
extra : rebase_source : 555d9f38051c9f69e4348e09f989fbf8160fc9a5
largefiles: ignore removal status of files not managed in the target context

Before this patch, "hg status --rev REV" listed largefiles removed in
the working directory up with "R" mark, even if they aren't managed in
the REV. Normal files aren't listed up in such case.

When "lfilesrepo.status" is invoked for "hg status --rev REV", it
treats files on conditions below as "removed" (to avoid manifest full
scan in "ctx.status" ?):

  - marked as "R" in lfdirstate, or

  - files managed in the target revision but unknown in the manifest
    of the working context (= not including "R" files)

But the former can include files not managed in the target context.

To ignore removal status of files not managed in the target context,
this patch drops files unknown in the target revision from "removed"
list.

--HG--
branch : stable
largefiles: add examination of exec bit in "hg status --rev REV" case

Before this patch, "hg status --rev REV" doesn't list largefiles up
with "M" mark, even if exec bit of them is changed, because
"lfilesrepo.status" doesn't examine exec bit in such case.

--HG--
branch : stable
doc: change 'revision or range' to 'revision or revset'

The phrase "revision or range" comes from a pre-revset era. Since the
documentation for ranges now is under the revset docs, and as a
helpful hint nudging users towards revsets, I think it's better to say
"revision or revset"

--HG--
branch : stable
tests: introduce "checkeditform-n-cat.sh" script to invoke "cat" in it safely

Before this patch, a part of "test-transplant.t" fails unexpectedly on
Windows environment, because semicolon (";") in HGEDITOR isn't
recognized as the command separator by "cmd.exe".

This patch newly introduces "checkeditform-n-cat.sh" script to invoke
"cat" in it safely anywhere.

--HG--
branch : stable
tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"

Before this patch, a part of "test-alias.t" fails unexpectedly on
Windows environment, because "cmd.exe" can't evaluate "$HG_ARGS"
expression in shell alias correctly.

This patch uses "%HG_ARGS%" in shell alias on Windows instead of
"$HG_ARGS" to expand it correctly.

--HG--
branch : stable
tests: change obsolete timestamp to avoid "gmtime()" problem on Windows

Before this patch, "test-obsolete.t" fails on Windows environment,
because strings corresponded to "tm_wday" (day of the week) field are
incorrect.

On POSIX environment, "gmtime()" returns correct "tm_wday" value even
for negative "time_t" value. On the other hand, it returns incorrect
one on Windows environment. At least, "gmtime()" of the Windows
runtime library bundled with Python 2.7.3 does.

According to 9a7d0f7e0561 introducing original timestamp value '56
120', it shouldn't cause negative "time_t" value.

    test-obsolete: remove subminute timezone in test

    Obsmarker format "1" does not supports sub minute timezone. So we
    change the test to something slightly more sensible.

It replaced "-d '56 12'" by "-d '56 120'".

--HG--
branch : stable
tests: don't try to test unix sockets on vfat

--HG--
branch : stable
test-clone.t: drop message about listing bookmarks with no hardlinks

--HG--
branch : stable