scm: mercurial: switch short or long id of entry by existing value in DB (#14361)

git-svn-id: http://svn.redmine.org/redmine/trunk@12760 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-02-02 04:44:20 +00:00
parent eb18660369
commit d301b8c0c1
1 changed files with 15 additions and 2 deletions

View File

@ -71,12 +71,25 @@ class Repository::Mercurial < Repository
super(cs, cs_to, ' ')
end
def modify_entry_lastrev_identifier(entry)
if entry.lastrev && entry.lastrev.identifier
entry.lastrev.identifier = scmid_for_inserting_db(entry.lastrev.identifier)
end
end
private :modify_entry_lastrev_identifier
def entry(path=nil, identifier=nil)
scm.entry(path, identifier)
entry = scm.entry(path, identifier)
return nil if entry.nil?
modify_entry_lastrev_identifier(entry)
entry
end
def scm_entries(path=nil, identifier=nil)
scm.entries(path, identifier)
entries = scm.entries(path, identifier)
return nil if entries.nil?
entries.each {|entry| modify_entry_lastrev_identifier(entry)}
entries
end
protected :scm_entries