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

This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

  • mercurial
  • mercurial-develmercurial-devel
  • Merge requests
  • !12

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

cext-revlog: fixed __delitem__ for uninitialized nodetree

  • Overview 0
  • Commits 0
  • Changes 0

This is a bug in a code path that's seldom used, because in practice (at least in the whole test suite), calls to del index[i:j] currently just don't happen before the nodetree has been initialized. However, in our current work to replace the nodetree by a Rust implementation, this is of course systematic.

In index_slice_del(), if the slice start is smaller than self->length, the whole of self->added has to be cleared.

Before this change, the clearing was done only by the call to index_invalidate_added(self, 0), that happens only for initialized nodetrees. Hence the removal was effective only from start to self->length.

The consequence is index corruption, with bogus results in subsequent calls, and in particular errors such as ValueError("parent out of range"), due to the fact that parents of entries in self->added are now just invalid.

This is detected by the rebase tests, under conditions that the nodetree of revlog.c is never initialized. The provided specific test is more direct.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/default/revlog-delitem-without-nt