Patch #5117 » hg-lang-c.patch
lib/redmine/scm/adapters/mercurial_adapter.rb | ||
---|---|---|
29 | 29 |
TEMPLATE_EXTENSION = "tmpl" |
30 | 30 |
|
31 | 31 |
class << self |
32 | ||
33 |
def shellout(cmd, &block) |
|
34 |
orig_lang = ENV['LANG'] |
|
35 |
ENV['LANG'] = 'C' |
|
36 |
super(cmd, &block) |
|
37 |
ENV['LANG'] = orig_lang |
|
38 |
end |
|
39 | ||
32 | 40 |
def client_version |
33 | 41 |
@@client_version ||= (hgversion || []) |
34 | 42 |
end |
... | ... | |
44 | 52 |
end |
45 | 53 |
|
46 | 54 |
def hgversion_from_command_line |
47 |
%x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] |
|
55 |
# %x{#{HG_BIN} --version}.match(/\(version (.*)\)/)[1] |
|
56 |
ver = "" |
|
57 |
cmd = "#{HG_BIN} --version" |
|
58 |
shellout(cmd) do |io| |
|
59 |
str = io.gets.chomp |
|
60 |
if ( str =~ /version/ ) |
|
61 |
ver = str.match(/\(version (.*)\)/)[1] |
|
62 |
break |
|
63 |
end |
|
64 |
end |
|
65 |
return "" if $? && $?.exitstatus != 0 |
|
66 |
ver |
|
48 | 67 |
end |
49 | 68 |
|
50 | 69 |
def template_path |