Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 21:14:16 +0900] rev 37460
procutil: unify platform.explainexit()
Since
4368f582c806 "use subprocess instead of os.system", posix.explainexit()
is the superset of Windows implementation.
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 21:09:21 +0900] rev 37459
procutil: rewrite popen() as a subprocess.Popen wrapper (
issue4746) (API)
os.popen() of Python 3 is not the popen() we want. First, it doesn't accept
command in bytes. Second, a returned stream is always wrapped by TextIO.
So we have to reimplement our popen(). Fortunately, this fixes the bug 4746
since ours returns an exit code compatible with explainexit().
.. api::
``procutil.popen()`` no longer supports text mode I/O.
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 20:50:38 +0900] rev 37458
procutil: always popen() in binary mode
On Python 3, non-binary stream is useless. Let's convert line ending by
ourselves.
Note that we don't need fromnativeeol() in patch._externalpatch() since
any whitespace characters are rstrip()-ed.
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 13:46:32 +0900] rev 37457
py3: byte-stringify test-import.t
Still the test doesn't pass.
# skip-blame because just adding some b''
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 13:42:37 +0900] rev 37456
py3: convert parsed message items to bytes in patch.extract()
Appears that BytesParser() parses bytes into unicode, sigh.
Yuya Nishihara <yuya@tcha.org> [Sat, 07 Apr 2018 13:21:59 +0900] rev 37455
py3: silence warning about deprecation of imp module
Well, we could fix that, but we aren't yet to reach the state caring about
deprecation on the Python 3 line. So let's silence it for now to fix tons
of "minor" Py2/3 incompatibilities by relying on our test suite.
Martin von Zweigbergk <martinvonz@google.com> [Sat, 07 Apr 2018 00:00:33 -0700] rev 37454
tests: add another full hex node in plain text
Should have been part of D3168.
Differential Revision: https://phab.mercurial-scm.org/D3186
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 16:50:19 -0700] rev 37453
infinitepush: look up bookmarks only among bookmarks
Differential Revision: https://phab.mercurial-scm.org/D3165
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 10:48:11 -0700] rev 37452
destutil: look up bookmarks only among bookmarks
Differential Revision: https://phab.mercurial-scm.org/D3164
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 10:49:43 -0700] rev 37451
discovery: look up bookmarks only among bookmarks
Differential Revision: https://phab.mercurial-scm.org/D3163
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 11:29:30 -0700] rev 37450
bookmarks: introduce a repo._bookmarks.changectx(mark) method and use it
Many places were doing repo[mark], which usually works, but it's
slightly incorrect: if the bookmark has a name that matches a full hex
nodeid of another node, then the context for the other node will be
returned instead. Also, I'm about to remove support for
repo[<namespace thing>] :)
Differential Revision: https://phab.mercurial-scm.org/D3162
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Mar 2018 18:34:07 +0900] rev 37449
revlog: detect pseudo file nodeids to raise WdirUnsupported exception
Again, I'm not sure if this is the right thing, but adding a few more pseudo
hashes wouldn't be any worse than the current state.
Differential Revision: https://phab.mercurial-scm.org/D2942
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Mar 2018 18:31:22 +0900] rev 37448
node: rename wdirnodes to clarify they are for manifest/filelogs
Differential Revision: https://phab.mercurial-scm.org/D2941
Yuya Nishihara <yuya@tcha.org> [Sun, 25 Mar 2018 18:27:43 +0900] rev 37447
workingctx: build _manifest on filenode() or flags() request
I'm not sure if this is the best workaround, but this fixes the following
exception:
AttributeError: 'workingctx' object has no attribute '_manifestdelta'
The short hash '
303030303030' seen in the test is node.modifiednodeid.
Differential Revision: https://phab.mercurial-scm.org/D2940
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 13:11:40 -0700] rev 37446
tests: enter full hex hash in plain text in bundle part
We were looking it up be prefix by repo.__getitem__, which I'm about
to drop support for. It's easiest to just include the full hash in
plain text.
Differential Revision: https://phab.mercurial-scm.org/D3168
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 17:44:18 -0700] rev 37445
tests: call rawsize() directly
rawsize() is not reimplemented outside of revlog. I'm not sure why
this code was insisting it call a specific implementation. Changing
it to call rawsize() on the repo.file(f) result seems to work just
fine.
Differential Revision: https://phab.mercurial-scm.org/D3153
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 17:40:51 -0700] rev 37444
upgrade: sniff for filelog type
The upgrade code should never encounter a vanilla revlog
instance: only changelog, manifestrevlog, and filelog should
be seen.
The previous code assumed !changelog & !manifestrevlog meant
file data. So this change feels pretty safe. If nothing else, it
will help tease out typing issues.
Differential Revision: https://phab.mercurial-scm.org/D3152
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 16:31:45 -0700] rev 37443
revlog: move censor logic into main revlog class
Previously, the revlog class implemented dummy methods for
various censor-related functionality. Revision censoring was
(and will continue to be) only possible on filelog instances.
So filelog implemented these methods to perform something
reasonable.
A problem with implementing censoring on filelog is that
it assumes filelog is a revlog. Upcoming work to formalize
the filelog interface will make this not true.
Furthermore, the censoring logic is security-sensitive. I
think action-at-a-distance with custom implementation of core
revlog APIs in derived classes is a bit dangerous. I think at
a minimum the censor logic should live in revlog.py.
I was tempted to created a "censored revlog" class that
basically pulled these methods out of filelog. But, I wasn't
a huge fan of overriding core methods in child classes. A
reason to do that would be performance. However, the censoring
code only comes into play when:
* hash verification fails
* delta generation
* applying deltas from changegroups
The new code is conditional on an instance attribute. So the
overhead for running the censored code when the revlog isn't
censorable is an attribute lookup. All of these operations are
at least a magnitude slower than a Python attribute lookup. So
there shouldn't be a performance concern.
Differential Revision: https://phab.mercurial-scm.org/D3151
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 18:22:35 -0700] rev 37442
revlog: move parsemeta() and packmeta() from filelog (API)
filelog.parsemeta() and filelog.packmeta() are used to decode
and encode metadata for file copies and censor.
An upcoming commit will move the core logic for censoring revlogs
into revlog.py. This would create a cycle between revlog.py and
filelog.py. So we move these metadata functions to revlog.py.
.. api::
filelog.parsemeta() and filelog.packmeta() have been moved to
the revlog module.
Differential Revision: https://phab.mercurial-scm.org/D3150
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 15:18:23 -0700] rev 37441
filelog: declare that filelog implements a storage interface
Now that we have a declared interface, let's declare that filelog
implements it.
Tests have been added that confirm the object conforms to the
interface.
The existing interface checks verify there are no extra public
attributes outside the declared interface. filelog has several
extra attributes. So we added a mechanism to suppress this check.
The goal is to modify the filelog class so we can drop this check.
Differential Revision: https://phab.mercurial-scm.org/D3149
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 15:09:41 -0700] rev 37440
repository: define existing interface for file storage
Now that we have mostly successfully implemented an alternate
storage backend for files data, let's start to define the
interface for it!
This commit takes the mostly-working interface as defined by the
simple store repo and codifies it as the file storage interface.
The interface has been split into its logical components:
* index metadata
* fulltext data
* mutation
* everything else
I don't consider the existing interface to be great. But it will
help to have it more formally defined so we can start chipping away
at refactoring it.
Differential Revision: https://phab.mercurial-scm.org/D3148
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 05 Apr 2018 11:16:54 -0700] rev 37439
tests: run some largefiles and lfs tests with simple store
Now that the simple store handles flags properly, a handful of
the largefiles and lfs tests pass!
Differential Revision: https://phab.mercurial-scm.org/D3147
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 21:27:02 -0700] rev 37438
commands: don't violate storage abstractions in `manifest --all`
Previously, we asked the store to emit its data files. For modern
repos, this would use fncache to resolve the set of files then would
stat() each file. For my copy of the mozilla-unified repository, this
took 3.3-10s depending on the state of my filesystem cache to render
449,790 items.
The previous behavior was a massive layering violation because it
assumed tracked files would have specific filenames in specific
directories. Alternate storage backends would violate this assumption.
The new behavior scans the changelog entries for the set of files
changed by each commit. It aggregates them into a set and then
sorts and prints the result. This reliably takes ~16.3s on my
machine. ~80% of the time is spent in zlib decompression.
The performance regression is unfortunate. If we want to claw it
back, we can create a proper storage API to query for the set of
tracked files. I'm not opposed to doing that. But I'm in no hurry
because I suspect ~0 people care about the performance of
`hg manifest --all`.
.. perf::
`hg manifest --all` is likely slower due to changing its
implementation to respect storage interface boundaries. If you
are impacted by this regression in a meaningful way, please make
noise on the development mailing list and it can be dealt with.
Differential Revision: https://phab.mercurial-scm.org/D3119
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 21:09:47 -0700] rev 37437
commands: document the layering violation in `manifest --all`
This commit fixes the last test failures when using the simple
store extension!
It turns out that `hg manifest --all` locks the repo and scans for
revlogs. This feature was added by
71938479eff9 in 2011. I am
debating changing the behavior. But that can occur in another
commit.
As part of debugging this, I realized that test-manifest.t is the
only meaningful tester of `hg manifest --all` and that test was
improperly disabled when bundlerepos aren't supported. The test is
testing manifest behavior, not whether you can `hg pull` from a
bundle. So I changed the test to `hg unbundle` instead.
FWIW, I wasted a non-trivial amount of time tracking down this
failure. I thought the issue involved Git, which is why I refactored
the test to be more deterministic. Never in my mind would I have
guessed that code in `hg manifest` would scan revlogs. I should have
looked there to begin with. Doh.
Differential Revision: https://phab.mercurial-scm.org/D3118
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 19:17:22 -0700] rev 37436
simplestore: correctly implement flag processors
There were a couple of bugs around the implementation of
flags processing with the simple store. After these changes,
test-flagprocessor.t now passes!
test-flagprocessor.t was also updated to include explicit test
coverage that pushed data is as expected on the server.
The test extension used by test-flagprocessor.t has been updated
so it monkeypatches the object returned from repo.file() instead
of monkeypatching filelog.filelog. This allows it to work with
extensions that return custom types from repo.file().
The monkeypatching is rather hacky and probably is performance
prohibitive for real repos. We should probably come up with a
better mechanism for registering flag processors so monkeypatching
isn't needed.
Differential Revision: https://phab.mercurial-scm.org/D3116
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:40:09 -0700] rev 37435
tests: `hg init` after resetting HGRCPATH
Otherwise extensions loaded via --extra-config-opt could prevent
access to the repo by introducing requirements file. This does mean
that custom extensions loaded in this way won't impact this test.
I'm fine with that.
Differential Revision: https://phab.mercurial-scm.org/D3115
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:33:59 -0700] rev 37434
tests: work around potential repo incompatibility
test-run-tests.t invokes run-tests.py. But custom extensions providing
new repo requirements may be in play and may not get inherited by the
new run-tests.py. We ensure our repo is created with a vanilla config
to mitigate extension-caused badness.
Differential Revision: https://phab.mercurial-scm.org/D3114
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:29:02 -0700] rev 37433
tests: disable test-keyword.t with simple store
The keyword extension is hooking into repo.file() and defining its
own filelog class. It will likely require a more formal storage
interface before keywords are usable with alternate storage backends.
Differential Revision: https://phab.mercurial-scm.org/D3113
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:12:00 -0700] rev 37432
tests: conditionalize test-treemanifest.t
Parts of the test were assuming the use of revlogs with fnstore
path encoding.
Other parts of the test assumed we could create repos with different
store encodings and that stream clone bundles worked.
Make all of this conditional on running a revlog repo.
Differential Revision: https://phab.mercurial-scm.org/D3112
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:02:54 -0700] rev 37431
tests: use unbundle in test-symlink-os-yes-fs-no.py
The test (which should probably be rewritten as a .t test - the
test was initially authored in 2009 and this may have predated
some test harness features allowing us to implement it as a .t
test) is verifying symlink behavior with regards to working
directory operations. How it pulls bundle data into a repo is
not relevant. So we can switch from pull to unbundle so we can
support environments where bundlerepos don't work.
Differential Revision: https://phab.mercurial-scm.org/D3111
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:49:22 -0700] rev 37430
tests: disable `hg clone --stream` test with simple store
We mass disabled stream clone tests in a previous commit. Looks like
one was missed.
Differential Revision: https://phab.mercurial-scm.org/D3110
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:47:06 -0700] rev 37429
tests: use `hg unbundle` in test-setdiscovery.t
This is testing how discovery between 2 well-defined repos works,
not that `hg pull` works with bundles. Switch to `hg unbundle` so it
works in environments where bundlerepos aren't supported.
Differential Revision: https://phab.mercurial-scm.org/D3109
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:41:43 -0700] rev 37428
tests: require revlog store for test-verify.t
This tests is doing tons of revlog-y things. It should be
possible to make verification work across multiple stores. But it
will likely have to wait until we have better abstractions
in place.
Differential Revision: https://phab.mercurial-scm.org/D3108
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:32:51 -0700] rev 37427
tests: conditionalize test-commandserver.t based on extra extensions
If running with extra extensions we get an output difference.
Differential Revision: https://phab.mercurial-scm.org/D3107
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:29:19 -0700] rev 37426
tests: conditionalize test-bundle.t
This test is massive and could probably be split up.
This change essentially requires the revlog store for stream clone
tests and support for bundlerepos for various tests operating
on bundle files.
Differential Revision: https://phab.mercurial-scm.org/D3106
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:16:42 -0700] rev 37425
tests: require revlog store with test-repair-strip.t
This test is doing a number of low-level things with revlogs.
Mark it as requiring the revlog store.
Differential Revision: https://phab.mercurial-scm.org/D3105
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 17:53:45 -0700] rev 37424
simplestore: back up index when adding a revision
This ensures that transaction rollback reverts the index to its
previous state. This fixed a few test failures due to `hg verify`
complaining about a reference to an undefined changeset revision.
Differential Revision: https://phab.mercurial-scm.org/D3104
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 16:00:50 -0700] rev 37423
tests: disable shallow narrow tests with simple store
I think these are failing because of issues with flags processing
in the simple store. Let's revisit this later.
Differential Revision: https://phab.mercurial-scm.org/D3103
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 15:57:49 -0700] rev 37422
tests: skip test-hgweb-bundle.t if we don't support bundlerepos
Differential Revision: https://phab.mercurial-scm.org/D3102
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 15:31:25 -0700] rev 37421
tests: disable test-audit-path.t with simple store
The simple store is using a primitive filename encoding scheme.
Many tests in this file fail. So let's disable it for now.
At some point, we should support a mode where we can run tests
without fnstore or dotencode and have all tests assuming use of
these filename encoding mechanisms be conditional on their usage.
Differential Revision: https://phab.mercurial-scm.org/D3101
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:43:19 -0700] rev 37420
tests: port test-convert-filemap.t to simple store
Differential Revision: https://phab.mercurial-scm.org/D3100
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:37:53 -0700] rev 37419
tests: disable test-static-http.t with simple store
It /should/ be possible to support repos statically hosted on HTTP
servers with alternate stores. But it's more trouble than it is worth
right now. Let's just disable the test.
Differential Revision: https://phab.mercurial-scm.org/D3099
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:25:20 -0700] rev 37418
tests: don't drop global hgrc
Various tests are failing when the simple store extension is loaded
because the test overrides HGRCPATH and preempts loading of extensions
that were injected via --extra-config-opt.
In most cases, it is acceptable to always load the global HGRCPATH.
So this commit changes a couple of tests so the global HGRCPATH
is still pulled in.
Differential Revision: https://phab.mercurial-scm.org/D3098
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:11:43 -0700] rev 37417
verify: allow suppressing warnings about extra files
The verifier issues warnings when the set of files in .hg/store
doesn't align with the set of files that are advertised via
repo.file(f).files() for all files seen in ctx.files() changelog
traversal.
This logic is reasonable for a default implementation. But some
stores may have extra files whose presence is harmless. Or those
stores may not have the same transaction rollback semantics that
unlink files as other stores.
This commit adds support for disabling the warning for orphaned
files.
The simple store extension has been taught to set this flag.
Differential Revision: https://phab.mercurial-scm.org/D3097
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:04:18 -0700] rev 37416
tests: conditionalize tests for various repo features
Working my down the long tail of test failures due to the simple
store.
We're now down to 38 failures with the simple store.
Differential Revision: https://phab.mercurial-scm.org/D3096
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 14:09:02 -0700] rev 37415
simplestore: use a custom store for the simple store repo
Before, we used the default store, which was based on fncache
and dotencode. After attempting to port tests to work with the
simple store, I realized that fncache was more trouble than it is
worth.
This commit implements a proper store type for the simple repo -
one that isn't based off fncache.
This causes a number of new test failures because of tests
expecting the full fncache store filename encoding. I may
extend the store format in a subsequent commit to take the
filename encoding parts of fncache that we can take
(basically everything except hash encoding, since that isn't
reversible). But for now, let's use encoded store.
As part of this, we implement proper requirements support for
repos created with the simple store. This should have been
done from the beginning, as a requirement is needed to lock
out clients that don't understand a storage format.
A new hghave feature advertising the presence of fncache in repos
has been added. Most tests touching the fncache are now conditional
on that feature.
Other tests have added the optional repo requirement to output.
Differential Revision: https://phab.mercurial-scm.org/D3095
Joerg Sonnenberger <joerg@bec.de> [Tue, 27 Feb 2018 02:37:31 +0100] rev 37414
wireproto: allow direct stream processing for unbundle
Introduce a new option server.streamunbundle which starts a transaction
immediately to apply a bundle instead of writing it to a temporary file
first. This side steps the need for a large tmp directory at the cost of
preventing concurrent pushes. This is a reasonable trade-off for many
setups as concurrent pushes for the main branch at least are disallowed
anyway. The option defaults to off to preserve existing behavior.
Change the wireproto interface to provide a generator for reading the
payload and make callers responsible for consuming all data.
Differential Revision: https://phab.mercurial-scm.org/D2470
Joerg Sonnenberger <joerg@bec.de> [Fri, 06 Apr 2018 22:22:19 +0200] rev 37413
wireproto: send server capabilities in canonical order
Differential Revision: https://phab.mercurial-scm.org/D3171
Joerg Sonnenberger <joerg@bec.de> [Fri, 06 Apr 2018 22:16:11 +0200] rev 37412
wireproto: don't special case bundlecaps, but sort all scsv arguments
Differential Revision: https://phab.mercurial-scm.org/D3170
Joerg Sonnenberger <joerg@bec.de> [Fri, 06 Apr 2018 21:50:01 +0200] rev 37411
wireproto: turn client capabilities into sets, sorted on the wire
Differential Revision: https://phab.mercurial-scm.org/D3169
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 13:43:52 -0700] rev 37410
verify: drop "revlog" from warning message
Not all stores may be backed by revlogs. Switch to a more generic
error message.
Differential Revision: https://phab.mercurial-scm.org/D3094
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 10:16:08 -0700] rev 37409
store: make file filtering during walk configurable
Previously, the walking mechanism assumed the use of revlogs for
storage.
Making the file filter configurable will enable custom stores
to override _walk() so it recognizes additional files.
Differential Revision: https://phab.mercurial-scm.org/D3093
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 09:31:19 -0700] rev 37408
simplestore: shore up lookup errors
When revisions or nodes can't be resolved, we're expected to raise
an error.LookupError. When I ported code from revlog.py, I failed
to realize that "LookupError" in that module is aliased to
error.LookupError. I thought we were using the builtin LookupError
instead.
This commit switches us to error.LookupError. It also fixes
rev() to raise error.LookupError instead of KeyError.
Differential Revision: https://phab.mercurial-scm.org/D3092
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 09:57:21 -0700] rev 37407
tests: extract dumprevlog tests to own file
And mark the test as requiring the revlog store.
Differential Revision: https://phab.mercurial-scm.org/D3091
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 09:21:11 -0700] rev 37406
tests: skip test-censor.t when using simple store
Censor assumes the use of revlogs.
Proper censor support for non-revlog storage will require a better
abstraction in the storage layer to remove data. Let's skip the
censor tests until we have something in place.
Differential Revision: https://phab.mercurial-scm.org/D3090
Yuya Nishihara <yuya@tcha.org> [Mon, 02 Apr 2018 21:54:12 +0900] rev 37405
templater: deduplicate iterator of overlay mappings
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:01:23 +0900] rev 37404
templater: complain about invalid application of '%' operator (BC)
Before, '{x % y % z ...}' was silently evaluated as '{x % y}'. We no longer
need this hack since the web template bugs was fixed by earlier patches.
At this point, the error message may contain '<generator *>', which will
be fixed later.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:18:57 +0900] rev 37403
hgweb: fix type of {nav} keyword when linerange filter is active
Spotted by making '%' operator check the operand type more strictly. Before,
"{nav}" would be evaluated to a lazy "" (empty string) and {"" % x} would
yield one empty string.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:46:20 +0900] rev 37402
hgweb: fix {diff} expansion in JSON template
The same sort of bug as the previous patch. In this case, I decided to fix
the JSON template since we aren't ready to fix the {diff} keyword without BC.
I'll rework it later.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 21:35:43 +0900] rev 37401
hgweb: fix summary {tags} and {shortlog} to not forcibly expand template
The same sort of bug as the previous patch. In this case, JSON template was
wrong.
Yuya Nishihara <yuya@tcha.org> [Sun, 18 Mar 2018 20:51:39 +0900] rev 37400
hgweb: fix search {entries} to not return results of template expansion
"{entries%changelogentry}" in raw/search.tmpl was utterly wrong because
"{entries}" here was a generator yielding results of template expansion.
That's why we have a weird hack in runmap(), which I'm going to get rid of.
https://www.mercurial-scm.org/repo/hg/file/4.5.2/mercurial/templater.py#l469
We have two choices:
a) drop "%changelogentry" from raw/search.tmpl
b) fix "{entries}" to yield mappings
I take (b) because that's what the other log-like "{entries}" do. The
"entries" keyword is wrapped by mappinggenerator so "{entries}" without
"%searchentry" still works.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:47:02 +0900] rev 37399
templater: add class representing a nested mappings
The mappinggenerator class is necessary to fix hgweb bugs without BC. The
mappinglist is for nested formatter items. They are similar, so factored
out the base class. The mappinglist could be implemented by using the
mappinggenerator, but we'll probably need a direct access to the raw list,
so they are implemented as separate classes.
Note that tovalue() isn't conforming to the spec yet in that it may return
a list of dicts containing unprintable resources. This problem will be
fixed later.
Tests will be added by subsequent patches.
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Mar 2018 22:56:49 +0900] rev 37398
templater: add function that expands internal literal templates
This will be used when rendering nested formatter items with the default
template, e.g.
fm.nested('parents', tmpl='{rev}:{node|formatnode}', sep=' ')
^^^^^^^^^^^^^^^^^^^^^^^
the default item template
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 11:28:26 -0700] rev 37397
bookmarks: use isrevsymbol() for detecting collision with existing symbol
Differential Revision: https://phab.mercurial-scm.org/D3167
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 11:26:50 -0700] rev 37396
debugwhyunstable: add support for revsets
Differential Revision: https://phab.mercurial-scm.org/D3166
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 10:46:24 -0700] rev 37395
convert: look up branch only among branches
repo[<branch name>] can find something that's not a branch, which is
not good.
Differential Revision: https://phab.mercurial-scm.org/D3161
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 16:10:52 -0700] rev 37394
convert: remove unused/unnecessary variable "parentctx"
Differential Revision: https://phab.mercurial-scm.org/D3160
Joerg Sonnenberger <joerg@bec.de> [Sat, 24 Mar 2018 17:57:22 +0100] rev 37393
wireproto: provide accessors for client capabilities
For HTTP, this refactors the existing logic, including the parsing of
the compression engine capability.
For SSH, this adds a ssh-only capability "protocaps" and a command for
informing the server on what the client supports. Since SSH is stateful,
keep track of the capabilities in the server instance.
Differential Revision: https://phab.mercurial-scm.org/D1944
Gábor Stefanik <gabor.stefanik@nng.com> [Thu, 05 Apr 2018 17:51:10 +0200] rev 37392
copies: clean up _related logic
The limit parameter was never actually used, since the only way the 4th case
could be reached was if f1r and f2r converged. The new code makes this clear,
and additionally reduces the conditional block to just 3 cases.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 09:34:44 -0700] rev 37391
context: stop catching RepoLookupError from namespace.singlenode()
As pointed out by Yuya, the RepoLookupError was there for catching
errors from repo.branchtip(). However, since
885c0290f7d5 (localrepo:
add ignoremissing parameter to branchtip, 2014-10-16), that should no
longer happen. I think it should now be an error if a namespace raises
a RepoLookupError, so we propagate the exception up and and make it
easy to fix, rather than trying to interpret the changeid as nodeid
prefix and raise a general "unknown revision '...'" error.
I also don't think we should catch FilteredLookupError and LookupError
from the changelog.rev() call, for the same reason as above: If a
namespace returns a node that doesn't exist, we should provide a more
helpful exception than "unknown revision '...'".
Differential Revision: https://phab.mercurial-scm.org/D3145
Boris Feld <boris.feld@octobus.net> [Thu, 05 Apr 2018 18:02:42 +0200] rev 37390
histedit: simplify desthistedit
Instead of sorting the revset and take the first one, take the minimum
revision.
Differential Revision: https://phab.mercurial-scm.org/D3137
Boris Feld <boris.feld@octobus.net> [Thu, 05 Apr 2018 17:58:58 +0200] rev 37389
stack: follow-up on the stack revset
Follow good-practice for defining the stack revset.
Differential Revision: https://phab.mercurial-scm.org/D3136
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 23:23:48 -0700] rev 37388
githelp: use revsymbol() for looking up symbol
I don't know if we should be using revsingle() here, so I was
conservative and switched to revsymbol().
Differential Revision: https://phab.mercurial-scm.org/D3156
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 21:32:59 -0700] rev 37387
hgweb: use revsymbol() to determine if query is a revision
repo.__getitem__ is about to get dumber.
Differential Revision: https://phab.mercurial-scm.org/D3155
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 14:03:33 -0700] rev 37386
context: make repo[<filtered binary nodeid>] match node
If you pass in a binary nodeid of a filtered node to repo.__getitem__,
it would run through this code:
try:
self._node = changeid
self._rev = repo.changelog.rev(changeid)
return
except error.FilteredLookupError:
raise
except LookupError:
pass
However, repo.changelog.rev() would raise a FilteredLookupError, not
FilteredRepoLookupError. Instead, we would hit the "except
LookupError" and continue, trying to interpret the nodeid as a
bookmark etc. The end result would be an error like this:
abort: unknown revision '
ddadbd7c40ef8b8ad6d0d01a7a842092fc431798'!
After this patch, it would instead be:
abort: 00changelog.i@
ddadbd7c40ef8b8ad6d0d01a7a842092fc431798: filtered node!
This only happens when we get a binary nodeid, which means it's not
string directly from the user, so it would be a programming error if
it happened. It's therefore a little hard to test (I checked
test-context.py, but it doesn't use obsmarkers).
It looks like this has been wrong ever since
dc25ed84bee8 (changectx:
issue a FilteredRepoLookupError when applicable, 2014-10-15).
Differential Revision: https://phab.mercurial-scm.org/D3144
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 00:04:09 -0700] rev 37385
context: move handling of filtering error to revsymbol() (API)
When changectx's constructor runs into various Filtered*Error, it
creates an exception with a hint about using --hidden. This only makes
sense when the revision was provided by the user (if we get e.g. a
FilteredLookupError from repo[p1], then it's instead a programming
error). Thus, I'm moving the handling into revsymbol(). Also changed
"unfilteredrepo[changeid]" to "revsymbol(unfilteredrepo, changeid)" as
part of the move.
Differential Revision: https://phab.mercurial-scm.org/D3143
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:56:24 +0530] rev 37384
py3: whitelist 13 new passing tests
Some tests were passing before the series too.
Differential Revision: https://phab.mercurial-scm.org/D3133
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:47:44 +0530] rev 37383
py3: convert user value to bytes by b'' prefix
This makes test-journal* pass on Python 3.5.
# skip-blame beacuse just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D3125
Augie Fackler <augie@google.com> [Thu, 05 Apr 2018 10:13:01 -0400] rev 37382
util: whitelist apfs for hardlink support
Seems to work fine for me.
Differential Revision: https://phab.mercurial-scm.org/D3134
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 11:33:36 -0700] rev 37381
mq: avoid a silly conversion from binary nodeid to hex
We generally deal with binary nodeids in code. In this case the hex
nodeid was passed to strip.checksubstate() where it was passed to
repo.__getitem__, which of course accepts a binary nodeid.
Differential Revision: https://phab.mercurial-scm.org/D3141
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 12:36:44 -0700] rev 37380
narrow: remove unused "cacheprop" stuff
This is unused since D3046. I didn't even notice it then, but tests
still pass so I hope it's still handled safely.
Differential Revision: https://phab.mercurial-scm.org/D3142
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 14:11:43 -0700] rev 37379
tests: disable infinitepush tests for simple store
Infinitepush relies heavily on bundles and bundlerepo. As such,
it won't be easy to make compatible with alternate storage
backends at this time.
Let's disable the tests when running with our simple store.
Differential Revision: https://phab.mercurial-scm.org/D3062
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 11:01:42 -0700] rev 37378
rebase: remove unnecessary and incorrect handling of nullid
We used to write a nullid as hex to the rebase state file and
interpret it as the "todo" state (value -1). However, when reading it,
we compared the string value to (binary) nullid, which would of course
not match. AFAICT, it still worked because when the read nodeid did
not match nullid (which, again, it didn't), we'd use the normal path
which did repo[<hex nullid>].rev(), and that also happens to return
-1. It seems to have been this way ever since
9972758ab4c5 (rebase:
handle revtodo as a special value when storing/restoring state,
2014-12-02).
Differential Revision: https://phab.mercurial-scm.org/D3140
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 10:13:45 -0700] rev 37377
rebase: convert "oldrev" to revnum earlier
It was done in 3 places before, now just 1.
Differential Revision: https://phab.mercurial-scm.org/D3139
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 10:12:10 -0700] rev 37376
rebase: make "destnode" consistently a revnum and rename it to "destrev"
Differential Revision: https://phab.mercurial-scm.org/D3138
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 08:28:12 -0700] rev 37375
bookmarks: drop always-None argument from calculateupdate()
Thanks to Yuya for noticing.
Differential Revision: https://phab.mercurial-scm.org/D3135
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 09:58:16 -0700] rev 37374
narrow: move manifestlog overrides to core
With this and the previous patch, I couldn't measure any significant
difference from `hg files -r .` in a FireFox repo with 65k files. I
tried with both a flat-manifest and a tree-manifest version of
it. Neither had the narrow extension enabled.
Differential Revision: https://phab.mercurial-scm.org/D3046
Martin von Zweigbergk <martinvonz@google.com> [Mon, 02 Apr 2018 23:46:04 -0700] rev 37373
narrow: move manifestrevlog overrides to core
Differential Revision: https://phab.mercurial-scm.org/D3045
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 00:13:02 -0700] rev 37372
narrow: move excludeddir and related classes to core
Differential Revision: https://phab.mercurial-scm.org/D3044
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:29:32 +0530] rev 37371
py3: add missing b'' prefix in mdiff.py
Transformer won't add b'' prefix because that value is already have a r''
prefix.
# skip-blame because just b'' prefix
Differential Revision: https://phab.mercurial-scm.org/D3132
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:15:52 +0530] rev 37370
py3: fix error string with bytestr() on repr()d value
Differential Revision: https://phab.mercurial-scm.org/D3131
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:14:11 +0530] rev 37369
py3: suppress output from f.write() function class
We need to suppress them because the output is not present on Python 2
Differential Revision: https://phab.mercurial-scm.org/D3130
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:13:09 +0530] rev 37368
py3: use pycompat.byteskwargs() in tests/autodiff.py
Differential Revision: https://phab.mercurial-scm.org/D3129
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 17:00:15 +0530] rev 37367
py3: suppress the output of open() using `and None`
This patch suppresses the output of open() on Python 3 as it does not return any
output on Python 2.
This makes test-diffstat.t pass on Python 3.5
Differential Revision: https://phab.mercurial-scm.org/D3128
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:56:34 +0530] rev 37366
py3: return bytes from util.removeauth()
util.hidepassword() also returns bytes and we should deal in bytes as much as
possible.
This makes test-logexchange.t pass on Python 3.5
Differential Revision: https://phab.mercurial-scm.org/D3127
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:54:56 +0530] rev 37365
py3: use bytes instead of str in instance()
We deal internally with bytes, so we should check whether the remote is a bytes
or not.
Differential Revision: https://phab.mercurial-scm.org/D3126
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 05 Apr 2018 16:46:34 +0530] rev 37364
py3: use pycompat.bytestr in test-journal.t
Differential Revision: https://phab.mercurial-scm.org/D3124
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 23:55:47 -0700] rev 37363
hgweb: don't include hidden revisions in /filelog/ view
This is a very crude way of doing it, but it seems to be working well
enough. The number of entries on the page won't be the usual maximum
number per page, but this is good enough for me.
Differential Revision: https://phab.mercurial-scm.org/D3122
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 00:00:48 -0700] rev 37362
tests: show that hgweb contains hidden revisions in /filelog/ view
Note that these entries contain the summary line of the hidden commit,
which is a bit a privacy issue to display. Also note that the links
from the entries take you to a page that says:
An error occurred while processing your request:
filtered revision '
2d32257e1109' (not in 'served' subset)
Differential Revision: https://phab.mercurial-scm.org/D3121
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 09:03:17 -0700] rev 37361
convert: use repo.lookup() for converting to nodeid
This is a list of revs that come from the CLI (opts['rev']). Perhaps
we should allow any revset, but I'll leave that for someone else to
improve if they care.
Differential Revision: https://phab.mercurial-scm.org/D3089
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 22:36:21 -0700] rev 37360
extdatasource: use revsymbol() for converting to node
It's unclear what we want to support here. Perhaps it should just be
nodeids? It doesn't make much sense to share revnums between repos,
and bookmarks are probably too unstable. I used scmutil.revsymbol() to
preserve the current behavior. We can change later if we want to.
Differential Revision: https://phab.mercurial-scm.org/D3088
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:13:32 -0700] rev 37359
bookmarks: calculateupdate() returns a bookmark, not a rev
This changes the inaccurate/unclear documentation and also changes the
code so "node" now contains a binary nodeid.
Differential Revision: https://phab.mercurial-scm.org/D3087
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 10:13:08 -0700] rev 37358
pull: pass rev to check out as integer to postincoming()
I don't know if there's ever been a need for it to be a string (it's
been like that since
02f40b2ece3f (commands: use rev from remote repo
when updating as part of a pull, 2009-10-21)). I'm soon going to
require it to be an integer, so let's fix this first.
Differential Revision: https://phab.mercurial-scm.org/D3086
Martin von Zweigbergk <martinvonz@google.com> [Thu, 05 Apr 2018 14:21:37 +0530] rev 37357
children: support specifying revision by revset
Same reason as the previous patch.
Differential Revision: https://phab.mercurial-scm.org/D3085
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:08:26 -0700] rev 37356
heads: add support for specifying branches by revset
Before this commit, e.g. "hg heads .^" would fail with:
abort: unknown revision '.^'!
Like the previous patch, I don't care about the command itself (I
don't think I had ever used it before), I'm just cleaning up uses of
repo[<string>].
Differential Revision: https://phab.mercurial-scm.org/D3084
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:06:32 -0700] rev 37355
perf: make perfmanifest and perfnodelookup work with revsets
They were using repo[rev], which only works with a single symbol
(e.g. "." or "my-bookmark"), not general revsets. Switch them to
scmutil.revsingle() so they can also be used with e.g. ".^".
I don't actually care about these commands, but I want to remove uses
of repo[<string>].
Differential Revision: https://phab.mercurial-scm.org/D3083
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 23:47:01 -0700] rev 37354
context: use revsymbol() in "merge.preferancestor" code
Differential Revision: https://phab.mercurial-scm.org/D3082
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 15:11:43 -0700] rev 37353
wireproto: use repo.lookup() for lookup command
I'm trying to reduce use of repo[<string>] and this seems like an
obvious place to use repo.lookup().
Differential Revision: https://phab.mercurial-scm.org/D3081
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 14:57:58 -0700] rev 37352
localrepo: use revsymbol in lookupbranch() too
lookupbranch() takes a string that comes from the CLI, so
scmutil.revsymbol() is appropriate for looking it up.
Differential Revision: https://phab.mercurial-scm.org/D3080
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 14:31:09 -0700] rev 37351
localrepo: drop "remote" argument from lookupbranch() (API)
According to `hg grep --all lookupbranch`, the "remote" argument has
never been used ever since it was introduced in
ca739acf1a98
(commands: add more robust support for 'hg log -b' (
issue2078),
2010-04-12).
Differential Revision: https://phab.mercurial-scm.org/D3079
Martin von Zweigbergk <martinvonz@google.com> [Sun, 01 Apr 2018 22:48:32 -0700] rev 37350
revset: use revsymbol() for checking if a symbol is valid
Differential Revision: https://phab.mercurial-scm.org/D3078
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 15:08:14 -0700] rev 37349
tests: disable tests for advanced clone features with simple store
There are a handful of test failures in the simple store with
regards to stream clones. Fixing them will require a lot of
conditional output. Disabling the tests wholesale is easier
at this juncture.
Differential Revision: https://phab.mercurial-scm.org/D3064
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 14:24:14 -0700] rev 37348
tests: skip largefiles and lfs tests when using simple store
Getting these tests to pass is more work than it is worth right
now. Let's punt on it.
Differential Revision: https://phab.mercurial-scm.org/D3063
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:23:33 -0700] rev 37347
tests: conditionalize test output for simple store
Differential Revision: https://phab.mercurial-scm.org/D3061
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:44:38 -0700] rev 37346
tests: disallow using simple store repo with bundlerepo
bundlerepo is... going to be difficult to port to an alternate
store because it assumes revlogs for storage and essentially
overlays the contents of a bundle onto a fake revlog-like
primitive. It will be a good test case for our eventual new
storage interface.
Refactoring bundlerepo to make it work with non-revlog storage is
going to be a bit of work. So for now, let's refuse to use the
simple store repo when a bundlerepo is in play.
A new test requirement advertising support for treating bundle
files as repo instances has been added. Some tests have been
made conditional on this feature. Additional tests will be
annotated in subsequent commits.
Having positive opt-in to repo features will be simpler in the
long run because it will allow multiple storage backends to
declare feature support and we won't have to annotate each test
with the set of repo backends that are supported. Again, we'll
probably want better integration between repo features and
tests. But this is the easiest we can do at the moment.
Differential Revision: https://phab.mercurial-scm.org/D3060
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:31:35 -0700] rev 37345
tests: disable test-revlog-v2 when using simple store
Because the simple store has nothing to do with revlogs.
Differential Revision: https://phab.mercurial-scm.org/D3056
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:16:04 -0700] rev 37344
tests: skip filelog damage tests when not using revlogs
Differential Revision: https://phab.mercurial-scm.org/D3042
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 10:04:30 -0700] rev 37343
tests: skip some tests when using simple store
generaldelta is a revlog implementation detail. We don't need to
test it with the simple store.
union repos are heavily revlog based. It should be possible to
run them with alternate stores. But it's not worth the trouble
at this juncture.
Differential Revision: https://phab.mercurial-scm.org/D3040
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 13:21:34 -0700] rev 37342
tests: conditionalize tests based on presence of custom extensions
The test harness supports injecting extensions via --extra-config-opt.
However, if you do this, various tests that print state about loaded
extensions fail.
This commit teaches the test harness to recognize when custom
extensions are loaded so that tests can use feature sniffing to
conditionalize tests based on that.
Differential Revision: https://phab.mercurial-scm.org/D3039
Augie Fackler <augie@google.com> [Wed, 04 Apr 2018 12:16:50 -0700] rev 37341
simplestorerepo: avoid shadowing dict in list comprehension over dict
Caught by pyflakes.
Differential Revision: https://phab.mercurial-scm.org/D3077
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 09:54:20 -0700] rev 37340
narrow: pass node into revlog.revision()
This is one of the few (possibly only) places where we pass an int in
for filelogs. Other revlogs (notably changelog) are very heavy on int
usage. But filelogs are surprisingly node centric. I'd like to
formalize the interface around the use of nodes (at least for
filelogs). So let's switch to a node.
We can't inline revlog.node() because of a check-code rule. I think
that rule is suspect. But it may be for performance reasons with
changelog code. I'd rather not touch it at this time.
Differential Revision: https://phab.mercurial-scm.org/D3043
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 10:15:21 -0700] rev 37339
changegroup: remove "revlog" from error message
The previous message leaked an implementation detail.
Differential Revision: https://phab.mercurial-scm.org/D3041
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 18:15:24 -0700] rev 37338
tests: conditionalize tests based on presence of revlogs for files
~85 tests don't like our non-revlog file store for various reasons.
This commit introduces hghave functionality for declaring and querying
repository features. By default, we assume repositories have
revlog-based file storage. But if the HGREPOFEATURES environment
variable is set, we can override the default set of repository
features. If you run the test harness with our simplestorerepo
extension and an environment variable set to the proper value, you
can override the hghave defaults to agree with simplestorerepo's
version of reality.
Various tests have been modified so behavior dependent on revlog-based
file storage is marked as such.
This fixes a handful of test failures with our custom file storage
extension. But dozens remain. The point of this commit is to demonstrate
how tests will need to be modified to account for custom storage
implementations.
TBH, I'm not convinced hghave is the proper layer for repository
feature detection. I /think/ we'll eventually want something in
run-tests.py itself. But that would require inventing a new primitive
in the test harness. This is all very alpha at the moment. So I think
hghave is an acceptable place to hang this feature detection. I think
the right time to be thinking about integrating this into run-tests.py
is *after* we have a stable alternate storage implementation in core.
For now, let's try to make progress towards the idea of an alternate
storage backend.
Differential Revision: https://phab.mercurial-scm.org/D3030
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 04 Apr 2018 11:37:07 -0700] rev 37337
tests: add test extension implementing custom filelog storage
In order to better support partial clones, we'll need alternate
repository storage mechanisms that aren't based on revlogs.
Today, the interface for repository storage isn't very well defined.
And there are various layering violations and assumptions made
throughout the code that storage is backed by revlogs.
In order to support alternate storage mechanisms, we'll need to
formally declare and adhere to interfaces for storage. This will
be a long, arduous process.
This commit creates an extension that implements non-revlog storage
for files. It defines a custom type that quacks like the existing
revlog/filelog API but isn't backed by a revlog. The backing storage
is - for simplicity reasons - a CBOR index and per-node files
representing fulltext data.
The localrepository class is modified so file(f) returns instances of
this class instead of filelog instances.
The purpose of this extension is to tease out what the actual filelog
interface is - based on running the test harness - so we can formalize
that interface and then implement a *real* alternate storage backend.
Using `run-tests.py --extra-config-opt` to run the test harness
with this extension enabled yields 83 failures out of 634 ran
tests.
The most common test failures are due to:
* Issues with `hg verify`
* LFS and largefiles (probably flags processing related)
* Narrow.
* Any test touching or inspecting individual filelog paths.
* help and error output that is confused by the presence of an
extension.
* `hg debug*` commands doing low-level, revlog-y things.
An 88% pass rate is pretty good for an initial implementation if you
ask me!
There is a bit of duplicate code in the new extension. That's by
design: a point of this code is to tease out dependencies on revlog.
That being said, there is opportunity to consolidate code by moving
things out of the revlog API. For example, DAG traversal operations
don't necessarily need to be implemented at the storage level. (Although
for performance reasons they probably do.) Once we have a more
well-defined interface, we could probably define the default
implementations in terms of the base interface, pull those in via
class inheritance, and have implementations override with faster
versions if they so choose. (Or something like that.) But for now,
the duplicate code should be acceptable.
Differential Revision: https://phab.mercurial-scm.org/D3029
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 03 Apr 2018 13:56:09 -0700] rev 37336
tests: use `hg unbundle` instead of `hg pull` in some tests
`hg pull <bundle>` uses the special "bundlerepo" repository. The
bundlerepo code makes many assumptions about the storage of
repositories. It will be difficult to teach bundlerepo to use
non-revlog storage before a better storage interface is established.
Many test failures using our "simple store" are related to
bundlerepo: the simple store just isn't compatible with bundlerepo
because of storage assumptions in bundlerepo.
In order to mitigate the impact of bundlerepo on our code base,
this commit changes various tests to use `hg unbundle` instead
of `hg pull`. This bypasses the bundlerepo code.
Tests exercising exchange functionality have not been altered, as
they should be using `hg pull` and going through the bundlerepo
code paths.
Differential Revision: https://phab.mercurial-scm.org/D3059
Martin von Zweigbergk <martinvonz@google.com> [Wed, 04 Apr 2018 09:41:18 -0700] rev 37335
hgweb: use revsymbol() for creating context from changeid
These seem to be for looking up a revision that can come from the
user, so revsymbol() is the right method to call (
0194dac7 has more
information about my plans for repo[x]).
Differential Revision: https://phab.mercurial-scm.org/D3075
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 23:00:41 -0700] rev 37334
hgweb: inline changeidctx()
Differential Revision: https://phab.mercurial-scm.org/D3074
Martin von Zweigbergk <martinvonz@google.com> [Tue, 03 Apr 2018 21:50:42 -0700] rev 37333
hgweb: drop support for "manifest" parameter
AFAICT (but note that this is the first time I look at hgweb code),
the "mercurial" query parameter was removed from rendered pages in
36fa5db79dd5 (hgweb: convert gitweb to NWI, 2006-10-05). Search for
"manifest=" in that diff to see why I think it was removed. It's about
time we stop looking for the parameter in requests.
Differential Revision: https://phab.mercurial-scm.org/D3073