Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View

Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

Augie Fackler
py3: whitelist two more passing tests

Caught by the ratchet, but initially only the non-legacy path of
test-clone-uncompressed.t was passing. That required the preceding

Differential Revision: https://phab.mercurial-scm.org/D4729
Augie Fackler
keepalive: be more careful about self._rbuf when calling super impls

In Python 3, HTTPResponse implements read() in terms of readinto(),
which was calling back into our readinto(), which duplicates
self._rbuf if it's not empty. Before calling into super's read(),
ensure self._rbuf is empty.

Inheritance is bad, and undocumented self-use of your public API is
one of many reasons.

Differential Revision: https://phab.mercurial-scm.org/D4728
Gregory Szorc
wireprotov2: expose rich arguments metadata

Now that we internally store rich metadata about arguments, it makes
sense to make that metadata available to the client. This will allow
clients to validate outgoing command requests before they are sent
over the wire.

Strictly speaking, we should bump the wire protocol version for this
change since it is backwards incompatible. But no client-side code
touches the arguments map and I don't want to incur the work.

Differential Revision: https://phab.mercurial-scm.org/D4618
Gregory Szorc
wireprotov2: teach changesetdata to fetch ancestors until depth

For shallow clone, it is useful to specify a starting node and tell
the server to send up to N ancestors from that starting point. This
enables the server to perform the DAG walk without the client having
to discover the base/stop node(s) first.

This commit implements support for said queries on the changesetdata

Differential Revision: https://phab.mercurial-scm.org/D4621
Yuya Nishihara
hgweb: use scmutil.binnode() to translate None to wdir hash (issue5988)

I left some of ctx.node() calls unchanged as they seemed unlikely to be
workingctx, or passed to diff functions where None is the default value.

Note that a None revision can also cause a similar problem, but I'm not sure
if we can simply bulk-replace ctx.rev() with scmutil.intrev(ctx) as there's
large hole between tip revision and wdir revision. If such pair were passed
in to xrange() for example, we would waste CPU time.
Gregory Szorc
wireprotov2: allow multiple fields to follow revision maps

The *data wire protocol commands emit a series of CBOR values.
Because revision/delta data may be large, their data is emitted
outside the map as a top-level bytestring value.

Before this commit, we'd emit a single optional bytestring
value after the revision descriptor map. This got the job done.
But it was limiting in that we could only send a single field.
And, it required the consumer to know that the presence of a
key in the map implied the existence of a following bytestring

This commit changes the encoding strategy so top-level bytestring
values in the stream are explicitly denoted in a "fieldsfollowing"
key. This key contains an array defining what fields that follow
and the expected size of each field.

By defining things this way, we can easily send N bytestring
values without any ambiguity about their order. In addition,
clients only need to know how to parse ``fieldsfollowing`` to
know if extra values are present.

Because this breaks backwards compatibility, we've bumped the version
number of the wire protocol version 2 API endpoint.

Differential Revision: https://phab.mercurial-scm.org/D4620
Yuya Nishihara
log: have changesetformatter fill in wdir() rev and node (BC)

This matches the behavior of the default template keywords. wdir() support
is still experimental so we can change the output.
Yuya Nishihara
annotate: pass around full hex node until formatting plain output

In short, this patch moves h[:12] from hexfn() to formathex() so that
formathex() can test if h is the wdirhex or not. This helps switching the
wdir value to wdirrev/wdirhex. See the next patch.
Gregory Szorc
wireprotov2: advertise set of valid values for requestable fields

changesetdata, manifestdata, and filedata all allow the caller to
specify what data fields to request.

Data fields are extensible and may evolve over time. In order to
prevent clients from making requests for fields that are not
available, the client needs to know what fields are available.

This commit teaches the server to declare a set of "valid values"
for wire protocol command arguments. That set of values is exposed
in the command's capabilities descriptor. The changesetdata,
manifestdata, and filedata commands all declare their set of
available "fields."

Differential Revision: https://phab.mercurial-scm.org/D4619
Gregory Szorc
wireprotov2: advertise recognized path filter prefixes

While the wire protocol doesn't yet support it, we'll eventually
have commands that accept narrow patterns to specify the set of
files relevant to a command.

For security and performance reasons, only specific filter types
are allowed.

This commit teaches the server to advertise the set of allowed
filter types. By doing so, clients can e.g. validate user-specified
patterns against the server's abilities without having to send
a command to retrieve data.

Having the data in the capabilities data structure will also serve
as a check against unwanted BC.

Differential Revision: https://phab.mercurial-scm.org/D4616
Gregory Szorc
wireprotov2: declare command arguments richly

