revert: simplify handling of `added` files

There are multiple possible cases for added files. But it's all handled by magic
much lower in the stack. We document them, simplify the codes and move on.
revert: detect files added during a merge

In case of merge, file that are actually added can be reported as modified. This
is currently handled by special-case code. We detect it beforehand instead. This
will lets use remove the special-case code at some point in the future.
revert: drop `missingmodified` set

There cannot be any elements in this set since:

    dsmodified &= modified
revert: remove code killed by the double status

All those checks were here to catch cases where files were not modified in
dirstate but were different in the target revision. This is now properly handled
by calling status on the target node too.
revert: inline a now useless closure

Now that a single call site remains, we can just inline its content.
revert: add an XXX about rename tracking

We check for rename information in the dirstate. This is probably not enough to
preserve this behavior when using an explicit target rev.

I just spotted this while working on this code, but this is outside the scope
of my series so I'm just adding a comment to highlight this suspicious
situation.
test-treediscovery: update output after merge

Recent change in the push process introduced an extra listing of the phase
name space before the push (on default). Meanwhile on default, a fix introduced
a new test with debug output.

We update the test output to be correct.
obsmarker: add a `flags` method

We introduce a proper method to access the flag information.
obsolete: explicitly pass metadata argument using keyword argument

We are about to add more arguments to this function (date, parents, etc).
Passing metadata as a keyword argument gives us more flexibility when adding
them.
obsstore: add an explicit `date` argument to obsstore.create

The date will become an official field in the markers (and ultimately
in the on-disk format). We start by making it an official argument for
the function.
debugobsolete: use the new date argument on obsstore.create

Now that we have this new argument, we can just use it.
obsolete: add a date argument to the `createmarkers` function

The function is now just passing the value to create markers.
debugobsolete: explicitly display date in the output

As the date is becoming a first-class citizen, we are displaying it in an
explicit field. As a bonus it is now readable by humans.
obsstore: add fields attribute to track each field in a marker

We are going to increase the amount of data explicitly stored in obsolescence
markers. This mean we are going to have a longer tuple and some values will be
shuffled around. So we add a ``fields`` attribute to the obsstore class to
keep track of what entry is what. This will be useful for extensions and for
documentation purpose.
obsmarker: add `date` as an explicit field

The markers are now 5-item tuples (concluded by the date). The obsstore.fields
contents have been updated accordingly.

There is no change to the on-disk format yet, so the date has to be extracted
every time we read binary markers and re-injected each team we write them. This
introduces a slowdown that will be solved when a new version of the format is
added. Such a slowdown was already introduced by the evolve extension anyway.
hgweb: refresh repository using URL not path (issue4323)

hgweb detects out-of-date repository instances (using a highly
suspect mechanism that should probably be fixed) and obtains a new
repository object if needed.

This patch changes the repository object copy to use the repo URL
(instead of path). This preserves more information about the source
repository and allows bundles to be served through hgweb.

A test verifying that bundles can now be served properly via
`hg serve` has been added.
push: update bookmarks within the remote lock

Updating bookmarks is part of the push. It should be done within the same lock
as the other steps of the push.
ancestors: add a __nonzero__ method

This allows using the object in a conditional the same way we can use list.
pushbookmark: stop unrolling ancestors

Now that ancestors has the same boolean property as a list, we can stop unrolling
the set of ancestors. This should provide a significant speedup to this step as
ancestor objects are smart and lazy.
pushbookmark: remove a <cond> and <val> or <other> construct

We make the conditional explicit for the sake of readability.