D4020: pure: create type for revlog v0 index
martinvonz added a comment. In https://phab.mercurial-scm.org/D4020#63476, @yuja wrote: > Queued up to this, thanks. Can you rebase the remainder? Thanks! Will do right away. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4020 To: martinvonz, indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4020: pure: create type for revlog v0 index
This revision was automatically updated to reflect the committed changes. Closed by commit rHGda5a666f0f78: pure: create type for revlog v0 index (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4020?vs=9779=9883 REVISION DETAIL https://phab.mercurial-scm.org/D4020 AFFECTED FILES mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -790,6 +790,14 @@ indexformatv0_pack = indexformatv0.pack indexformatv0_unpack = indexformatv0.unpack +class revlogoldindex(list): +def __len__(self): +return list.__len__(self) + 1 +def __getitem__(self, i): +if i == -1 or i == len(self) - 1: +return (0, 0, 0, -1, -1, -1, -1, nullid) +return list.__getitem__(self, i) + class revlogoldio(object): def __init__(self): self.size = indexformatv0.size @@ -811,10 +819,7 @@ nodemap[e[6]] = n n += 1 -# add the magic null revision at -1 -index.append((0, 0, 0, -1, -1, -1, -1, nullid)) - -return index, nodemap, None +return revlogoldindex(index), nodemap, None def packentry(self, entry, node, version, rev): if gettype(entry[0]): To: martinvonz, indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4020: pure: create type for revlog v0 index
yuja added a comment. Queued up to this, thanks. Can you rebase the remainder? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4020 To: martinvonz, indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D4020: pure: create type for revlog v0 index
Queued up to this, thanks. Can you rebase the remainder? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4020: pure: create type for revlog v0 index
martinvonz updated this revision to Diff 9779. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D4020?vs=9720=9779 REVISION DETAIL https://phab.mercurial-scm.org/D4020 AFFECTED FILES mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -789,6 +789,14 @@ indexformatv0_pack = indexformatv0.pack indexformatv0_unpack = indexformatv0.unpack +class revlogoldindex(list): +def __len__(self): +return list.__len__(self) + 1 +def __getitem__(self, i): +if i == -1 or i == len(self) - 1: +return (0, 0, 0, -1, -1, -1, -1, nullid) +return list.__getitem__(self, i) + class revlogoldio(object): def __init__(self): self.size = indexformatv0.size @@ -810,10 +818,7 @@ nodemap[e[6]] = n n += 1 -# add the magic null revision at -1 -index.append((0, 0, 0, -1, -1, -1, -1, nullid)) - -return index, nodemap, None +return revlogoldindex(index), nodemap, None def packentry(self, entry, node, version, rev): if gettype(entry[0]): To: martinvonz, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D4020: pure: create type for revlog v0 index
martinvonz created this revision. Herald added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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]. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4020 AFFECTED FILES mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -789,6 +789,14 @@ indexformatv0_pack = indexformatv0.pack indexformatv0_unpack = indexformatv0.unpack +class revlogoldindex(list): +def __len__(self): +return list.__len__(self) + 1 +def __getitem__(self, i): +if i == -1 or i == len(self) - 1: +return (0, 0, 0, -1, -1, -1, -1, nullid) +return list.__getitem__(self, i) + class revlogoldio(object): def __init__(self): self.size = indexformatv0.size @@ -810,10 +818,7 @@ nodemap[e[6]] = n n += 1 -# add the magic null revision at -1 -index.append((0, 0, 0, -1, -1, -1, -1, nullid)) - -return index, nodemap, None +return revlogoldindex(index), nodemap, None def packentry(self, entry, node, version, rev): if gettype(entry[0]): To: martinvonz, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel