revsetbenchmarks: add an additional roots() benchmark

The existing roots(x - y) revset only considered the most recent 100
revisions. This was a good start. But expanding it to the full history
of the repository can dramatically increase execution time and thus
constitutes a useful benchmark.

--HG--
extra : source : 6f27a8af98796dbce87d66eb7aa33153a38015f0
dirstate: copyedit exception for no beginparentchange call

--HG--
extra : amend_source : 1cbe81a36c02419475d1b3420322f7216773f054
patch: enable diff.tab markup for the color extension

The following patch splits up changed lines along tabs (using
re.findall), and gives them a "diff.tab" label. This can be used by
the color extension for colorising tabs, like it does right now with
trailing whitespace.

I also provide corresponding tests.

--HG--
extra : amend_source : 23fd70db1f28114500740befefd28b02306e8dff
contrib: add OS X p4merge to mergetools.hgrc
color: document that labels are used for colorizing text

It is a deeply hidden secret that it's possible to colorise so many
things with so many different labels. This is an attempt to document
this. The text is a bit long, but it seems as short as can be while
documenting everything. Perhaps it should be hidden under a --verbose
option.
color: enable debug option to show labels

This is a debug option for showing labels. This can be helpful for
knowing which labels are available for colouring or to see the output
when defining your own templates. A couple of tests are included.

--HG--
extra : rebase_source : c71ca255ea1389f5ea3d9dc59cb2f86f0e624c5b
color: change the debug output format

Before, the format was

 label(labeled text)  # single label
 [label1 label2](labeled text) # multiple

Now, it's

 [labels|labeled text]

..which should make things a bit more clear.

--HG--
extra : amend_source : d62cae0e2fac800e5fcce50247c8b779f569e4c4
color: document that changeset phases have labels

It's very useful to be able to colourise csets according to their
phases. There was no indication anywhere in the docs that this is
possible.

We use e.g. `changeset.secret = ` instead of `changeset.secret
='none'`, because otherwise this is a BC: it would nullify the effects
given to log.changeset label that usually surrounds the
changeset.{phase} labels. Specifying the label without any effect
instead of 'none' is a true no-op change and purely documentation.

--HG--
extra : rebase_source : bfa1ac85937bc7e36714e948597424212c1e6b9f
convert: add initial docs for git sources

Upcoming patches will add config options for git sources. This patch adds a
place to document them.

--HG--
extra : rebase_source : d18d9d141c3403e07ea057549b9d75daaaee5b13
convert: for git's getchanges, use explicit index for iteration

Upcoming patches will add support for copies and renames, for which we'll need
to access multiple lines of the difftree output at once.

--HG--
extra : rebase_source : b2e867ebde49a0d0d0a063604b2afc09978fc2bb
convert: for git's getchanges, always split entry line into components

We always need to know whether the entry is a rename or copy, so split it up
unconditionally.

--HG--
extra : rebase_source : 0bb4d3e9fdaf200743aeb3c5a5ad8c13c33e271f
convert: for git, factor out code to add entries to a separate function

We're going to call this for multiple files in one iteration in upcoming
patches.

--HG--
extra : rebase_source : b69176f583eaf41c649cd0a97e7d33b214d5399c
convert: add support to detect git renames and copies

Git is fairly unique among VCSes in that it doesn't record copies and renames,
instead choosing to detect them on the fly. Since Mercurial expects copies and
renames to be recorded, it can be valuable to preserve this history while
converting a Git repository to Mercurial. This patch adds a new convert option,
called 'convert.git.similarity', which determines how similar files must be to
be treated as renames or copies.

--HG--
extra : rebase_source : c584225c9044110d70aa1cb0dcd522d5d83b7f9e
convert: add support to find git copies from all files in the working copy

I couldn't think of a better name for this option, so I stole the Git one in
the hope that anyone converting a Git repo knows what it means.

--HG--
extra : rebase_source : d861e9672e3468b6f8f9f8e488d596f1d03b4fd7
contrib/synthrepo: only generate 2 parents if model contains merges

If `hg analyze` is run on a revision set which contains no merges, then
`hg synthesize` will raise IndexError trying to select from p2distance,
which will be empty.

--HG--
extra : rebase_source : c1465832b705730e21b4fb18ae0d7a691c53ed84
contrib/synthrepo: pass options to ctx.diff as kwargs, not a dict

--HG--
extra : rebase_source : 382ce70cf0a624429bd0d2445868e9014e4e4405
formatter: extract function that encode values to json string

This is the stub for tuple support, which will be used to encode ctx.date()
in the same manner as jsonchangeset printer.

--HG--
extra : rebase_source : 330aab54a134763172c5e5163e2b53b72c5fb2db
formatter: have jsonformatter accept tuple as value

This is necessary for "annotate" to encode ctx.date() in the same manner
as jsonchangeset printer.

It doesn't support list object because keeping mutable object in _item could
be a source of hidden bugs.  Also, I can't think of the use case.

--HG--
extra : rebase_source : 9e091c801abd6a5b3aab6fe9280434a1b56adb15
formatter: convert float value to json

It will be used to encode ctx.date().

--HG--
extra : rebase_source : ead3aab507028a2952572aacf88b86228b7c863d
annotate: build format string separately from annotation data

This prepares for porting to generic templater API.

Note that we cannot use '%*s' to pad white spaces because it doesn't take
into account character widths, as described in 4f5a6df2af92.

--HG--
extra : rebase_source : 31aeb8aaa3ec0d8636a6e56756c8bd6d8329b89e