Update Mercurial repository support to be compatible with Python 3 and remove support for Mercurial < 5.1 (#33784).

Patch by Harald Klimach (user:haraldkl), Olivier Houdas (user:olivier.houdas@geoconcept.com), Jakob Haufe (user:sur5r), and Sean Baggaley (user:NotTheActualSean).


git-svn-id: https://svn.redmine.org/redmine/trunk@23513 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2025-02-16 08:43:24 +00:00
parent bc90e0670d
commit 7ff2e37c46
3 changed files with 112 additions and 94 deletions

View File

@@ -50,7 +50,7 @@ module Redmine
end
def client_available
client_version_above?([1, 2])
client_version_above?([5, 1])
end
def hgversion
@@ -153,13 +153,13 @@ module Redmine
entries = Entries.new
as_ary(manifest['dir']).each do |e|
n = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['name']))
n = CGI.unescape(e['name'])
p = "#{path_prefix}#{n}"
entries << Entry.new(:name => n, :path => p, :kind => 'dir')
end
as_ary(manifest['file']).each do |e|
n = scm_iconv('UTF-8', @path_encoding, CGI.unescape(e['name']))
n = CGI.unescape(e['name'])
p = "#{path_prefix}#{n}"
lr = Revision.new(:revision => e['revision'], :scmid => e['node'],
:identifier => e['node'],
@@ -326,6 +326,7 @@ module Redmine
full_args = ["-R#{repo_path}", '--encoding=utf-8']
# don't use "--config=<value>" form for compatibility with ancient Mercurial
full_args << '--config' << "extensions.redminehelper=#{HG_HELPER_EXT}"
full_args << '--config' << "redminehelper.path_encoding=#{@path_encoding}"
full_args << '--config' << 'diff.git=false'
full_args += args
ret =