Previously, we declared command arguments with an example of
their value. After this commit, we declare command arguments
as a dict of metadata. This allows us to define the value
type, whether the argument is required, and provide default
values. This in turn allows us to have nice things, such as
less boilerplate code in individual commands for validating
input and assigning default values. It should also make command
behavior more consistent as a result.

Test output changed slightly because I realized that the "fields"
argument wasn't being consistently defined as a set. Oops!

Other test output changed because of slight differences in code
performing type validation.

Differential Revision: https://phab.mercurial-scm.org/D4615
Yuya Nishihara
annotate: pass in wdir rev and node to formatter (BC)

This is a part of the unification series. The 'ff..' hash is preferred over
None as it is a valid revision specifier.

Yuya Nishihara
log: fill in pseudo rev and node as wdir() manifest identifiers

While we'll never support such identifiers to look up the manifest,
this behavior seems more consistent.
Yuya Nishihara
help: document web.static config

Spotted by check-config.py.
Yuya Nishihara
hgweb: register web.static to the config table

Otherwise we would got a develwarn.
Pulkit Goyal
tests: use assertTrue() instead of assert_() in test-bdiff.py

The later is deprecated in Python 3.

This patch also makes the test pass on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D4697
Pulkit Goyal
py3: fix kwargs handling in hgext/absorb.py

This fixes couple of tests on Python 3. There is only one absorb test left
failing on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D4694
Pulkit Goyal
py3: use '%d' for integers instead of '%s'

Python 3 does not allow using "%s" for integers.

This makes the test works on Python 3. The test still does not pass because
there is a deprecation warning.

Differential Revision: https://phab.mercurial-scm.org/D4696
Pulkit Goyal
py3: add b'' prefixes in tests/test-bdiff.py

This makes the test close to passing

# skip-blame because just b'' prefixes

Differential Revision: https://phab.mercurial-scm.org/D4695
Pulkit Goyal
py3: use pycompat.strkwargs() in contrib/simplemerge

Differential Revision: https://phab.mercurial-scm.org/D4699
Pulkit Goyal
py3: add b'' prefixes in contrib/simplemerge

They were added using byteify-strings.py.

# skip-blame because just b'' prefixes

Differential Revision: https://phab.mercurial-scm.org/D4698
Gregory Szorc
filelog: stop proxying headrevs() (API)

The previous commit removed the last user of this method. It is
redundant with heads() and adds little to no value other than
convenience. Let's nuke it.

Differential Revision: https://phab.mercurial-scm.org/D4663
Gregory Szorc
hgweb: use heads() instead of headrevs()

These appear to be the only callers of headrevs() on file storage
objects. Let's port to heads() so we can remove headrevs().

Differential Revision: https://phab.mercurial-scm.org/D4662
Gregory Szorc
filelog: stop proxying start(), end(), and length() (API)

These were needed by the censoring code, which formerly lived in the
censor extension. Now that there is a censoring API on the file storage
interface, nothing uses these methods and we can stop proxying them.

Differential Revision: https://phab.mercurial-scm.org/D4657
Gregory Szorc
filelog: stop proxying datafile (API)

It appears the censor code was the last user of this proxy. With
there being a dedicated censor API, we can drop the proxy.

Differential Revision: https://phab.mercurial-scm.org/D4660
Gregory Szorc
filelog: record what's using attributes

filelog and the file storage interface have some attributes that
ideally shouldn't be there. This commit annotates some of those
attributes with their users so we know where to look when it comes
time to removing them.

This exercise exposed a theme: many attributes are used by LFS,
repo upgrade, verify, and special repo types (like bundlerepo). That
points to missing abstractions on file storage to facilitate these
special needs.

Differential Revision: https://phab.mercurial-scm.org/D4661
Gregory Szorc
filelog: stop proxying _addrevision() (API)

There are no callers of this API in core. And I'm not sure why this
proxy was added in the first place, as the commit that added it
(1541e1a8e87d) didn't appear to have any callers in the repo either.
Who knows.

Differential Revision: https://phab.mercurial-scm.org/D4659
Gregory Szorc
filelog: stop proxying compress() (API)

The censoring code was previously relying on this. With a dedicated
censoring API on the interface, no consumers are left and we can
stop proxying this method.

Differential Revision: https://phab.mercurial-scm.org/D4658
Gregory Szorc
revlog: move censor logic out of censor extension

The censor extension is doing very low-level things with revlogs.
It is fundamentally impossible for this logic to remain in the censor
extension while support multiple storage backends: we need each
storage backend to implement censor in its own storage-specific

