(更新 (en:1264535)) |
|||
71行目: | 71行目: | ||
end |
end |
||
⚫ | |||
− | -- For the sake of [[1.9]] |
||
+ | |||
⚫ | |||
⚫ | |||
− | if args. |
+ | if args.prefix then |
− | minecraft = '' |
||
+ | prefix = args.prefix |
||
− | end |
||
− | |||
⚫ | |||
− | if args.future then |
||
− | minecraft = 'Future Version - ' |
||
end |
end |
||
86行目: | 82行目: | ||
if arg and arg ~= '' then |
if arg and arg ~= '' then |
||
− | table.insert( trackerQuery, query .. ' in ("' .. |
+ | table.insert( trackerQuery, query .. ' in ("' .. prefix .. arg:gsub( ',%s*', '","' .. prefix ) .. '")' ) |
end |
end |
||
end |
end |
||
92行目: | 88行目: | ||
makeQuery( 'fixVersion not', args.notfixedin ) |
makeQuery( 'fixVersion not', args.notfixedin ) |
||
makeQuery( 'affectedVersion', args.affected ) |
makeQuery( 'affectedVersion', args.affected ) |
||
+ | |||
+ | if args.otherissuescount then issues = issues + args.otherissuescount end |
||
local text = issues .. '個のバグを修正' |
local text = issues .. '個のバグを修正' |
2019年7月22日 (月) 12:44時点における版
local p = {}
p.fixes = function( f )
local args = f:getParent().args
local project = args.project or 'MC'
local argLen = 0
for i in ipairs( args ) do
argLen = i
end
local parentVersion = f:callParserFunction( '#dplvar', 'parentVersion' )
if parentVersion == '' then
parentVersion = f:callParserFunction( '#var', 'title' )
end
local headerAliases = {
[';old'] = ';' .. parentVersion .. '以前にリリースされたバージョンから',
[';dev'] = ';' .. parentVersion .. 'の開発版から',
[';previous'] = ';以前の開発版から',
[';prev'] = ';以前の開発版から',
[';hotfix'] = ';現在のバージョンの修正版から',
[';private'] = ';非公開のバグ',
[';priv'] = ';非公開のバグ',
}
local sections = {}
local headers = {}
local section = {}
local issues = 0
local index = {}
local i = 1
while i < argLen do
local this = args[i]
if this:match( '^;' ) then
if #section > 0 then
table.insert( sections, section )
section = {}
end
local header = mw.text.trim( this )
headers[#sections + 1] = headerAliases[header:lower()] or header
else
local issue = tonumber( this:match( '%d+' ) )
if issue then
table.insert( section, issue )
issues = issues + 1
index[issue] = i
end
i = i + 1
end
i = i + 1
end
if #section > 0 then
table.insert( sections, section )
end
local list = {}
for i, section in ipairs( sections ) do
local header = headers[i]
if header and header ~= '' then
table.insert( list, header )
end
table.sort( section )
for _, issue in ipairs( section ) do
local title = mw.text.trim( args[index[issue] + 1] or '' )
table.insert( list, '* [[' .. project .. 'bug:' .. issue .. '|' .. project:upper() .. '-' .. issue .. ']] – ' .. title )
end
end
local prefix = 'Minecraft '
-- For weird versions
if args.prefix then
prefix = args.prefix
end
local trackerQuery = {}
local makeQuery = function( query, arg )
if arg and arg ~= '' then
table.insert( trackerQuery, query .. ' in ("' .. prefix .. arg:gsub( ',%s*', '","' .. prefix ) .. '")' )
end
end
makeQuery( 'fixVersion', args.fixedin )
makeQuery( 'fixVersion not', args.notfixedin )
makeQuery( 'affectedVersion', args.affected )
if args.otherissuescount then issues = issues + args.otherissuescount end
local text = issues .. '個のバグを修正'
if #trackerQuery > 0 then
table.insert( trackerQuery, 'project = ' .. project:upper() )
-- For the sake of [[1.9]]
if not args.upcoming then
table.insert( trackerQuery, 'resolution = Fixed' )
end
text = '[https://bugs.mojang.com/issues/?jql=' .. mw.uri.encode( table.concat( trackerQuery, ' AND ' ) .. ' ORDER BY key' ) .. ' ' .. text .. ']'
end
return ';' .. text .. '\n' .. table.concat( list, '\n' )
end
return p