merge with stable
obsolete: ensure that `getrevs` always return a set

When a set of revisions was empty, we were using an empty tuple. We now return an
empty frozenset to ensure the object could be used in an operation that requires a
set.
revert: add a fullreposet class

Every revset evaluation starts from `subset = spanset(repo)` and a lot of
revset predicates build a `spansetrepo` for their internal needs.

`spanset` is a generic class that can handle any situation. As a result a lot
of operation between spanset result in an `orderedlazyset`, a safe object but
suboptimal in may situation.

So we introduce a `fullreposet` class where some of the operation will be
overwritten to produce more interesting results.

--HG--
extra : rebase_source : a6c89ab055650296c4e01f45e1bf04a4485b4968
revset: turn spanset into a factory function

We rename the `spanset` class to `_spanset`. `spanset` is now a function that
builds either a `fullreposet` or a `_spanset` according to the argument passed.

At some point, we may force people to explicitly use the `fullreposet`
constructor, but the current approach makes it easier to ensure we use the new
class whenever possible and focus on the benefits of this class.
revset: fast implementation for fullreposet.__and__

"And" operation with something that contains the whole repo should be super
cheap. Check method docstring for details.

This provide massive boost to simple revset that use `subset & xxx`

revset #0: p1(20000)
0) wall 0.002447 comb 0.010000 user 0.010000 sys 0.000000 (best of 767)
1) wall 0.000529 comb 0.000000 user 0.000000 sys 0.000000 (best of 3947)

revset #1: p2(10000)
0) wall 0.002464 comb 0.000000 user 0.000000 sys 0.000000 (best of 913)
1) wall 0.000530 comb 0.000000 user 0.000000 sys 0.000000 (best of 4226)

No other regression spotted.

More performance improvements are expected in the future as more
revset predicate are converted to use `subset & xxx`

The relaxed way `fullreposet` handles "&" operation may cause some trouble for
people comparing smartset from different filter levels. I'm not sure such people
exist and we can improve that aspect in later patches.
convert: simplify git.similarity parsing

--HG--
extra : rebase_source : 8b285e6884efb25ceed5bccf0e6a7ad5d0f2b532
convert: change default for git rename detection to 50%

This default mirrors the default for 'git diff'. Other commands have slightly
different defaults -- for example, the move/copy detection for 'git blame'
assumes that a hunk is moved if more than 40 alphanumeric characters are the
same, or copied if more than 20 alphanumeric characters are the same. 50% seems
to be the most common default, though.

--HG--
extra : rebase_source : 294fcc24d14ff580909cfe0c26af1b31e76e8f61
match: simplify brittle predicate construction

In match.__init__(), we create the matchfn predicate by and-ing
together the individual predicates for includes, excludes (negated)
and patterns. Instead of the current set of nested if/else blocks, we
can simplify by adding the predicates to a list and defining the
overall predicate in a generic way based on the components. We can
still optimize it for the 0-length and 1-length cases. This way, there
is no combinatorial explosion to deal with if new component predicates
are added, and there is less risk of getting the overall predicate
wrong.

--HG--
extra : rebase_source : 9814c199e089e315ba2b5f55e455a212a5d22d64
largefiles: remove dead assignment left over from change 1ff42ee98446

--HG--
extra : rebase_source : ed8072782bce50effd1a36ea19372e40f19df8f5
largefiles: reduce indentation by dropping 'else' block after 'return'

--HG--
extra : rebase_source : 8a3b6ca9aba3457d64c94e5353511a0c966b3d7a
largefiles: extract 'orig' method in lfilesmanifestdict.__contains__

--HG--
extra : rebase_source : 4f0e03bdceae9332b02dc482890c5fb4202178b4
largefiles: extract 'orig' method in lfilesctx.filectx

--HG--
extra : rebase_source : e25d766cf29cc64c6fb0e9b8fc6fde703f8c1e09
largefiles: extract 'orig' method in reposetup.status

--HG--
extra : rebase_source : 30f67db1d723578302900e67c0a0989009130889
mq: correctly make an empty line after description in new patches

There would in some cases be an empty line between headers and the description -
that does not seem right.

There should also be an empty line between description and diff - but that was
missing.

These two mistakes would sometimes make it up for each other so we fix both at
once to just show the improvement.

Instead of writing an extra newline when writing a header line, write an extra
line when it not is written as a part of the description but is necessary
anyway.
mq: write headers for new HG patches in the same order as export (BC)
mq: write '# Parent  ' lines with two spaces like export does (BC)

This aligns "Parent" node IDs with "Node ID" node IDs.

--HG--
extra : rebase_source : 51798d29d429c5152c69c685bdeb2dc07b3e04c7
mq: simplify patchheader handling of the empty line before the diff

Don't try to append empty lines to HG patch headers - instead, add them in str
method.

This minor change removes some apparently redundant code and makes the code
more robust.
largefiles: remove unnecessary clearing of status fields

At the end of lfilesrepo.status(), we clear the lists of unknown,
ignored and clean files, depending on the values of 'listunknown'
etc. The lists originate from other calls to status(), and it is only
'clean' that may get updated after the calls. Let's remove the need to
clear any of the lists by explicitly only adding to 'clean' when
'listclean' is true.

--HG--
extra : rebase_source : be6c478ca5c499cd62321037af9669e3ef9cebde
largefiles: avoid using 'lfiles' variable for two purposes

The variable 'lfiles' is first used for a set of the names of all the
large files. It is then overwritten with a tuple like the ones
returned from status(). To reduce confusion, let's create a separate
variable for the second use.

--HG--
extra : rebase_source : b998e5171251be42f7667b13394780a358a80eb3
largefiles: simplify iteration over standins

Instead of iterating over all files in the context and ignoring those
that are not standins, pass a standin-matcher to the context and
iterate over only the files matching.

Apart from making the intent clearer, this implementation will also
benefit from any future optimizations done to the manifest walking
code.

--HG--
extra : rebase_source : 1d92ad5fbb09185b61609b2e75f24cabc527fe12