Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • evolve evolve
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 27
    • Merge requests 27
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • mercurial
  • evolveevolve
  • Merge requests
  • !261

Fix TypeError caused by the `ngtip` revset returning a node instead of a rev

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Sietse Brouwer requested to merge topic/default/issue6405-ngtip-typerror into branch/default Oct 12, 2020
  • Overview 7
  • Commits 0
  • Pipelines 2
  • Changes 0

MR moved to !266 (merged)

See https://bz.mercurial-scm.org/show_bug.cgi?id=6405

How to trigger the error

The error was triggered by running

hg log -r 'ngtip("default")'

in a repository with more than one changeset. When the flow of control reached reachableroots2, it raised

TypeError: an integer is required (got type bytes)

See the Bugzilla link above for a full traceback.

Error cause investigation

That node hash (of type bytes) got added to the revlog earlier, by the topic extension's revset.py:ngtipset function (in evolve source /hgext3rd/topic/revset.py). The call stack from there proceeds thus:

Mercurial calls (in an example repo with two commits)

hgext_topic.revset.ngtipset(
    repo,
    subset=<fullreposet+ 0:2>,
    x=('symbol', 'default')
)

which calls hgext_topic.destination.ngtip, which calls hgext_topic.topicmap.branchtip, which calls mercurial.branchmap.branchtip which returns a node hash.

Open questions for this Merge Request

Question is: At what point in the call stack above should the node hash be turned into a rev number? The current patch chooses revset.py:ngtipset.

  • I'm certain revset.ngtipset should add a rev number to the changeset, not a node hash
  • I'm not certain what callers of destination.ngtip expect it to return.
Edited Oct 16, 2020 by Sietse Brouwer
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/default/issue6405-ngtip-typerror