Mercurial > public > mercurial-scm > hg
diff mercurial/policy.py @ 38851:781b2720d2ac
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 20 Jul 2018 08:10:32 -0700 |
parents | 6104b203bec8 |
children | b85b377e7fc2 |
line wrap: on
line diff
--- a/mercurial/policy.py Wed Aug 01 10:57:14 2018 -0700 +++ b/mercurial/policy.py Fri Jul 20 08:10:32 2018 -0700 @@ -69,7 +69,7 @@ (r'cext', r'bdiff'): 3, (r'cext', r'mpatch'): 1, (r'cext', r'osutil'): 4, - (r'cext', r'parsers'): 6, + (r'cext', r'parsers'): 7, } # map import request to other package or module