- Aug 07, 2016
-
-
Yuya Nishihara authored
MemoryError is handled differently in dispatch._runcatch(). Since mpatch_errors[] isn't that useful now, I've changed it to a simple switch statement.
-
- Aug 08, 2016
-
-
Gregory Szorc authored
Before this patch, the HTTP transport protocol would always zlib compress certain responses (notably "getbundle" wire protocol commands) at zlib compression level 6. zlib can be a massive CPU resource sink for servers. Some server operators may wish to reduce server-side CPU requirements while requiring more bandwidth. This is common on corporate intranets, for example. Others may wish to use more CPU but reduce bandwidth. This patch introduces a config option to allow server operators to control the zlib compression level. On the "mozilla-unified" generaldelta repository, setting this value to "0" (disable compression) results in server-side CPU utilization for a `hg clone` going from ~180s to ~124s CPU time on my i7-6700K. A level of "1" (which increases the transfer size from ~1,074 MB at level 6 to ~1,222 MB) utilizes ~132s CPU time.
-
- Aug 07, 2016
-
-
Gregory Szorc authored
This patch subtly changes the behavior of the parsing of "X.Y" values to not set the "section" variable when rendering a known sub-topic. Previously, "section" would be the same as the sub-topic name. This required the sub-topic RST to have a section named the same as the sub-topic name. When I made this change, the descriptions from help.internalstable started being rendered in command line output. This didn't look correct to me, as it didn't match the formatting of main help pages. I corrected this by moving the top section to help.internalstable and changing the section levels of all the "internals" topics. The end result is that "internals" topics now match the rendering of main topics on both the CLI and HTML. And, "internals" topics no longer require a main section matching the name of the topic.
-
- Aug 05, 2016
-
-
Pierre-Yves David authored
This clean up the rest of the previous changeset.
-
Pierre-Yves David authored
Now that we have a general try except, we can move the error handling from the individual writes in it. Code will be reindented in the next changeset to help this on readability.
-
Pierre-Yves David authored
We now attempt to acquire a lock and write the branch cache within that lock. This would prevent cache corruption when multiple processes try to write the cache at the same time.
-
Pierre-Yves David authored
The rev branch cache is written without a lock, we are going to fix this but we indent the code beforehand to make the next changeset clearer.
-
- Aug 07, 2016
-
-
Yuya Nishihara authored
It's false positive, but it wouldn't be possible for gcc to know PyBytes_FromStringAndSize() sets PyErr_Occurred(). mercurial/mpatch_module.c:105:47: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized] PyErr_SetString(mpatch_Error, mpatch_errors[-r]);
-
Yuya Nishihara authored
It was mistakenly made public at b9b9f9a92481.
-
Yuya Nishihara authored
-
Hannes Oldenburg authored
Subrepo logic is handled in ctx.walk().
-
- Aug 05, 2016
-
-
Pierre-Yves David authored
The static http repository are read only, there is no hope in any cache writing attempt.
-
- Aug 06, 2016
-
-
Katsunori FUJIWARA authored
This makes construction of _demandmod require explicit level value, and helps to avoid issues like issue5208 in the future.
-
Katsunori FUJIWARA authored
Before this patch, importing sub-module might (1) fail or (2) success but import incorrect module, because demandimport tries to import sub-module with level=-1 (on Python 2.x) or level=0 (on Python 3.x), which is default value of "level" argument at construction of "_demandmod" proxy object. (1) on Python 3.x, importing sub-module always fails to import existing sub-module (2) both on Python 2.x and 3.x, importing sub-module might import same name module on root level unintentionally On Python 2.x, existing sub-module is prior to this unexpected module. Therefore, this problem hasn't appeared. To import sub-module relatively as expected, this patch specifies "1" as import level explicitly at construction of "_demandmod" proxy object for sub-module.
-
Gregory Szorc authored
This variable has been unused since ce25f465e572, which was over 2 years ago. gboptsmap should be used instead. Marking as API because this could break extensions.
-
Gregory Szorc authored
Clients escape both argument names and values when using the batch command. Yet the server was only unescaping argument values. Fortunately we don't have any argument names that need escaped. But that isn't an excuse to lack symmetry in the code. Since the server wasn't properly unescaping argument names, this means we can never introduce an argument to a batchable command that needs escaped because an old server wouldn't properly decode its name. So we've introduced an assertion to detect the accidental introduction of this in the future. Of course, we could introduce a server capability that says the server knows how to decode argument names and allow special argument names to go through. But until there is a need for it (which I doubt there will be), we shouldn't bother with adding an unused capability.
-
Gregory Szorc authored
Both wireproto.py and sshpeer.py had code for producing the value to the "cmds" argument used by the "batch" command. This patch extracts that code to a standalone function and uses it.
-
- Aug 05, 2016
-
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
Augie Fackler authored
This is functionally equivalent, but is a little more concise.
-
- Jul 27, 2016
-
-
Yuya Nishihara authored
Otherwise, the whole paragraph wouldn't be translated.
-
Yuya Nishihara authored
-
Yuya Nishihara authored
This allows us to collect __doc__ for translation.
-
Yuya Nishihara authored
Before, func must be a function object. I want to make it parse docstring of classes, too.
-
- Aug 05, 2016
-
-
Yuya Nishihara authored
hgc->sockfd is a blocking stream socket. recv() should never return 0 other than EOF. See 4fc4b8cc9957 for the original problem.
-
- Aug 04, 2016
-
-
Pierre-Yves David authored
The current open method is currently behaving like a property cache. We use our utility decorator to make this explicit.
-
- Aug 05, 2016
-
-
Augie Fackler authored
It seems reasonable to give cffi functions slightly more verbose names in some circumstances, given the way they interface with C.
-
Augie Fackler authored
This is a little messier than I'd like, and I'll probably come back and do some more refactoring later, but as it is this unblocks narrowhg. An alternative approach (which I may do as part of the mentioned refactoring) would be to construct *all* dirlog instances up front, so that we don't have to keep track of the linkmapper method. This would avoid a reference cycle between the bundlemanifest and the bundlerepository, but I was hesitant to do all the work up front like that. With this change, it's possible to do 'hg incoming' and 'hg pull' from bundles in .hg/strip-backup in a treemanifest repository. Sadly, this doesn't make it possible to 'hg clone' one of those (if you do 'hg strip 0'), because the cg3 in the bundle gets written without a treemanifest flag. Since that's going to be an involved refactor in a different part of the code (which I *suspect* won't touch any of the code I've just written here), let's leave it as an idea for Later.
-
Augie Fackler authored
This was breaking my ability to use treemanifests in bundlerepos, and was deeply mysterious. We should probably just make the options property a formal part of the vfs API, and make it a required construction parameter. Sadly, I don't have time to dive into that refactor right now.
-
- Aug 04, 2016
-
-
Augie Fackler authored
Since bundlerepo is really a pull-like operation, this is the correct method to use here.
-
- Aug 05, 2016
-
-
Augie Fackler authored
This moves us to the modern iter() technique instead of the `while True` pattern since it's easy. Factored out as a function because I'm about to need this in a second place.
-
Augie Fackler authored
The iter() builtin has a neat pattern where you give it a callable of no arguments and a sentinel value, and you can then loop over the function calls like a normal iterator. This cleans up the code a little.
-
Augie Fackler authored
The iter() builtin has a neat pattern where you give it a callable of no arguments and a sentinel value, and you can then loop over the function calls like a normal iterator. This cleans up the code a little.
-
Augie Fackler authored
-