- Apr 04, 2018
-
-
Gregory Szorc authored
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
-
- Feb 27, 2018
-
-
Jörg Sonnenberger authored
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
-
- Apr 06, 2018
-
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D3171
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D3170
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D3169
-
- Apr 04, 2018
-
-
Gregory Szorc authored
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 authored
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 authored
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 authored
And mark the test as requiring the revlog store. Differential Revision: https://phab.mercurial-scm.org/D3091
-
Gregory Szorc authored
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
-
- Apr 02, 2018
-
-
Yuya Nishihara authored
-
- Mar 18, 2018
-
-
Yuya Nishihara authored
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 authored
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 authored
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 authored
The same sort of bug as the previous patch. In this case, JSON template was wrong.
-
Yuya Nishihara authored
"{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.
-
- Mar 17, 2018
-
-
Yuya Nishihara authored
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 authored
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
-
- Apr 06, 2018
-
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3167
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3166
-
Martin von Zweigbergk authored
repo[<branch name>] can find something that's not a branch, which is not good. Differential Revision: https://phab.mercurial-scm.org/D3161
-
- Apr 05, 2018
-
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3160
-
- Mar 24, 2018
-
-
Jörg Sonnenberger authored
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
-
- Apr 05, 2018
-
-
Gábor Stefanik authored
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.
-
- Apr 06, 2018
-
-
Martin von Zweigbergk authored
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
-
- Apr 05, 2018
-
-
Boris Feld authored
Instead of sorting the revset and take the first one, take the minimum revision. Differential Revision: https://phab.mercurial-scm.org/D3137
-
Boris Feld authored
Follow good-practice for defining the stack revset. Differential Revision: https://phab.mercurial-scm.org/D3136
-
- Apr 06, 2018
-
-
Martin von Zweigbergk authored
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 authored
repo.__getitem__ is about to get dumber. Differential Revision: https://phab.mercurial-scm.org/D3155
-
- Apr 05, 2018
-
-
Martin von Zweigbergk authored
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 authored
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 authored
Some tests were passing before the series too. Differential Revision: https://phab.mercurial-scm.org/D3133
-
Pulkit Goyal authored
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 authored
Seems to work fine for me. Differential Revision: https://phab.mercurial-scm.org/D3134
-
Martin von Zweigbergk authored
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 authored
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
-
- Apr 03, 2018
-
-
Gregory Szorc authored
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
-
- Apr 05, 2018
-
-
Martin von Zweigbergk authored
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 authored
It was done in 3 places before, now just 1. Differential Revision: https://phab.mercurial-scm.org/D3139
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3138
-