This commit effectively moves the revlog-specific censoring code to
be a method of revlogs themselves.

We've defined a new API on the file storage interface for censoring
an individual node. Even though the current censoring code doesn't
use it, the API requires a transaction instance because it logically
makes sense for storage backends to require an active transaction
(which implies a held write lock) in order to rewrite storage.

After this commit, the censor extension has been reduced to
boilerplate precondition checking before invoking the generic
storage API.

I tried to keep the code as similar as possible. But some minor
changes were made:

* We use self._io instead of instantiating a new revlogio instance.
* We compare self.version against REVLOGV0 instead of != REVLOGV1
  because presumably all future revlog versions will support censoring.
* We use self.opener instead of going through repo.svfs (we don't have
  a handle on the repo instance from a revlog).
* "revlog" dropped
* Replace "flog" with "self".

Differential Revision: https://phab.mercurial-scm.org/D4656
Gregory Szorc
error: introduce StorageError

Errors in revlogs are often represented by RevlogError. It's fine
for revlogs to raise a revlog-specific exception. But in the context
of multiple storage backends, it doesn't make sense to be throwing or
catching an exception with "revlog" in its name when revlogs may not
even be in play.

This commit introduces a new generic StorageError type for representing
errors in the storage layer.

RevlogError is an instance of this type.

Interface documentation and tests referencing RevlogError has been
updated to specify StorageError should be used.

.. api::

  ``error.StorageError`` has been introduced to represent errors in
  storage. It should be used in place of ``error.RevlogError`` unless
  the error is known to come from a revlog.

Differential Revision: https://phab.mercurial-scm.org/D4654
Gregory Szorc
revlog: drop LookupError alias (API)

This alias is especially bad because it shadows the built-in
LookupError type. This has caused me confusion in the past
when reading revlog code. Qualifying all uses with "error." will
make it obvious that we're using a Mercurial error type.

Differential Revision: https://phab.mercurial-scm.org/D4653
Gregory Szorc
global: replace most uses of RevlogError with StorageError (API)

When catching errors in storage, we should be catching
StorageError instead of RevlogError. When throwing errors related
to storage, we shouldn't be using RevlogError unless we know
the error stemmed from revlogs. And we only reliably know that
if we're in revlog.py or are inheriting from a type defined in

Differential Revision: https://phab.mercurial-scm.org/D4655
Gregory Szorc
testing: add interface unit tests for file storage

Our strategy for supporting alternate storage backends is to define
interfaces for everything then "code to the interface."

We already have interfaces for various primitives, including file
and manifest storage.

What we don't have is generic unit tests for those interfaces. Up
to this point we've been relying on high-level integration tests
(mainly in the form of existing .t tests) to test alternate storage
backends. And my experience with developing the "simple store" test
extension is that such testing is very tedious: it takes several
minutes to run all tests and when you find a failure, it is often
non-trivial to debug.

This commit starts to change that.

This commit introduces the mercurial.testing.storage module. It
contains testing code for storage. Currently, it defines some
unittest.TestCase classes for testing the file storage interfaces.
It also defines some factory functions that allow a caller to easily
spawn a custom TestCase "bound" to a specific file storage backend

A new .py test has been added. It simply defines a callable to produce
filelog and transaction instances on demand and then "registers" the
various test classes so the filelog class can be tested with the
storage interface unit tests.

As part of writing the tests, I identified a couple of apparent
bugs in revlog.py and filelog.py! These are tracked with inline
TODO comments.

Writing the tests makes it more obvious where the storage interface
is lacking. For example, we raise either IndexError or
error.LookupError for missing revisions depending on whether we
use an integer revision or a node. Also, we raise error.RevlogError
in various places when we should be raising a storage-agnostic
error type.

The storage interfaces are currently far from perfect and there is much
work to be done to improve them. But at least with this commit we
finally have the start of unit tests that can be used to "qualify"
the behavior of a storage backend. And when implementing and debugging
new storage backends, we now have an obvious place to define new
tests and have obvious places to insert breakpoints to facilitate
debugging. This should be invaluable when implementing new storage

I added the mercurial.testing package because these interface
conformance tests are generic and need to be usable by all storage
backends. Having the code live in tests/ would make it difficult for
storage backends implemented in extensions to test their interface
conformance. First, it would require obtaining a copy of Mercurial's
storage test code in order to test. Second, it would make testing
against multiple Mercurial versions difficult, as you would need to
import N copies of the storage testing code in order to achieve test
coverage. By making the test code part of the Mercurial distribution
itself, extensions can `import mercurial.testing.*` to access and run
the test code. The test will run against whatever Mercurial version
is active.

