Sun, 11 Jan 2015 01:32:36 +0100 localrepo: remove all internal uses of localrepo.wopener
Angel Ezquerra <angel.ezquerra@gmail.com> [Sun, 11 Jan 2015 01:32:36 +0100] rev 23854
localrepo: remove all internal uses of localrepo.wopener It has been replaced with localrepo.wvfs.
Sun, 11 Jan 2015 00:21:58 +0100 localrepo: remove all internal uses of localrepo.sopener
Angel Ezquerra <angel.ezquerra@gmail.com> [Sun, 11 Jan 2015 00:21:58 +0100] rev 23853
localrepo: remove all internal uses of localrepo.sopener It has been replaced with localrepo.svfs.
Sat, 10 Jan 2015 23:02:52 +0100 localrepo: remove all internal uses of localrepo.opener
Angel Ezquerra <angel.ezquerra@gmail.com> [Sat, 10 Jan 2015 23:02:52 +0100] rev 23852
localrepo: remove all internal uses of localrepo.opener It has been replaced with localrepo.vfs. In the future we may split the vfs into different vfs objects to access different elements of the repository.
Wed, 14 Jan 2015 15:46:21 -0500 sslutil: drop defunct ssl version constants
Augie Fackler <augie@google.com> [Wed, 14 Jan 2015 15:46:21 -0500] rev 23851
sslutil: drop defunct ssl version constants Nobody outside sslutil should be using these constants anyway.
Wed, 14 Jan 2015 15:46:00 -0500 sslutil: use saner TLS settings on Python 2.7.9
Augie Fackler <augie@google.com> [Wed, 14 Jan 2015 15:46:00 -0500] rev 23850
sslutil: use saner TLS settings on Python 2.7.9 Asking for TLSv1 locks us out of TLSv1_2 etc. This is at least less bad. Ideally we'd use ssl.create_default_context(), but that causes more mayhem in the testsuite than I really want to deal with right now.
Wed, 14 Jan 2015 15:31:16 -0500 sslutil: drop support for clients of sslutil specifying a TLS version
Augie Fackler <augie@google.com> [Wed, 14 Jan 2015 15:31:16 -0500] rev 23849
sslutil: drop support for clients of sslutil specifying a TLS version We really just want to support the newest thing possible, so we may as well consolidate that knowledge into this module. Right now this doesn't change any behavior, but a future change will fix the defaults for Python 2.7.9 so we can use slightly better defaults there (which is the only place it's possible at the moment.)
Wed, 07 Jan 2015 00:07:29 -0800 discovery: run discovery on filtered repository
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 00:07:29 -0800] rev 23848
discovery: run discovery on filtered repository We have been running discovery on unfiltered repository for quite some time. This was aimed at two things: - save some bandwith by prevent the repushing of common but hidden changesets - allow phases changes on secret/hidden changeset on bare push. The cost of this unfiltered discovery combined with evolution is actually really high. Evolution likely create thousand of hidden heads, and the discovery is going to try to discovery if each of them are common or not. For example, pushing from my development mercurial repository implies 17 discovery round-trip. The benefit are rare corner cases while the drawback are massive. So we run the discovery on a filtered repository again. We add some hack to detect remote heads that are known locally and adds them to the common set anyway, so the good behavior of most of the corner case should remains. But this will not work in all cases. This bring my discovery phase back from 17 round-trips to 1 or 2.
Sat, 10 Jan 2015 23:18:11 +0900 revset: check for collisions between alias argument names in the declaration
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23847
revset: check for collisions between alias argument names in the declaration Before this patch, collisions between alias argument names in the declaration are ignored, and this silently causes unexpected alias evaluation. This patch checks for such collisions, and aborts (or shows a warning) when collisions are detected. This patch doesn't add a test to "test-revset.t", because a doctest is enough to test the collisions detection itself.
Sat, 10 Jan 2015 23:18:11 +0900 revset: parse alias declaration strictly by _parsealiasdecl
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23846
revset: parse alias declaration strictly by _parsealiasdecl Before this patch, alias declaration is parsed by string base operations: matching against "^([^(]+)\(([^)]+)\)$" and splitting by ",". This overlooks many syntax errors like below (see the previous patch introducing "_parsealiasdecl" for detail): - un-closed parenthesis causes being treated as "alias symbol" - symbol/function name aren't examined whether they are valid or not - invalid argument list causes unexpected argument names To parse alias declaration strictly, this patch replaces parsing implementation by "_parsealiasdecl". This patch tests only one typical declaration error case, because error detection itself is already tested in the doctest of "_parsealiasdecl". This also removes class property "args" and "error", because these are certainly initialized in "revsetalias.__init__".
Sat, 10 Jan 2015 23:18:11 +0900 revset: introduce "_parsealiasdecl" to parse alias declarations strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23845
revset: introduce "_parsealiasdecl" to parse alias declarations strictly This patch introduces "_parsealiasdecl" to parse alias declarations strictly. For example, "_parsealiasdecl" can detect problems below, which current implementation can't. - un-closed parenthesis causes being treated as "alias symbol" because all of declarations not in "func(....)" style are recognized as "alias symbol". for example, "foo($1, $2" is treated as the alias symbol. - alias symbol/function names aren't examined whether they are valid as symbol or not for example, "foo bar" can be treated as the alias symbol, but of course such invalid symbol can't be referred in revset. - just splitting argument list by "," causes overlooking syntax problems in the declaration for example, all of invalid declarations below are overlooked: - foo("bar") => taking one argument named as '"bar"' - foo("unclosed) => taking one argument named as '"unclosed' - foo(bar::baz) => taking one argument named as 'bar::baz' - foo(bar($1)) => taking one argument named as 'bar($1)' To decrease complication of patch, current implementation for alias declarations is replaced by "_parsealiasdecl" in the subsequent patch. This patch just introduces it. This patch defines "_parsealiasdecl" not as a method of "revsetalias" class but as a one of "revset" module, because of ease of testing by doctest. This patch factors some helper functions for "tree" out, because: - direct accessing like "if tree[0] == 'func' and len(tree) > 1" decreases readability - subsequent patch (and also existing code paths, in the future) can use them for readability This patch also factors "_tokenizealias" out, because it can be used also for parsing alias definitions strictly.
Sat, 10 Jan 2015 23:18:11 +0900 revset: store full detail into revsetalias.error for error source distinction
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23844
revset: store full detail into revsetalias.error for error source distinction Before this patch, any errors in the declaration of revset alias aren't detected at all, and there is no information about error source in the error message. As a part of preparation for parsing alias declarations and definitions more strictly, this patch stores full detail into "revsetalias.error" for error source distinction. This makes raising "Abort" and warning potential errors just use "revsetalias.error" without any message composing.
Sat, 10 Jan 2015 23:18:11 +0900 revset: factor out composing error message for ParseError to reuse
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23843
revset: factor out composing error message for ParseError to reuse This patch defines the composing function not in "ParseError" class but in "revset" module, because: - "_()" shouldn't be used in "ParseError", to avoid adding "from i18n import _" i18n" to "error" module - generalizing message composition of"ParseError" for all code paths other than revset isn't the purpose of this patch we should also take care of showing "unexpected leading whitespace" for some code paths, to generalize widely.
Sat, 10 Jan 2015 23:18:11 +0900 revset: make tokenize extensible to parse alias declarations and definitions
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 10 Jan 2015 23:18:11 +0900] rev 23842
revset: make tokenize extensible to parse alias declarations and definitions Before this patch, "tokenize" doesn't recognize the symbol starting with "$" as a valid one. This prevents revset alias declarations and definitions from being parsed with "tokenize", because "$" may be used as the initial letter of alias arguments. BTW, the alias argument name doesn't require leading "$" itself, in fact. But we have to assume that users may use "$" as the initial letter of argument names in their aliases, because examples in "hg help revsets" uses such names for a long time. To make "tokenize" extensible to parse alias declarations and definitions, this patch introduces optional arguments "syminitletters" and "symletters". Giving these sets can change the policy of "valid symbol" in tokenization easily. This patch keeps original examination of letter validity for reviewability, even though there is redundant interchanging between "chr"/"ord" at initialization of "_syminitletters" and "_symletters". At most 256 times examination (per initialization) is cheaper enough than revset evaluation itself. This patch is a part of preparation for parsing alias declarations and definitions more strictly.
Fri, 09 Jan 2015 18:38:02 +0100 largefiles: make linear update set unsure largefiles normal if unchanged
Mads Kiilerich <madski@unity3d.com> [Fri, 09 Jan 2015 18:38:02 +0100] rev 23841
largefiles: make linear update set unsure largefiles normal if unchanged 'hg update' would hash all 'unsure' largefiles before performing the merge. It would update the standins but not detect the very common case where the largefile never had been changed by the user but just had been marked with an invalid dirstate mtime to make sure any changes done by the user in the same second would be detected. The largefile would remain in that state and would have to be hashed again next time even though it still not had been changed. Sad trombone. Instead, for largefiles listed as 'unsure' or 'modified', after updating the standin with the actual hash, mark the largefile as normal if it turns out to not be modified relative to the revision in the parent revision. That will prevent it from being hashed again next time.
Fri, 09 Jan 2015 18:38:02 +0100 debugdirstate: don't hide date field with --nodate, just show 'set'/'unset'
Mads Kiilerich <madski@unity3d.com> [Fri, 09 Jan 2015 18:38:02 +0100] rev 23840
debugdirstate: don't hide date field with --nodate, just show 'set'/'unset' The value of the dirstate date field cannot be used in tests and we thus have to use debugdirstate with --nodate. It is however still very helpful to be able to see whether the date field has been set or still is unset. The absence of that information made it hard to debug some largefile dirstate issues. This change _could_ make the test suite more unstable ... but that would be places where the test suite or the code should be made more stable. (Note: 'unset' with the magic negative sizes is reliable. 'unset' for normal sizes would probably not be reliable, but there is no such occurrences in the test suite and it should thus be reliable.) This output wastes more horizontal space in the --nodate output, but it also makes things simpler that the output format always is the same. It is just a debug command so let's keep it simple.
Fri, 09 Jan 2015 18:38:02 +0100 debugdirstate: simplify date handling after e7ed5d07cc4c used fixed format
Mads Kiilerich <madski@unity3d.com> [Fri, 09 Jan 2015 18:38:02 +0100] rev 23839
debugdirstate: simplify date handling after e7ed5d07cc4c used fixed format
Sun, 11 Jan 2015 23:25:23 -0500 forget: don't report rejected files as forgotten as well
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Jan 2015 23:25:23 -0500] rev 23838
forget: don't report rejected files as forgotten as well It seems like a mistake to report a file as forgotten and rejected. The forgotten list doesn't seem to be used by anything in core, so no test changes.
Sun, 11 Jan 2015 23:20:51 -0500 largefiles: enable subrepo support for forget
Matt Harbison <matt_harbison@yahoo.com> [Sun, 11 Jan 2015 23:20:51 -0500] rev 23837
largefiles: enable subrepo support for forget
Tue, 13 Jan 2015 15:07:08 -0800 namespaces: add revset for 'named(namespace)'
Sean Farley <sean.michael.farley@gmail.com> [Tue, 13 Jan 2015 15:07:08 -0800] rev 23836
namespaces: add revset for 'named(namespace)' This patch adds functionality for listing all changesets in a given namespace via the revset language.
Fri, 09 Jan 2015 10:52:14 -0800 bundles: do not overwrite existing backup bundles (BC)
Durham Goode <durham@fb.com> [Fri, 09 Jan 2015 10:52:14 -0800] rev 23835
bundles: do not overwrite existing backup bundles (BC) Previously, a backup bundle could overwrite an existing bundle and cause user data loss. For instance, if you have A<-B<-C and strip B, it produces backup bundle B-backup.hg. If you then hg pull -r B B-backup.hg and strip it again, it overwrites the existing B-backup.hg and C is lost. The fix is to add a hash of all the nodes inside that bundle to the filename. Fixed up existing tests and added a new test in test-strip.t
Mon, 12 Jan 2015 18:01:20 -0700 https: support tls sni (server name indication) for https urls (issue3090)
Alex Orange <crazycasta@gmail.com> [Mon, 12 Jan 2015 18:01:20 -0700] rev 23834
https: support tls sni (server name indication) for https urls (issue3090) SNI is a common way of sharing servers across multiple domains using separate SSL certificates. As of Python 2.7.9 SSLContext has been backported from Python 3. This patch changes sslutil's ssl_wrap_socket to use SSLContext and take a server hostname as and argument. It also changes the url module to make use of this argument. The new code for 2.7.9 achieves it's task by attempting to get the SSLContext object from the ssl module. If this fails the try/except goes back to what was there before with the exception that the ssl_wrap_socket functions take a server_hostname argument that doesn't get used. Assuming the SSLContext exists, the arguments to wrap_socket at the module level are emulated on the SSLContext. The SSLContext is initialized with the specified ssl_version. If certfile is not None load_cert_chain is called with certfile and keyfile. keyfile being None is not a problem, load_cert_chain will simply expect the private key to be in the certificate file. verify_mode is set to cert_reqs. If ca_certs is not None load_verify_locations is called with ca_certs as the cafile. Finally the wrap_socket method of the SSLContext is called with the socket and server hostname. Finally, this fails test-check-commit-hg.t because the "new" function ssl_wrap_socket has underscores in its names and underscores in its arguments. All the underscore identifiers are taken from the other functions and as such can't be changed to match naming conventions.
Wed, 14 Jan 2015 12:50:46 -0800 merge with stable
Matt Mackall <mpm@selenic.com> [Wed, 14 Jan 2015 12:50:46 -0800] rev 23833
merge with stable
Tue, 13 Jan 2015 16:15:02 -0800 unpacker: check the right exception type for 2.4
Matt Mackall <mpm@selenic.com> [Tue, 13 Jan 2015 16:15:02 -0800] rev 23832
unpacker: check the right exception type for 2.4
Sat, 10 Jan 2015 18:00:57 +0800 hgweb: fix diffstat links in paper/changeset.tmpl
Anton Shestakov <engored@ya.ru> [Sat, 10 Jan 2015 18:00:57 +0800] rev 23831
hgweb: fix diffstat links in paper/changeset.tmpl '<a .../>foo</a>' syntax is incorrect, since the first tag just "tries" to close itself and then the actual content follows. It doesn't work, either because web browsers know better than this or because there should be a whitespace before /: '<a />'. So for the hgweb users the links looked normal anyway, but now they are correct in code as well.
Sat, 10 Jan 2015 17:54:24 +0800 hgweb: close <img> elements
Anton Shestakov <engored@ya.ru> [Sat, 10 Jan 2015 17:54:24 +0800] rev 23830
hgweb: close <img> elements Templates declare xhtml doctype, which means, in particular, that the document must also be valid xml. So <img> elements must be closed.
Sat, 10 Jan 2015 17:52:02 +0800 hgweb: close <p> elements
Anton Shestakov <engored@ya.ru> [Sat, 10 Jan 2015 17:52:02 +0800] rev 23829
hgweb: close <p> elements <p> elements can only contain inline elements, so as soon as browser encounters a block element (e.g. block <div>) "inside" a <p>, it puts an implicit </p>. It's better to do this explicitly.
Sat, 10 Jan 2015 17:44:54 +0800 hgweb: close <th> properly in spartan/filelogentry.tmpl
Anton Shestakov <engored@ya.ru> [Sat, 10 Jan 2015 17:44:54 +0800] rev 23828
hgweb: close <th> properly in spartan/filelogentry.tmpl
Sat, 10 Jan 2015 21:36:42 +0900 revset: simplify fullreposet.__and__ to call sort() with boolean flag
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Jan 2015 21:36:42 +0900] rev 23827
revset: simplify fullreposet.__and__ to call sort() with boolean flag Note that sort() takes a boolean flag, so other.sort(reverse) was wrong. It just worked fine because there is a top-level function, reverse().
Sat, 10 Jan 2015 21:31:59 +0900 revset: fix spanset.isascending() to honor sort() or reverse() request stable
Yuya Nishihara <yuya@tcha.org> [Sat, 10 Jan 2015 21:31:59 +0900] rev 23826
revset: fix spanset.isascending() to honor sort() or reverse() request Because spanset.isascending() ignored the ascending flag, the result of "fullreposet() & x" was always sorted in ascending order. The test case is carefully chosen to call fullreposet.__and__.
Tue, 13 Jan 2015 15:08:55 -0500 hghave: we now support Python 2.7.9's ssl for https
Augie Fackler <augie@google.com> [Tue, 13 Jan 2015 15:08:55 -0500] rev 23825
hghave: we now support Python 2.7.9's ssl for https
Tue, 13 Jan 2015 14:15:08 -0500 Makefile.python: try curl if wget fails
Augie Fackler <augie@google.com> [Tue, 13 Jan 2015 14:15:08 -0500] rev 23824
Makefile.python: try curl if wget fails Macs ship with curl and not wget, so this is a nice little tweak for folks testing on OS X.
Tue, 13 Jan 2015 15:15:37 -0500 test-https: glob error messages more so we pass on Python 2.7.9
Augie Fackler <augie@google.com> [Tue, 13 Jan 2015 15:15:37 -0500] rev 23823
test-https: glob error messages more so we pass on Python 2.7.9 Python 2.7.9 cleans up how it stringifies SSL errors, so we have to look only for the important bit (certificate verify failed) rather than looking for specific ssl module goop (which is now unstable).
Mon, 12 Jan 2015 09:46:56 -0800 filelog: fix backwards comment for 'backrevref'
Martin von Zweigbergk <martinvonz@google.com> [Mon, 12 Jan 2015 09:46:56 -0800] rev 23822
filelog: fix backwards comment for 'backrevref'
Mon, 12 Jan 2015 09:49:25 -0800 filelog: remove trailing "form feed" character
Martin von Zweigbergk <martinvonz@google.com> [Mon, 12 Jan 2015 09:49:25 -0800] rev 23821
filelog: remove trailing "form feed" character
Mon, 12 Jan 2015 09:48:05 -0800 filelog: remove unused variable 'lkr'
Martin von Zweigbergk <martinvonz@google.com> [Mon, 12 Jan 2015 09:48:05 -0800] rev 23820
filelog: remove unused variable 'lkr' It's used further down, but it's overwritten before, so it's technically a dead assignment, but unnecessary nevertheless.
Sat, 10 Jan 2015 12:00:03 -0500 branchmap: add seek() to end of file before calling tell() on append open()
Matt Harbison <matt_harbison@yahoo.com> [Sat, 10 Jan 2015 12:00:03 -0500] rev 23819
branchmap: add seek() to end of file before calling tell() on append open() This is similar to 48c232873a54, which was subsequently modified in 19f5dec2d61f for 2.4. Unexpected test changes on Windows occurred without this.
Fri, 09 Jan 2015 22:14:01 -0500 tests: fix test-casefolding.t output for branchcache
Matt Harbison <matt_harbison@yahoo.com> [Fri, 09 Jan 2015 22:14:01 -0500] rev 23818
tests: fix test-casefolding.t output for branchcache This belongs with 7d63398fbfd1. I assume that the failure to read is OK, because there is similar output in test-convert-svn-encoding.t.
Tue, 06 Jan 2015 17:19:21 -0800 setdiscovery: remove '_setupsample' function
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 06 Jan 2015 17:19:21 -0800] rev 23817
setdiscovery: remove '_setupsample' function It is now unused.
Wed, 07 Jan 2015 20:44:20 -0800 setdiscovery: document '_takequicksample'
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 20:44:20 -0800] rev 23816
setdiscovery: document '_takequicksample'
Tue, 06 Jan 2015 17:07:44 -0800 setdiscovery: drop '_setupsample' usage in '_takequicksample'
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 06 Jan 2015 17:07:44 -0800] rev 23815
setdiscovery: drop '_setupsample' usage in '_takequicksample' For '_takefullsample' we can just retrieve the list of head directly and ignore the rest of the complex return values. This was the last call to the infamous '_updatesample' function.
Wed, 07 Jan 2015 10:32:17 -0800 setdiscovery: drop the 'always' argument to '_updatesample'
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 10:32:17 -0800] rev 23814
setdiscovery: drop the 'always' argument to '_updatesample' This argument exists because of the complex code flow in '_takequicksample'. It first gets the list of heads and then calls '_updatesample' on an empty initial sample and a size limit matching the differences between the number of heads and the target sample size. Finally the heads and the sample from '_updatesample' were added. To ensure this addition result had the exact target length, the code had to ensure no elements from the heads were added to the '_updatesample' content and therefore was passing this "always included set of heads". Instead we can just update the initial heads sample directly and use the final target size as target size for the update. This removes the need for this 'always' parameter to the '_updatesample' function The test are affected because different set building order results in different random sampling.
Wed, 07 Jan 2015 17:28:51 -0800 setdiscovery: always add exponential sample to the heads
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 17:28:51 -0800] rev 23813
setdiscovery: always add exponential sample to the heads As explained in a previous changeset, prioritizing heads too much behaves pathologically when there are more heads than the sample size. To counter this, we always inject exponential samples before reducing to the sample size limit. This already show some benefit in the test themselves, but on a real-world example this moves my discovery for push to pathologically headed repo from 45 rounds to 17 of them. We should maybe ensure that at least 25% of the result sample is heads, but I think the random sampling will be fine in practice.
Wed, 07 Jan 2015 17:23:21 -0800 setdiscovery: directly run '_updatesample'
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 17:23:21 -0800] rev 23812
setdiscovery: directly run '_updatesample' The heads and exponential sample are going to end up in the same set before any extra processing happens. We simplify the code by directly updating a set with heads. Changes in the order the set is built lead to small changes in the random sampling output. But after double checking, I can confirm the input data to the random sampling is consistent.
Wed, 07 Jan 2015 17:17:56 -0800 setdiscovery: stop using '_setupsample' in '_takefullsample'
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 17:17:56 -0800] rev 23811
setdiscovery: stop using '_setupsample' in '_takefullsample' Very few of the return values of '_setupsample' remain in use, so we directly retrieve the value we care about and drop the '_setupsample' call.
Wed, 07 Jan 2015 12:09:51 -0800 setdiscovery: randomly pick between heads and sample when taking full sample
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 12:09:51 -0800] rev 23810
setdiscovery: randomly pick between heads and sample when taking full sample Before this changeset, the discovery protocol was too heads-centric. Heads of the undiscovered set were always sent for discovery and any room remaining in the sample were filled with exponential samples (and random ones if any room remained). This behaved extremely poorly when the number of heads exceeded the sample size, because we keep just asking about the existence of heads, then their direct parent and so on. As a result, the 'O(log(len(repo)))' discovery turns into a 'O(len(repo))' one. As a solution we take a random sample of the heads plus exponential samples. This way we ensure some exponential sampling is achieved, bringing back some logarithmic convergence of the discovery again. This patch only applies this principle in one place. More places will be updated in future patches. One test is impacted because the random sample happen to be different. By chance, it helps a bit in this case.
Tue, 06 Jan 2015 17:02:32 -0800 setdiscovery: document the '_updatesample' function
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 06 Jan 2015 17:02:32 -0800] rev 23809
setdiscovery: document the '_updatesample' function This function is central in the sample building process, having it documented help code readability a lot.
Tue, 06 Jan 2015 16:40:33 -0800 setdiscovery: avoid calling any sample building if the undecided set is small
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 06 Jan 2015 16:40:33 -0800] rev 23808
setdiscovery: avoid calling any sample building if the undecided set is small If the length of undecided is smaller than the sample size, we can just request information for all of them. This conditional was previously handled by '_setupsample'. But '_setupsample' is in my opinion a problematic function with blurry semantics. Having this conditional explicitly earlier makes the code more explicit and moves us closer to removing this '_setupsample' function.
Wed, 07 Jan 2015 09:30:06 -0800 setdiscovery: delay sample building calls to gather them in a single place
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 07 Jan 2015 09:30:06 -0800] rev 23807
setdiscovery: delay sample building calls to gather them in a single place Some of the logic around sample building is duplicated in the sample builders, it would clean up thing to extract it in the top function, but this requires all codes to be in the same place. This changeset mostly exists to make the next one more clear.
Tue, 06 Jan 2015 16:32:23 -0800 setdiscovery: drop unused 'initial' argument for '_takequicksample'
Pierre-Yves David <pierre-yves.david@fb.com> [Tue, 06 Jan 2015 16:32:23 -0800] rev 23806
setdiscovery: drop unused 'initial' argument for '_takequicksample' There is a single call site, and it is always using 'initial=True'. So we just drop the argument and the associated condition.
Sun, 11 Jan 2015 16:46:13 -0600 readmarkers: add a SHA256 fixme note
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 16:46:13 -0600] rev 23805
readmarkers: add a SHA256 fixme note
Sun, 11 Jan 2015 16:37:57 -0600 readmarkers: fast-path single successors and parents
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 16:37:57 -0600] rev 23804
readmarkers: fast-path single successors and parents This gives about a 5% performance bump.
Sun, 11 Jan 2015 15:35:09 -0600 readmarkers: promote global constants to locals for performance
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 15:35:09 -0600] rev 23803
readmarkers: promote global constants to locals for performance
Sun, 11 Jan 2015 14:52:57 -0600 readmarkers: drop a temporary
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:52:57 -0600] rev 23802
readmarkers: drop a temporary
Sun, 11 Jan 2015 14:51:49 -0600 readmarkers: read node reading into node length conditional
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:51:49 -0600] rev 23801
readmarkers: read node reading into node length conditional This removes some conditional assignments
Sun, 11 Jan 2015 14:46:55 -0600 readmarkers: drop a temporary
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:46:55 -0600] rev 23800
readmarkers: drop a temporary Two other temporaries are renamed to fit line-length.
Sun, 11 Jan 2015 14:44:57 -0600 readmarkers: hoist subtraction out of loop comparison
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:44:57 -0600] rev 23799
readmarkers: hoist subtraction out of loop comparison
Sun, 11 Jan 2015 14:43:31 -0600 readmarkers: streamline offset tracking
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:43:31 -0600] rev 23798
readmarkers: streamline offset tracking This minimizes the number of assignments and operations needed to use offsets.
Sun, 11 Jan 2015 14:37:50 -0600 readmarkers: use unpacker for fixed header
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:37:50 -0600] rev 23797
readmarkers: use unpacker for fixed header
Sun, 11 Jan 2015 14:35:03 -0600 readmarkers: drop metadata temporary
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:35:03 -0600] rev 23796
readmarkers: drop metadata temporary
Sun, 11 Jan 2015 14:33:49 -0600 readmarkers: drop date temporary
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:33:49 -0600] rev 23795
readmarkers: drop date temporary
Sun, 11 Jan 2015 14:32:56 -0600 readmarkers: drop another conditional
Matt Mackall <mpm@selenic.com> [Sun, 11 Jan 2015 14:32:56 -0600] rev 23794
readmarkers: drop another conditional
Sat, 10 Jan 2015 21:28:15 -0600 readmarkers: drop a conditional
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:28:15 -0600] rev 23793
readmarkers: drop a conditional
Sat, 10 Jan 2015 21:27:29 -0600 readmarkers: add some whitespace
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:27:29 -0600] rev 23792
readmarkers: add some whitespace
Sat, 10 Jan 2015 21:25:07 -0600 readmarkers: combine parent conditionals
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:25:07 -0600] rev 23791
readmarkers: combine parent conditionals
Sat, 10 Jan 2015 21:24:45 -0600 readmarkers: drop temporary substring assignments
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:24:45 -0600] rev 23790
readmarkers: drop temporary substring assignments Assignments are expensive in inner loops
Sat, 10 Jan 2015 21:18:31 -0600 util: introduce unpacker
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:18:31 -0600] rev 23789
util: introduce unpacker This allows taking advantage of Python 2.5+'s struct.Struct, which provides a slightly faster unpack due to reusing formats. Sadly, .unpack_from is significantly slower.
Sat, 10 Jan 2015 21:13:10 -0600 perf: add a configurable sleep on startup
Matt Mackall <mpm@selenic.com> [Sat, 10 Jan 2015 21:13:10 -0600] rev 23788
perf: add a configurable sleep on startup This is intended to counteract power management by giving a consistent idle period before test runs.
Thu, 08 Jan 2015 00:01:03 +0100 revset: use localrepo revbranchcache for branch name filtering
Mads Kiilerich <madski@unity3d.com> [Thu, 08 Jan 2015 00:01:03 +0100] rev 23787
revset: use localrepo revbranchcache for branch name filtering Branch name filtering in revsets was expensive. For every rev it created a changectx and called .branch() which retrieved the branch name from the changelog. Instead, use the revbranchcache. The revbranchcache is used read-only. The revset implementation with generators and callbacks makes it hard to figure out when we are done using/updating the cache and could write it back. It would also be 'tricky' to lock the repo for writing from within a revset execution. Finally, the branchmap update will usually make sure that the cache is updated before any revset can be run. The revbranchcache is used without any locking but is short-lived and used in a tight loop where we can assume that the changelog doesn't change ... or where it not is relevant to us if it does. perfrevset 'branch(mobile)' on mozilla-central. Before: ! wall 10.989637 comb 10.970000 user 10.940000 sys 0.030000 (best of 3) After, no cache: ! wall 7.368656 comb 7.370000 user 7.360000 sys 0.010000 (best of 3) After, with cache: ! wall 0.528098 comb 0.530000 user 0.530000 sys 0.000000 (best of 18) The performance improvement even without cache come from being based on branchinfo on the changelog instead of using ctx.branch(). Some tests are added to verify that the revbranchcache works and keep an eye on when the cache files actually are updated.
Thu, 08 Jan 2015 00:01:03 +0100 branchmap: use revbranchcache when updating branch map
Mads Kiilerich <madski@unity3d.com> [Thu, 08 Jan 2015 00:01:03 +0100] rev 23786
branchmap: use revbranchcache when updating branch map The revbranchcache is read on demand before it will be used for updating the branch map. It is written back when the branchmap is written and it will thus use the same locking as branchmap. The revbranchcache instance is short-lived; it is only stored in the branchmap from .update() is invoked and until .write() is invoked. Branchmap already assume that the repo is locked in that case. The use of revbranchcache for branch map updates will make sure that the revbranchcache "always" is kept up-to-date. The perfbranchmap benchmark is somewhat bogus, especially when we can see that the caching makes a significant difference between the realistic case of a first run and the rare case of rerunning it with a full cache. Here are some 'base' numbers on mozilla-central: Before: ! wall 6.912745 comb 6.910000 user 6.840000 sys 0.070000 (best of 3) After - initial, cache is empty: ! wall 7.792569 comb 7.790000 user 7.720000 sys 0.070000 (best of 3) After - cache is full: ! wall 0.879688 comb 0.880000 user 0.870000 sys 0.010000 (best of 4) The overhead when running with empty cache comes from checking, missing and updating it every time. Most of the performance improvement comes from not having to extract the branch info from the changelog. The last doubling of performance comes from no longer having to convert all branch names to local encoding but reuse the few already converted branch names. On the hg repo: Before: ! wall 0.715703 comb 0.710000 user 0.710000 sys 0.000000 (best of 14) After: ! wall 0.105489 comb 0.110000 user 0.110000 sys 0.000000 (best of 87)
Thu, 08 Jan 2015 00:01:03 +0100 branchcache: introduce revbranchcache for caching of revision branch names
Mads Kiilerich <madski@unity3d.com> [Thu, 08 Jan 2015 00:01:03 +0100] rev 23785
branchcache: introduce revbranchcache for caching of revision branch names It is expensive to retrieve the branch name of a revision. Very expensive when creating a changectx and calling .branch() every time - slightly less when using changelog.branchinfo(). Now, to speed things up, provide a way to cache the results on disk in an efficient format. Each branchname is assigned a number, and for each revision we store the number of the corresponding branch name. The branch names are stored in a dedicated file which is strictly append only. Branch names are usually reused across several revisions, and the total list of branch names will thus be so small that it is feasible to read the whole set of names before using the cache. It will however do that it might be more efficient to use the changelog for retrieving the branch info for a single revision. The revision entries are stored in another file. This file is usually append only, but if the repository has been modified, the file will be truncated and the relevant parts rewritten on demand. The entries for each revision are 8 bytes each, and the whole revision file will thus be 1/8 of 00changelog.i. Each revision entry contains the first 4 bytes of the corresponding node hash. This is used as a check sum that always is verified before the entry is used. That check is relatively expensive but it makes sure history modification is detected and handled correctly. It will also detect and handle most revision file corruptions. This is just a cache. A new format can always be introduced if other requirements or ideas make that seem like a good idea. Rebuilding the cache is not really more expensive than it was to run for example 'hg log -b branchname' before this cache was introduced. This new method is still unused but promise to make some operations several times faster once it actually is used. Abandoning Python 2.4 would make it possible to implement this more efficiently by using struct classes and pack_into. The Python code could probably also be micro optimized or it could be implemented very efficiently in C where it would be easy to control the data access.
Fri, 09 Jan 2015 22:53:38 +0800 hgweb: move archive entries outside of <li> in monoblue style
Anton Shestakov <engored@ya.ru> [Fri, 09 Jan 2015 22:53:38 +0800] rev 23784
hgweb: move archive entries outside of <li> in monoblue style archiveentry already includes surrounding <li></li>, so putting archive entries inside <li> element produced incorrect markup.
Fri, 09 Jan 2015 15:24:55 +0800 hgweb: add searchhint to templates/coal/map
Anton Shestakov <engored@ya.ru> [Fri, 09 Jan 2015 15:24:55 +0800] rev 23783
hgweb: add searchhint to templates/coal/map coal style uses every template (except header.tmpl) directly from paper style, but doesn't use paper/map file. Elements defined in such map files are used in templates as you would expect. For example, paper/search.tmpl contains '{searchhint}' and template engine replaces that with the actual hint. But when coal style reuses paper/search.tmpl, it needs to define searchhint in its map file as well, or template engine will not find it. So let's copy it from paper/map to coal/map. Before this change, if the coal style was selected, the hint for the search field in page header was present, but it was completely empty. Although the absence of searchhint in coal/map produced no error.
Tue, 30 Dec 2014 21:12:52 -0500 largefiles: enable subrepo support for remove
Matt Harbison <matt_harbison@yahoo.com> [Tue, 30 Dec 2014 21:12:52 -0500] rev 23782
largefiles: enable subrepo support for remove Previously, remove failed when operating on a largefile in a subrepo, stating that the file is untracked.
Thu, 08 Jan 2015 21:36:12 -0800 transplant: properly skip empty changeset (issue4423)
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 08 Jan 2015 21:36:12 -0800] rev 23781
transplant: properly skip empty changeset (issue4423) If resolving a merge conflict result in an empty changesets, we now properly skip the changeset instead of crashing. Original patch from Robert Collins <robertc@robertcollins.net>.
Thu, 08 Jan 2015 21:30:22 +0100 color: add support for colorizing git subrepo diffs
Mathias De Maré <mathias.demare@gmail.com> [Thu, 08 Jan 2015 21:30:22 +0100] rev 23780
color: add support for colorizing git subrepo diffs
Thu, 08 Jan 2015 23:33:56 -0500 tests: fix test-casefolding.t output
Matt Harbison <matt_harbison@yahoo.com> [Thu, 08 Jan 2015 23:33:56 -0500] rev 23779
tests: fix test-casefolding.t output This change started with a387b0390082.
Fri, 12 Dec 2014 17:42:14 +0000 synthrepo: new filenames must not also be new directories, and vice-versa
Mike Edgar <adgar@google.com> [Fri, 12 Dec 2014 17:42:14 +0000] rev 23778
synthrepo: new filenames must not also be new directories, and vice-versa When generating many new files into a set of many possible new directories, there is the possibility that the same path is chosen as both file and directory. How likely this is depends on the size of the dictionary used, the generated directory structure and the number of generated files.
Thu, 08 Jan 2015 13:29:06 -0800 status: don't override _buildstatus() in workingcommitctx
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Jan 2015 13:29:06 -0800] rev 23777
status: don't override _buildstatus() in workingcommitctx Now that the caching into _status is done in workingctx._dirstatestatus(), which workingcommitctx._dirstatestatus() does not call, there is no caching to prevent in _buildstatus(), so stop overriding it.
Thu, 08 Jan 2015 13:12:44 -0800 status: cache dirstate status in _dirstatestatus()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 08 Jan 2015 13:12:44 -0800] rev 23776
status: cache dirstate status in _dirstatestatus() Since it's only the dirstate status we cache, it makes more sense to cache it in the _dirstatestatus() method. Note that this change means the dirstate status will also be cached when status is requested between the working copy and some other revision, while we currently only cache the result if exactly the status between the working copy and its parent is requested.
Thu, 16 Oct 2014 21:49:28 -0700 localrepo: add ignoremissing parameter to branchtip
Sean Farley <sean.michael.farley@gmail.com> [Thu, 16 Oct 2014 21:49:28 -0700] rev 23775
localrepo: add ignoremissing parameter to branchtip Previously, in the namespaces api, the only caller of branchtip was singlenode which happened to raise the same exception that branchtip raised: KeyError. This is a minor change but will allow upcoming patches to use repo.branchtip to not raise an exception if a branch doesn't exist. After that, it will be possible for extensions to use the namespace api in a stable way.
Mon, 15 Dec 2014 14:46:04 -0800 namespaces: add method to return a list of nodes for a given name
Sean Farley <sean.michael.farley@gmail.com> [Mon, 15 Dec 2014 14:46:04 -0800] rev 23774
namespaces: add method to return a list of nodes for a given name This is a helpful method that some extensions can make use of (e.g. for custom revsets); currently not used in core.
Tue, 21 Oct 2014 19:49:23 -0700 namespaces: add test for log
Sean Farley <sean.michael.farley@gmail.com> [Tue, 21 Oct 2014 19:49:23 -0700] rev 23773
namespaces: add test for log Now that we have enough features in the namespaces api, we add a test for it.
Fri, 17 Oct 2014 09:26:37 -0700 log: use new namespaces api to display names
Sean Farley <sean.michael.farley@gmail.com> [Fri, 17 Oct 2014 09:26:37 -0700] rev 23772
log: use new namespaces api to display names The only caveat here is that branches must be displayed first due to backwards compatibility. The order of namespaces is defined to be the 'update' order which, unfortunately, is not the same as log output order. It's worth mentioning that the log output is still translated the same as before since we are formating our strings the same way: # i18n: column positioning for "hg log" _("bookmark: %s\n") % bookmark becomes tname = _(("%s:" % ns.templatename).ljust(13) + "%s\n") % name when name == 'bookmark'. The ljust(13) keeps the strings and whitespace equal. Adding a new namespace is even easier now because the log output code doesn't need to change. A future programmer would just need to add the string to the corresponding .po file (which is the same as they would have had to do previously).
Wed, 31 Dec 2014 16:50:19 -0600 tests: add a i18n translation test for log output
Sean Farley <sean.michael.farley@gmail.com> [Wed, 31 Dec 2014 16:50:19 -0600] rev 23771
tests: add a i18n translation test for log output Upcoming patches will change the way that log output is generated so we add a test to ensure that the words 'branches', 'bookmarks', and 'tags' are still translated.
Fri, 09 Jan 2015 11:21:29 -0800 filectx: fix annotate to not directly instantiate filectx
Durham Goode <durham@fb.com> [Fri, 09 Jan 2015 11:21:29 -0800] rev 23770
filectx: fix annotate to not directly instantiate filectx 28a302e9225d changed basefilectx.annotate() to directly instantiate new filectx's instead of going through self.filectx(), this breaks extensions that replace the filectx class, and would also break future uses that would need memfilectx's.
Wed, 31 Dec 2014 18:39:41 -0500 largefiles: don't print files as both large and normal in addremove dryruns
Matt Harbison <matt_harbison@yahoo.com> [Wed, 31 Dec 2014 18:39:41 -0500] rev 23769
largefiles: don't print files as both large and normal in addremove dryruns
Wed, 31 Dec 2014 18:31:18 -0500 largefiles: return the list of added files from addlargefiles()
Matt Harbison <matt_harbison@yahoo.com> [Wed, 31 Dec 2014 18:31:18 -0500] rev 23768
largefiles: return the list of added files from addlargefiles() This will be used to exclude largefile candidates from the normal file matcher, which will allow add and addremove dryruns to not print a file as both a normal and a large file.
Fri, 28 Nov 2014 21:44:41 -0500 largefiles: align the output messages for an added file with core methods
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Nov 2014 21:44:41 -0500] rev 23767
largefiles: align the output messages for an added file with core methods Core addremove prints the file relative to cwd only if patterns are provided to the command. Core add always prints relative to cwd. Also, both methods print the subrepo prefix when needed. The 'already a largefile' doesn't have an analog in core, but follows the same rules for consistency.
Fri, 28 Nov 2014 21:03:44 -0500 largefiles: align the output messages for a removed file with core methods
Matt Harbison <matt_harbison@yahoo.com> [Fri, 28 Nov 2014 21:03:44 -0500] rev 23766
largefiles: align the output messages for a removed file with core methods Both cmdutil.remove() and scmutil.addremove() require verbose mode or an inexact match to print the filename. Core addremove also prints the file relative to cwd only if patterns are provided to the command. And finally, both methods print the subrepo prefix when needed.
Thu, 06 Nov 2014 14:55:18 -0800 revset: use '%' as an operator for 'only'
Sean Farley <sean.michael.farley@gmail.com> [Thu, 06 Nov 2014 14:55:18 -0800] rev 23765
revset: use '%' as an operator for 'only' With this patch, we can make it much easier to specify 'only(A,B)' -> A%B. Similarly, 'only(A)' -> A%. On Windows, '%' is a semi-reserved symbol in the following way: using non-bash shells (e.g. cmd.exe but NOT PowerShell, ConEmu, and cmder), %var% is only expanded when 'var' exists and is surrounded by '%'. That only leaves batch scripts which could prove to be problematic. I posit that this isn't a big issue because any developer of batch scripts already knows that to use '%' one needs to escape it by using a double '%%'. Alternatives to '%' could be '=' but that might be limiting our future if we ever decide to use temporary assignments in a revset.
Tue, 06 Jan 2015 21:56:33 -0800 transaction: support for callbacks during abort
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 06 Jan 2015 21:56:33 -0800] rev 23764
transaction: support for callbacks during abort Previous transaction work added callbacks to be called during regular transaction commit/close. As part of refactoring Mozilla's pushlog extension (an extension that opens a SQLite database and tries to tie its transaction semantics to Mercurial's transaction), I discovered that the new transaction APIs were insufficient to avoid monkeypatching transaction instance internals. Adding a callback that is called during transaction abort removes the necessity for monkeypatching and completes the API.
Mon, 15 Dec 2014 14:11:19 -0800 debugnamecomplete: use new name api
Sean Farley <sean.michael.farley@gmail.com> [Mon, 15 Dec 2014 14:11:19 -0800] rev 23763
debugnamecomplete: use new name api Instead of hardcoding a list of places to check, we use the new repo.names api to get a list of potential names to complete.
Fri, 17 Oct 2014 13:41:29 -0700 debugnamecomplete: rename from debuglabelcomplete
Sean Farley <sean.michael.farley@gmail.com> [Fri, 17 Oct 2014 13:41:29 -0700] rev 23762
debugnamecomplete: rename from debuglabelcomplete Now that we have decided on the use of 'name' instead of 'label' we rename this function accordingly. The old method 'debuglabelcomplete' has been left as a deprecated command so that current scripts don't break.
Mon, 22 Dec 2014 09:07:37 -0800 namespaces: add __iter__ and iteritems methods
Sean Farley <sean.michael.farley@gmail.com> [Mon, 22 Dec 2014 09:07:37 -0800] rev 23761
namespaces: add __iter__ and iteritems methods Iterating over all the namespaces is a common operation, naturally, so we add those methods now. Since we are using a sorted dictionary, this method just calls the underlying __iter__ or iteritems method.
Mon, 15 Dec 2014 14:09:00 -0800 namespaces: add 'listnames' property
Sean Farley <sean.michael.farley@gmail.com> [Mon, 15 Dec 2014 14:09:00 -0800] rev 23760
namespaces: add 'listnames' property Currently, we have no way to list all the names in a given namespace. This is needed for things such as tab completion. Future patches will use this patch for exactly that purpose.
Wed, 07 Jan 2015 14:30:40 -0800 test-bundle2-exchange: create temp script in $TESTTMP, not $TESTDIR
Martin von Zweigbergk <martinvonz@google.com> [Wed, 07 Jan 2015 14:30:40 -0800] rev 23759
test-bundle2-exchange: create temp script in $TESTTMP, not $TESTDIR The bundle2-pushkey-hook.sh script is currently created in $TESTTMP, and leaves an untracked file in that directory (tests/) after running.
(0) -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 +10000 tip