Bugfix in defaultSorters for Filter
This commit is contained in:
parent
8ffd3ccdf3
commit
d642be27e8
@ -1,10 +1,10 @@
|
||||
#Sun Feb 21 15:42:19 CST 2010
|
||||
#Sun Feb 21 16:03:56 CST 2010
|
||||
build.dir=build
|
||||
src.dir=src
|
||||
lib.shared.dir=../shared-libs
|
||||
test.dir=test
|
||||
build.number=64
|
||||
expected.application.version=1.1.2
|
||||
build.number=1
|
||||
expected.application.version=1.1.3
|
||||
lib.dir=lib
|
||||
release.dir=release
|
||||
release.jar=pit-${application.version}.jar
|
||||
|
Binary file not shown.
BIN
libpit/release/pit-1.1.3.jar
Normal file
BIN
libpit/release/pit-1.1.3.jar
Normal file
Binary file not shown.
@ -7,8 +7,8 @@ class Filter {
|
||||
List<String> ids = null
|
||||
int priority = 9
|
||||
boolean acceptProjects = true
|
||||
Closure projectSorter = defaultIssueSorter
|
||||
Closure issueSorter = defaultProjectSorter
|
||||
Closure issueSorter = defaultIssueSorter
|
||||
Closure projectSorter = defaultProjectSorter
|
||||
|
||||
public static Closure defaultIssueSorter = { it.id.toInteger() }
|
||||
public static Closure defaultProjectSorter = { it.name }
|
||||
|
Binary file not shown.
BIN
pit-cli/lib/pit-1.1.3.jar
Normal file
BIN
pit-cli/lib/pit-1.1.3.jar
Normal file
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
#Thu Feb 18 11:26:18 CST 2010
|
||||
#Sun Feb 21 16:05:16 CST 2010
|
||||
build.dir=build
|
||||
src.dir=src
|
||||
build.jar=pit-cli-${application.version}.${build.number}.jar
|
||||
build.number=1
|
||||
expected.application.version=1.1.1
|
||||
expected.application.version=1.1.3
|
||||
lib.dir=lib
|
||||
release.dir=release
|
||||
release.jar=pit-cli-${application.version}.jar
|
||||
|
@ -40,12 +40,14 @@ if (opts.c) categories = opts.c.split(/[,\s]/)
|
||||
categories = categories.collect { Category.toCategory(it) }
|
||||
|
||||
// build issue list
|
||||
issuedb = new Project(new File('.'),
|
||||
new Filter('categories': categories,
|
||||
issuedb = new FileProject(new File('.'))
|
||||
|
||||
// build filter from options
|
||||
def filter = new Filter('categories': categories,
|
||||
'priority': (opts.p ? opts.p.toInteger() : 9),
|
||||
'projects': (opts.r ? opts.r.toLowerCase().split(/[,\s]/).asType(List.class) : []),
|
||||
'ids': (opts.i ? opts.i.split(/[,\s]/).asType(List.class) : []),
|
||||
'acceptProjects': (opts.s || !opts.S)))
|
||||
'acceptProjects': (opts.s || !opts.S))
|
||||
|
||||
// list first
|
||||
if (opts.l) {
|
||||
@ -62,12 +64,12 @@ if (opts.l) {
|
||||
projectPrinter = { project, offset ->
|
||||
println "\n${offset}${project.name}"
|
||||
println "${offset}${'-'.multiply(project.name.length())}"
|
||||
project.eachIssue { issuePrinter.call(it, offset) }
|
||||
project.eachProject { projectPrinter.call(it, offset + " ") }
|
||||
project.eachIssue(filter) { issuePrinter.call(it, offset) }
|
||||
project.eachProject(filter) { projectPrinter.call(it, offset + " ") }
|
||||
}
|
||||
|
||||
issuedb.eachIssue { issuePrinter.call(it, "") }
|
||||
issuedb.eachProject { projectPrinter.call(it, "") }
|
||||
issuedb.eachProject(filter) { projectPrinter.call(it, "") }
|
||||
|
||||
}
|
||||
|
||||
@ -77,7 +79,7 @@ else if (opts.P) {
|
||||
try { priority = max(0, min(9, opts.P.toInteger())) }
|
||||
catch (e) { println "Invalid priority: ${opts.P}"; return 1 }
|
||||
|
||||
walkProject(issuedb) { it.priority = priority }
|
||||
walkProject(issuedb, filter) { it.priority = priority }
|
||||
}
|
||||
// change category third
|
||||
else if (opts.C) {
|
||||
@ -85,7 +87,7 @@ else if (opts.C) {
|
||||
try { cat = Category.toCategory(opts.C) }
|
||||
catch (e) { println "Invalid category: ${opts.C}"; return 1 }
|
||||
|
||||
walkProject(issuedb) { it.category = cat }
|
||||
walkProject(issued, filterb) { it.category = cat }
|
||||
}
|
||||
// new entry last
|
||||
else if (opts.n) {
|
||||
@ -131,7 +133,7 @@ else if (opts.n) {
|
||||
println issue
|
||||
}
|
||||
|
||||
def walkProject(Project p, Closure c) {
|
||||
p.eachIssue(c)
|
||||
p.eachProject { walkProject(it, c) }
|
||||
def walkProject(Project p, Filter filter, Closure c) {
|
||||
p.eachIssue(filter, c)
|
||||
p.eachProject(filter) { walkProject(it, filter, c) }
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
application.version=1.1.2
|
||||
application.version=1.1.3
|
||||
|
Loading…
x
Reference in New Issue
Block a user