FWIW I've always wanted to move parts of run-tests.py into the
mercurial.* package to make the testing story simpler (e.g. imagine an
`hg debugruntests` command that could invoke the test harness). While I
have no plans to do that in the near future, establishing the
mercurial.testing package does provide a natural home for that code
should someone do this in the future.

Differential Revision: https://phab.mercurial-scm.org/D4650
Gregory Szorc
revlog: drop some more error aliases (API)

These should be lightly used and I doubt that will be any
strong objections to removing the aliases.

Note that some uses of ProgrammingError in this file use
translated messages. I'm pretty sure that's a bug. But the
linters don't complain, so meh.

Differential Revision: https://phab.mercurial-scm.org/D4652
Gregory Szorc
revlog: drop RevlogError alias (API)

error.RevlogError was moved from revlog.py in 08cabecfa8a8 in
2009. revlog.RevlogError has remained as an alias ever since.

Let's drop the alias and use error.RevlogError directly.

Differential Revision: https://phab.mercurial-scm.org/D4651
Gregory Szorc
localrepo: enable ellipsis flag on revlogs when repo is narrow

If the narrow requirement is present, revlogs created for that
repository will have the ellipsis flag enabled.

This is the same behavior that the narrow extension exhibits. Except
the ellipsis flag won't be enabled on repos/revlogs that don't have
the narrow requirement.

Differential Revision: https://phab.mercurial-scm.org/D4648
Gregory Szorc
filelog: custom filelog to be used with narrow repos

Narrow repos may have file revisions whose copy/rename metadata
references files not in the store. This can pose problems when
consumers attempt to access a missing referenced file revision.

The narrow extension hacks around this problem by implementing a
derived filelog type that provides custom implementations of
renamed(), size(), and cmp() which handle renames against files not
in the narrow spec by silently removing the rename metadata.

While silently dropping metadata isn't the most robust solution,
it is the easiest to implement.

This commit ports the custom narrow filelog class to core.

When a narrow repo is constructed, its ifilestorage creation
function will automatically use the new filelog type. This means
the extra logic is 0 cost for non-narrow repos and shouldn't
interfere with their operation.

Differential Revision: https://phab.mercurial-scm.org/D4643
Gregory Szorc
localrepo: pass root manifest into manifestlog.__init__

Today, localrepository has a method that can be overloaded which
returns an instance of the root manifest storage object. When a
manifestlog is created, it calls this private method and stores
the root manifest object on it.

This "hook" on localrepository isn't part of the documented interface.
It isn't compatible with our desire to make repo storage determined
before the repo object is constructed.

This commit changes manifestlog.__init__ to accept the root
storage object instead of calling into the repo to construct it.
By doing things this way, the repo instance is responsible for
constructing the manifest storage object directly.

This does mean that other derived repo types need to overload
manifestlog(). But they should have been doing this already,
as manifestlog() is typically decorated in a storage-specific way.
e.g. localrepository.manifestlog() is decorated as
@storecache('00manifest.i'). And this assumes that a 00manifest.i
file exists in the store vfs. This condition may not hold for
repository types using non-revlog storage. So it is important
for special repo types to override manifestlog() to remove this
file association.

The code changed in perf is wrong because it isn't compatible with
older Mercurial versions. But I'm pretty sure the code was broken
on older versions before this commit. It only affects `hg perftags`.
I don't care enough to fix that at this time.

.. api::

  ``manifest.manifestlog.__init__()`` now receives the root manifest
  storage instance instead of calling into a private method on
  the repo object to obtain it.

Differential Revision: https://phab.mercurial-scm.org/D4641
Gregory Szorc
revlog: add opener option to enable ellipsis flag processor

The ellipsis flag processor can now be registered by specifying
an opener option when constructing a revlog instance. This allows
us to enable ellipsis flags on a per-revlog basis.

Differential Revision: https://phab.mercurial-scm.org/D4647
Gregory Szorc
narrow: remove narrowrevlog

Core now automatically enables ellipsis support on revlogs when
repositories have narrow enabled. So, we no longer need to globally
register the revlog flag as part of activating the narrow extension
and this code can be deleted.

A side effect of this change is that repositories will now raise an
error on encountering an ellipsis flag when the narrow extension is
loaded. Previously, loading the narrow extension on a non-narrow repo
could result in silent usage of the ellipsis flag. This could lead
to undetected bugs. I think the new behavior is more correct.

Differential Revision: https://phab.mercurial-scm.org/D4649