Martin von Zweigbergk <martinvonz@google.com> [Mon, 07 May 2018 16:12:12 -0700] rev 38893
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
Martin von Zweigbergk <martinvonz@google.com> [Tue, 17 Apr 2018 11:16:59 -0700] rev 38892
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
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 14:36:42 -0700] rev 38891
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
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 08:10:32 -0700] rev 38890
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
Martin von Zweigbergk <martinvonz@google.com> [Wed, 01 Aug 2018 10:57:14 -0700] rev 38889
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
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 14:25:59 -0700] rev 38888
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
Martin von Zweigbergk <martinvonz@google.com> [Fri, 20 Jul 2018 10:02:05 -0700] rev 38887
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