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
|
build.dir=build
|
||||||
src.dir=src
|
src.dir=src
|
||||||
lib.shared.dir=../shared-libs
|
lib.shared.dir=../shared-libs
|
||||||
test.dir=test
|
test.dir=test
|
||||||
build.number=64
|
build.number=1
|
||||||
expected.application.version=1.1.2
|
expected.application.version=1.1.3
|
||||||
lib.dir=lib
|
lib.dir=lib
|
||||||
release.dir=release
|
release.dir=release
|
||||||
release.jar=pit-${application.version}.jar
|
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
|
List<String> ids = null
|
||||||
int priority = 9
|
int priority = 9
|
||||||
boolean acceptProjects = true
|
boolean acceptProjects = true
|
||||||
Closure projectSorter = defaultIssueSorter
|
Closure issueSorter = defaultIssueSorter
|
||||||
Closure issueSorter = defaultProjectSorter
|
Closure projectSorter = defaultProjectSorter
|
||||||
|
|
||||||
public static Closure defaultIssueSorter = { it.id.toInteger() }
|
public static Closure defaultIssueSorter = { it.id.toInteger() }
|
||||||
public static Closure defaultProjectSorter = { it.name }
|
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
|
build.dir=build
|
||||||
src.dir=src
|
src.dir=src
|
||||||
build.jar=pit-cli-${application.version}.${build.number}.jar
|
build.jar=pit-cli-${application.version}.${build.number}.jar
|
||||||
build.number=1
|
build.number=1
|
||||||
expected.application.version=1.1.1
|
expected.application.version=1.1.3
|
||||||
lib.dir=lib
|
lib.dir=lib
|
||||||
release.dir=release
|
release.dir=release
|
||||||
release.jar=pit-cli-${application.version}.jar
|
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) }
|
categories = categories.collect { Category.toCategory(it) }
|
||||||
|
|
||||||
// build issue list
|
// build issue list
|
||||||
issuedb = new Project(new File('.'),
|
issuedb = new FileProject(new File('.'))
|
||||||
new Filter('categories': categories,
|
|
||||||
|
// build filter from options
|
||||||
|
def filter = new Filter('categories': categories,
|
||||||
'priority': (opts.p ? opts.p.toInteger() : 9),
|
'priority': (opts.p ? opts.p.toInteger() : 9),
|
||||||
'projects': (opts.r ? opts.r.toLowerCase().split(/[,\s]/).asType(List.class) : []),
|
'projects': (opts.r ? opts.r.toLowerCase().split(/[,\s]/).asType(List.class) : []),
|
||||||
'ids': (opts.i ? opts.i.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
|
// list first
|
||||||
if (opts.l) {
|
if (opts.l) {
|
||||||
@ -62,12 +64,12 @@ if (opts.l) {
|
|||||||
projectPrinter = { project, offset ->
|
projectPrinter = { project, offset ->
|
||||||
println "\n${offset}${project.name}"
|
println "\n${offset}${project.name}"
|
||||||
println "${offset}${'-'.multiply(project.name.length())}"
|
println "${offset}${'-'.multiply(project.name.length())}"
|
||||||
project.eachIssue { issuePrinter.call(it, offset) }
|
project.eachIssue(filter) { issuePrinter.call(it, offset) }
|
||||||
project.eachProject { projectPrinter.call(it, offset + " ") }
|
project.eachProject(filter) { projectPrinter.call(it, offset + " ") }
|
||||||
}
|
}
|
||||||
|
|
||||||
issuedb.eachIssue { issuePrinter.call(it, "") }
|
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())) }
|
try { priority = max(0, min(9, opts.P.toInteger())) }
|
||||||
catch (e) { println "Invalid priority: ${opts.P}"; return 1 }
|
catch (e) { println "Invalid priority: ${opts.P}"; return 1 }
|
||||||
|
|
||||||
walkProject(issuedb) { it.priority = priority }
|
walkProject(issuedb, filter) { it.priority = priority }
|
||||||
}
|
}
|
||||||
// change category third
|
// change category third
|
||||||
else if (opts.C) {
|
else if (opts.C) {
|
||||||
@ -85,7 +87,7 @@ else if (opts.C) {
|
|||||||
try { cat = Category.toCategory(opts.C) }
|
try { cat = Category.toCategory(opts.C) }
|
||||||
catch (e) { println "Invalid category: ${opts.C}"; return 1 }
|
catch (e) { println "Invalid category: ${opts.C}"; return 1 }
|
||||||
|
|
||||||
walkProject(issuedb) { it.category = cat }
|
walkProject(issued, filterb) { it.category = cat }
|
||||||
}
|
}
|
||||||
// new entry last
|
// new entry last
|
||||||
else if (opts.n) {
|
else if (opts.n) {
|
||||||
@ -131,7 +133,7 @@ else if (opts.n) {
|
|||||||
println issue
|
println issue
|
||||||
}
|
}
|
||||||
|
|
||||||
def walkProject(Project p, Closure c) {
|
def walkProject(Project p, Filter filter, Closure c) {
|
||||||
p.eachIssue(c)
|
p.eachIssue(filter, c)
|
||||||
p.eachProject { walkProject(it, 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