Rest api ChangeSet should support mercurial node id

Issue #680 resolved
Seth Gray
created an issue

Not sure if this should be a bug or enhancement, I'm leaning towards enhancement...

In a previous version (1.27) the changeset object in rest api returned the mercurial nodeid/hash as the id property of a changeset. In most recent version you've changed this object to return the revision number instead.

I'm trying to implement a simple read only mirror scmmanager site of a site hosted by an outsource provider. Part of that is to check that the latest changeset on a source repository has been pulled into the target repository. Can't do that via rest apis without the changeset nodeid.

/repositories/{id}/changeset/{revision} should instead support {revision|nodeid}. This also would map better to Mercurial own handling of changeset/revision where revision parameters accept nodeid/revision (and additionally tag - which would be a nice to have).

Also, we need the changeset object to have additional property nodeid or possibly hash?

Comments (6)

  1. Sebastian Sdorra repo owner
    • changed status to open

    The rest api accepts already node ids, tag names and revisions. When you enable "Show Revision" at the mercurial settings (Config->Repository Types->Mercurial Settings), then the api will deliver the revision number as property (hg.rev). Here is an example output:

    // http://localhost:8080/scm/api/rest/repositories/7jOxuAPge5/changeset/3904.json
      properties: [{
        key: "hg.p1.rev",
        value: "3903"
        key: "hg.rev",
        value: "3904"
  2. Seth Gray reporter

    I think I had a problem in my coding when I first logged this. the id of the changeset object is the nodeid. I'm not sure why I was seeing revision numbers instead. My apologies! Thanks for the suggestion to use tip!

  3. Log in to comment