Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • mercurial-devel mercurial-devel
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mercurial
  • mercurial-develmercurial-devel
  • Merge requests
  • !10

Closed
Created Dec 05, 2019 by Georges Racinet@gracinet🦑Owner
  • Report abuse
Report abuse

WIP: Rust nodemap

  • Overview 0
  • Commits 25
  • Changes 15

A first actually working version of a nodemap implemented in Rust with an append-only variant of the same 16-radix trie as in revlog.c, packed in the rustext.revlog.MixedIndex class, to instantiate with the C index.

Currently activated by the presence of the HGRUSTINDEX environment variable. It passes all the tests for me. It has the methods required for serialization by the Python layer:

  • can be instantiated on anything implementing the buffer protocal for bytes (including mmap): MixedIndex(c_idx, data, datalen)
  • can return a ready to write dump all its mutable data as a bunch of bytes ready to be appended to the existing cache
  • pack / vacuum logic can for the time being be done this way:
c_index = MixedIndex.get_cindex()
packer = MixedIndex(c_index, None, 0)
packer._fill_nodemap()
with open(nodemap_fpath, 'wb') as fobj:  
    fobj.write(packer.nodemap_writeable())

(of course that example is oversimplified, one would need vfs, locks, perform an atomic rewrite etc, but that's not the point).

Obviously not ready for submission. Lots of squashing / resplitting and clarification of implementation, API etc, but it passes the whole test suite for me with Python 2.7

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/default/rust-nodemap