Sat, 21 Jul 2018 17:19:12 +0900 fileset: combine union of basic patterns into single matcher
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Jul 2018 17:19:12 +0900] rev 38865
fileset: combine union of basic patterns into single matcher This appears to improve query performance in a big repository than I thought. Writing less Python in a hot loop, faster computation we gain. $ hg files --cwd mozilla-central --time 'set:a* + b* + c* + d* + e*' (orig) time: real 0.670 secs (user 0.640+0.000 sys 0.030+0.000) (new) time: real 0.210 secs (user 0.180+0.000 sys 0.020+0.000)
Sat, 21 Jul 2018 17:13:34 +0900 fileset: reorder 'or' expression by weight
Yuya Nishihara <yuya@tcha.org> [Sat, 21 Jul 2018 17:13:34 +0900] rev 38864
fileset: reorder 'or' expression by weight
Sat, 04 Aug 2018 17:08:33 +0900 fileset: introduce weight constants for readability
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Aug 2018 17:08:33 +0900] rev 38863
fileset: introduce weight constants for readability These constants are defined in the filesetlang module since it's the bottommost module depending on WEIGHT_CHECK_FILENAME, and extensions will be likely to import it to process function arguments. Credit for the naming goes to Augie Fackler.
Sat, 04 Aug 2018 17:17:31 +0900 sparse: use named parameters in i18n strings
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Aug 2018 17:17:31 +0900] rev 38862
sparse: use named parameters in i18n strings This should give more hints about what the %s means, and allow reordering.
Sat, 04 Aug 2018 17:11:03 +0900 sparse: do not include operator in i18n strings
Yuya Nishihara <yuya@tcha.org> [Sat, 04 Aug 2018 17:11:03 +0900] rev 38861
sparse: do not include operator in i18n strings
Fri, 03 Aug 2018 16:39:09 -0700 fix: compute changed lines lazily to make whole-file fixer tools faster
Danny Hooper <hooper@google.com> [Fri, 03 Aug 2018 16:39:09 -0700] rev 38860
fix: compute changed lines lazily to make whole-file fixer tools faster Differential Revision: https://phab.mercurial-scm.org/D4100
Sat, 04 Aug 2018 12:23:18 +0530 resolve: support commands.resolve.confirm option with --mark flag
Sushil khanchi <sushilkhanchi97@gmail.com> [Sat, 04 Aug 2018 12:23:18 +0530] rev 38859
resolve: support commands.resolve.confirm option with --mark flag Now, commands.resolve.confirm config option also respect --mark; and confirm to mark all 'unresolved' files as 'resolved'. It will confirm only when you don't pass any pats i.e 'hg resolve -m', because when no file pats are passed then --mark's default functionality is to mark all unresolved files. And if user has given file pats then I think there is no need to confirm. Differential Revision: https://phab.mercurial-scm.org/D4101
Fri, 03 Aug 2018 12:59:01 -0700 resolve: add commands.resolve.mark-check=abort to tweakdefaults
Kyle Lippincott <spectral@google.com> [Fri, 03 Aug 2018 12:59:01 -0700] rev 38858
resolve: add commands.resolve.mark-check=abort to tweakdefaults Differential Revision: https://phab.mercurial-scm.org/D4072
Fri, 03 Aug 2018 12:57:44 -0700 resolve: graduate resolve.mark-check from experimental, add docs
Kyle Lippincott <spectral@google.com> [Fri, 03 Aug 2018 12:57:44 -0700] rev 38857
resolve: graduate resolve.mark-check from experimental, add docs Since this hasn't been in a release yet, I'm not bothering to add an alias for the experimental name of the config variable. Differential Revision: https://phab.mercurial-scm.org/D4071
Mon, 16 Apr 2018 23:49:38 -0700 shortest: use 'x' prefix to disambiguate from revnum if configured
Martin von Zweigbergk <martinvonz@google.com> [Mon, 16 Apr 2018 23:49:38 -0700] rev 38856
shortest: use 'x' prefix to disambiguate from revnum if configured Differential Revision: https://phab.mercurial-scm.org/D4042
Sun, 29 Apr 2018 10:07:40 -0700 revisions: allow "x123" to refer to nodeid prefix "123"
Martin von Zweigbergk <martinvonz@google.com> [Sun, 29 Apr 2018 10:07:40 -0700] rev 38855
revisions: allow "x123" to refer to nodeid prefix "123" When resolving "123" to a revision, we try to interpret it as revnum before we try to interpret it as a nodeid hex prefix. This can lead to the shortest valid prefix being longer than necessary. This patch lets us write such nodeids in a shorter form by prefixing them with "x" instead of adding more hex digits until they're longer than the longest decimal revnum. On my hg repo with almost 69k revisions, turning this feature on saves on average 0.4% on the average nodeid length. That clearly doesn't justify this patch. However, it becomes more usefule when combined with the earlier patches in this series that let you disambiguate nodeid prefixes within a configured revset. Note that we attempt to resolve symbols as nodeid prefixes after we've exhausted all other posibilities, so this is a backwards compatible change (only queries that would previously fail may now succeed). I've still hidden this feature behind an experiemntal config option so we can roll it back if needed. Differential Revision: https://phab.mercurial-scm.org/D4041
Mon, 07 May 2018 16:12:12 -0700 shortest: make isrev() a top-level function
Martin von Zweigbergk <martinvonz@google.com> [Mon, 07 May 2018 16:12:12 -0700] rev 38854
shortest: make isrev() a top-level function I'm going to add another caller in the next patch. Differential Revision: https://phab.mercurial-scm.org/D4040
Tue, 17 Apr 2018 11:16:59 -0700 shortest: cache disambiguation revset
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Apr 2018 11:16:59 -0700] rev 38853
shortest: cache disambiguation revset This makes it actually useful. In compared the time in my hg repo with 69.6k revisions and with a disambiguation revset of "not public()" that matches 563 visible revisions. I ran "time hg log -T '{shortest(node1,)}' -r 0:1000" (no revisions within the revset in that revision range). Before this patch, it took 57s and after it took 0.7s. Differential Revision: https://phab.mercurial-scm.org/D4039
Fri, 20 Jul 2018 14:36:42 -0700 index: don't allow index[len(index)] to mean nullid
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 14:36:42 -0700] rev 38852
index: don't allow index[len(index)] to mean nullid Now everything else has been cleaned up and we can drop support for getting the nullid from the end of the index (from *past* the end actually, since we reduced the length in the previous patch). Differential Revision: https://phab.mercurial-scm.org/D4023
Fri, 20 Jul 2018 08:10:32 -0700 index: don't include nullid in len()
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 08:10:32 -0700] rev 38851
index: don't include nullid in len() I suspect the reason the nullid is in the index in the last position is that it lets index[i] for regular revision number, even when index was just a regular Python list. An alternative solution would have been to reserve revision number 0 for the null revision. I don't know why that wasn't done. Now that we have classes backing the index, we can easily make index[-1] get the nullid without having to put it last in the list and including it in the len(). This patch just hides the nullid -- it will still be accessible at index[len(index)]. I realize that this will be annoying when checking out across this commit for debugging (including bisection). Differential Revision: https://phab.mercurial-scm.org/D4022
Wed, 01 Aug 2018 10:57:14 -0700 index: replace insert(-1, e) method by append(e) method
Martin von Zweigbergk <martinvonz@google.com> [Wed, 01 Aug 2018 10:57:14 -0700] rev 38850
index: replace insert(-1, e) method by append(e) method I want to make index[len(index) - 1] be the tip revision, not null revision as it is today. insert(-1, e) will then make little sense. Since insert() currently requires the first argument to be -1, it seems simpler to replace it by a method that allows insertion only at the end. Note that revlogoldindex already has this method (by virtue of extending list). Differential Revision: https://phab.mercurial-scm.org/D4021
Fri, 20 Jul 2018 14:25:59 -0700 pure: create type for revlog v0 index
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 14:25:59 -0700] rev 38849
pure: create type for revlog v0 index The new type takes care of hiding the nullid entry. This type helps us transition away from including that entry at index[len(index)-1]. Differential Revision: https://phab.mercurial-scm.org/D4020
Fri, 20 Jul 2018 10:02:05 -0700 index: drop support for negative indexes into the index
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 10:02:05 -0700] rev 38848
index: drop support for negative indexes into the index I want index[i] to work for any valid revnum including -1 (as it already does), and I also want len(index) to be the number of revisions in the index (not counting the null revision), so it cannot also support negative revision numbers other than -1 for nullid. I didn't bother removing support for it from revlog v0. Differential Revision: https://phab.mercurial-scm.org/D4019
Fri, 20 Jul 2018 09:53:54 -0700 index: handle index[-1] as nullid more explicitly
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 09:53:54 -0700] rev 38847
index: handle index[-1] as nullid more explicitly I find it more intuitive to check if "pos == -1" than to first add the index length (which includes one extra item for the nullid) and compare that to "length - 1". However, because test-parseindex2.py compares the whole index (up to len(index)-1), we need to also preserve that other check for a little while more. I'll remove it soon. Differential Revision: https://phab.mercurial-scm.org/D4018
Fri, 20 Jul 2018 22:26:28 -0700 index: store nullrev as -1 in nodetree
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 22:26:28 -0700] rev 38846
index: store nullrev as -1 in nodetree Nothing important, it just seems more natural to not map nullrev to INT_MAX. We just need to change the revision encoding a little to make space for the -1. Differential Revision: https://phab.mercurial-scm.org/D4005
Fri, 20 Jul 2018 23:24:14 -0700 index: create function for deleting node from nodetree
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 23:24:14 -0700] rev 38845
index: create function for deleting node from nodetree A node is marked deleted by nt_insert(self, node, -1), but "-1" could mean so many things (notably nullrev), so let's hide it in a function. The function could possibly also remove nodes from the tree in the future (it currently only marks them deleted). Differential Revision: https://phab.mercurial-scm.org/D4004
Fri, 20 Jul 2018 09:58:09 -0700 revlog: remove some knowledge of sentinel nullid in index
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 09:58:09 -0700] rev 38844
revlog: remove some knowledge of sentinel nullid in index I think the "-2" to mean "last position in index, not counting the null revision at the end" is an implementation detail of the index that we should avoid spreading knowledge of. I hope we can even remove support for index[-2]. Differential Revision: https://phab.mercurial-scm.org/D4016
Fri, 13 Apr 2018 23:23:47 -0700 scmutil: make shortest() respect disambiguation revset
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Apr 2018 23:23:47 -0700] rev 38843
scmutil: make shortest() respect disambiguation revset The previous patch would let you use a shorter prefix if the prefix is unique within a configured revset. However, that's not very useful if there's no simple way of knowing what that shorter prefix is. This patch adapts the shortest() template function to use the shorter prefixes for nodes in the configured revset. This is currently extremely slow, because it calculates the revset for each call to shortest(). To make this faster, the next patch will start caching the revset instance. Ideally we'd cache a prefix tree instance instead. Differential Revision: https://phab.mercurial-scm.org/D4038
Wed, 28 Mar 2018 09:36:02 -0700 lookup: add option to disambiguate prefix within revset
Martin von Zweigbergk <martinvonz@google.com> [Wed, 28 Mar 2018 09:36:02 -0700] rev 38842
lookup: add option to disambiguate prefix within revset When resolving a nodeid prefix that is not unique within the repo and the user has configured a revset that they want to disambiguate within, we now try to look up within that revset before we fail. If there is a unique match within the revset, we use that. This is of course most effective at allowing a short prefix if the revset contains few nodes. For most of our internal users at Google, "not public()" is sufficiently small that a hex digit or two is enough. The implementation is currently pretty slow, but good enough for small revsets (which is the expected use case). The scan in the revset is linear. We may want to use a prefix tree if we want to allow users to use a larger revset. Credit for the idea goes to Kyle Lippincott. Differential Revision: https://phab.mercurial-scm.org/D4037
Fri, 13 Apr 2018 23:37:53 -0700 revlog: use specialized exception for ambiguous prefix lookup
Martin von Zweigbergk <martinvonz@google.com> [Fri, 13 Apr 2018 23:37:53 -0700] rev 38841
revlog: use specialized exception for ambiguous prefix lookup It's useful to be able to catch a specific exception for this case. We'll use it soon. Differential Revision: https://phab.mercurial-scm.org/D4036
Thu, 02 Aug 2018 22:44:41 +0300 narrowspec: remove the unused _parsestoredpatterns() function
Pulkit Goyal <pulkit@yandex-team.ru> [Thu, 02 Aug 2018 22:44:41 +0300] rev 38840
narrowspec: remove the unused _parsestoredpatterns() function Previous patch started using sparse.parseconfig() to read narrowspec and now we don't need this function. Differential Revision: https://phab.mercurial-scm.org/D4058
Fri, 03 Aug 2018 22:29:04 +0530 narrowspec: use sparse.parseconfig() to parse narrowspec file (BC)
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 03 Aug 2018 22:29:04 +0530] rev 38839
narrowspec: use sparse.parseconfig() to parse narrowspec file (BC) This also make narrow files use 'include' and 'exclude' instead of plural forms which are 'includes' and 'excludes'. This is BC because existing narrowspecs have to replace excludes, includes words with exclude and include i.e. their singular versions. Differential Revision: https://phab.mercurial-scm.org/D4057
Fri, 03 Aug 2018 22:24:58 +0530 sparse: add an action argument to parseconfig()
Pulkit Goyal <pulkit@yandex-team.ru> [Fri, 03 Aug 2018 22:24:58 +0530] rev 38838
sparse: add an action argument to parseconfig() This will help us in reusing this function to parse narrow config files and unfiying the config file parsing logic. Differential Revision: https://phab.mercurial-scm.org/D4056
Fri, 03 Aug 2018 13:00:14 -0700 tests: avoid unnecessarily looking inside .hg/ in test-narrow*
Martin von Zweigbergk <martinvonz@google.com> [Fri, 03 Aug 2018 13:00:14 -0700] rev 38837
tests: avoid unnecessarily looking inside .hg/ in test-narrow* Many of the narrow tests were looking at .hg/narrowspec. I think most of them were written before we added `hg tracked`, but now that we have that command, we should fix the tests. There were also a few instances of tests looking at .hg/dirstate. I fixed those to use `hg files` instead. Differential Revision: https://phab.mercurial-scm.org/D4093
Fri, 03 Aug 2018 10:56:07 -0700 narrow: extract part of narrowspec backup to core
Martin von Zweigbergk <martinvonz@google.com> [Fri, 03 Aug 2018 10:56:07 -0700] rev 38836
narrow: extract part of narrowspec backup to core Just a little preparation for the next patch. Differential Revision: https://phab.mercurial-scm.org/D4095
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip