commit:c6f4d0fd (link to a changeset with a non-numeric hash)
svn1|r758 (link to a changeset of a specific repository, for projects with multiple repositories)
commit:hg|c6f4d0fd (link to a changeset with a non-numeric hash of a specific repository)
sandbox:r758 (link to a changeset of another project)
sandbox:commit:c6f4d0fd (link to a changeset with a non-numeric hash of another project)
The current code in app/models/changeset.rb generates links such as:
hg|commit:c6f4d0fd instead of commit:hg|c6f4d0fd
# Current Codedeftext_tag(ref_project=nil)tag=ifscmid?"commit:#{scmid}"else"r#{revision}"endifrepository&&repository.identifier.present?tag="#{repository.identifier}|#{tag}"endifref_project&&project&&ref_project!=projecttag="#{project.identifier}:#{tag}"endtagend
My fix:
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index d3fa8ab..1951703 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -157,7 +157,11 @@ class Changeset < ActiveRecord::Base
"r#{revision}"
end
if repository && repository.identifier.present?
- tag = "#{repository.identifier}|#{tag}"
+ if scmid?
+ tag = "commit:#{repository.identifier}|#{scmid}"
+ else
+ tag = "#{repository.identifier}|#{tag}"
+ end
end
if ref_project && project && ref_project != project
tag = "#{project.identifier}:#{tag}"
It is a nuisance to fix this every time I update Redmine. Could maybe someone with Commit-Access to Redmine have a look at this?