Mercurial commit ids are short (12 digits) on database
|Assignee:||Toshi MARUYAMA||% Done:|
I'm using redmine 2.3.1 and configured a Mercurial repository.
Referring to a commit with the changeset id (a 40 digit hexadecimal number) redmine does not render this as a link.
Furthermore, loading projects/$p/repository/revisions/$changeset_id just gives a 404 "The entry or revision was not found in the repository." error.
Of course, the commit does exist in the repo.
select scmid from changesets; only gives the short-form ID, well, unsurprisingly.
Note: a short-form ID can start out valid, but become invalid because another changeset with the same prefix shows up later on. Do not use short-form IDs for long-lived representations. You can use the --debug option to display the full changeset ID.
scm: mercurial: add check scmid to RepositoryMercurialTest#test_fetch_changesets_from_scratch (#14361)
scm: mercurial: split Repository::Mercurial#latest_changesets_cond for short and long id (#14361)
scm: mercurial: add method to switch short or long id by existing value in DB (#14361)
scm: mercurial: add asserting first and last changeset to test_fetch_changesets_from_scratch (#14361)
#5 Updated by Claudio Bley over 8 years ago
- Status changed from New to Resolved
Toshi MARUYAMA wrote:
This patch fixes some bugs of previous patch.
It works great. Thank you very much!
One last thing though, would it be possible to shorten the link text to 12 (or even less) chars when on display? Maybe display it like
As a human a 40 chars hex number is just not something one can grasp, usually.
For example git uses 7 digits by default (more when there's a conflict), and bitbucket also displays 7 digits in its web interface.
Should I add a new ticket about this?
#11 Updated by Claudio Bley over 7 years ago
- File redmine_hg_long_ids_tests.diff added
Just wanted to check in on you whether you made some progress on this one?
I tried the patch on the latest release and it still applies perfectly.
I'm attaching a patch which removes one minor nit and also fixes all the failing tests.
Hope you get to include this into the next release... :)