1. Sebastian Sebastian
  2. scm-manager
  3. Issues


Issue #287 resolved

changeset.id for mercurial changesets is not a changeset ID

Anonymous created an issue

The id property of a Changeset returns something like "234:a4930ffdd", which is revision number COLON short-form changeset ID

This is problematic e.g. inside the redmine plugin when trying to create a (reliable) commit link which looks like this: "commit:a4930ffdd9394949..."

Hence one would need to parse the "ID" and cut off the leading revision number and colon - but only for mercurial repositories. (I don't know for others)

Actually, the id property should contain the "real" ID of the changeset, ie. a 40 digit hex number, without a revision number.

I see that #251 is somewhat related to this, but the "fix" is just a hacky workaround since it mixes the logic tier (what an ID is) with the presentation tier (how do I want to present an ID to the user).

Comments (6)

  1. Sebastian Sebastian repo owner

    SCM-Manager returns the whole id without revision since version 1.20. But it is possible to configure the format of a mercurial id since version 1.21. But in my opinion it is not a problem to cut off the revision part of the id, because no other repository system has a colon in the id. So a check like the following, should be no problem:

    String id = changeset.getId();
    int index = id.indexOf(":");
    if ( index > 0 ){
      id = id.substring(index + 1);
  2. Georg Franz

    OK, I have created an account. Not that I had another chance... bitbucket doesn't let you comment as an anonymous user.

    Sure, it should be no problem to include this kind of code in every single plugin which wants to retrieve the "real" changeset ID.

    But, if I am asking for a changeset ID (http://mercurial.selenic.com/wiki/ChangeSetID defines what this is) and I receive something else (since 1.21 only in certain circumstances) I regard this as broken. Basically, you fixed it in 1.20 and broke it again in 1.21, IMHO.


  3. Sebastian Sebastian repo owner

    Ok, i think you are right. I will remove the revision from the mercurial changeset id and deliver the revision as mercurial specific property. The fix will be included in version 1.23.

  4. Log in to comment