Compare commits

..

3 Commits
3.2.0 ... 3.2.3

Author SHA1 Message Date
ec7c07f81f Bug fix in FileIssue.
* Property changes that changed the filename of the underlying file were
  neglecting to update the internal file pointer to the new file.
2011-12-12 15:56:10 -06:00
952064d903 Fixed FileIssue formatting and extended properties.
* The extended properties table was using the maxKeyLength for both keys and
  values.
* FileIssue was not persisting the file when extended properties were updated.
2011-12-08 16:01:54 -06:00
31b9802477 Fixed PIT CLI output when setting extended properties. 2011-12-08 15:37:06 -06:00
4 changed files with 37 additions and 30 deletions

View File

@ -1,11 +1,11 @@
#Thu, 08 Dec 2011 14:35:45 -0600
#Sun, 11 Dec 2011 21:03:38 -0600
#Sat Apr 24 17:08:00 CDT 2010
build.dir=build
src.dir=src
lib.shared.dir=../shared-libs
test.dir=test
build.number=10
version=3.2.0
build.number=3
version=3.2.3
name=libpit
lib.dir=lib
lib.local=true

View File

@ -61,43 +61,45 @@ public class FileIssue extends Issue {
}
public void setCategory(Category c) throws IOException {
boolean renamed
renamed = source.renameTo(new File(source.canonicalFile.parentFile,
makeFilename(id, c, status, priority)))
if (!renamed)
throw new IOException("I was unable to set the category. "
File newSource = new File(source.canonicalFile.parentFile,
makeFilename(id, c, status, priority))
if (source.renameTo(newSource)) {
source = newSource
super.setCategory(c) }
else { throw new IOException("I was unable to set the category. "
+ "I need to rename the file for this issue, but something is "
+ "preventing me from doing so (maybe the path to the file is "
+ "no longer valid, or maybe the file is currently open in "
+ "some other program).")
else super.setCategory(c) }
+ "some other program).") }}
public void setStatus(Status s) throws IOException {
boolean renamed
renamed = source.renameTo(new File(source.canonicalFile.parentFile,
makeFilename(id, category, s, priority)))
File newSource = new File(source.canonicalFile.parentFile,
makeFilename(id, category, s, priority))
if (!renamed)
throw new IOException("I was unable to set the status. "
if (source.renameTo(newSource)) {
source = newSource
super.setStatus(s) }
else { throw new IOException("I was unable to set the status. "
+ "I need to rename the file for this issue, but something is "
+ "preventing me from doing so (maybe the path to the file is "
+ "no longer valid, or maybe the file is currently open in "
+ "some other program).")
else super.setStatus(s) }
+ "some other program).") }}
public void setPriority(int p) throws IOException {
boolean renamed
renamed = source.renameTo(new File(source.canonicalFile.parentFile,
makeFilename(id, category, status, p)))
if (!renamed)
throw new IOException("I was unable to set the priority. "
File newSource = new File(source.canonicalFile.parentFile,
makeFilename(id, category, status, p))
if (source.renameTo(newSource)) {
source = newSource
super.setPriority(p) }
else { throw new IOException("I was unable to set the priority. "
+ "I need to rename the file for this issue, but something is "
+ "preventing me from doing so (maybe the path to the file is "
+ "no longer valid, or maybe the file is currently open in "
+ "some other program).")
else super.setPriority(p) }
+ "some other program).") }}
public String getFilename() {
return makeFilename(id, category, status, priority) }
@ -110,6 +112,10 @@ public class FileIssue extends Issue {
super.setText(text)
writeFile() }
public def propertyMissing(String name, def value) {
super.propertyMissing(name, value)
writeFile() }
boolean deleteFile() { return source.deleteDir() }
public static boolean isValidFilename(String name) {
@ -153,7 +159,7 @@ public class FileIssue extends Issue {
extOutput[ks] = vs
if (ks.length() > maxKeyLen) { maxKeyLen = ks.length() }
if (vs.length() > maxKeyLen) { maxValLen = vs.length() } }
if (vs.length() > maxValLen) { maxValLen = vs.length() } }
result.append("=".multiply(maxKeyLen + 1))
result.append(" ")

View File

@ -1,9 +1,9 @@
#Thu, 08 Dec 2011 14:59:30 -0600
#Sun, 11 Dec 2011 21:04:03 -0600
build.dir=build
src.dir=src
build.jar=pit-cli-${application.version}.${build.number}.jar
build.number=12
version=3.2.0
build.number=2
version=3.2.3
name=pit-cli
lib.dir=lib
lib.local=true

View File

@ -83,7 +83,7 @@ cli._(longOpt: 'version', 'Display PIT version information.')
// ======== Parse CLI Options ======== //
// =================================== //
def VERSION = "3.2.0"
def VERSION = "3.2.3"
def opts = cli.parse(args)
def issuedb = [:]
def workingDir = new File('.')
@ -434,6 +434,7 @@ else if (assignOpts.size() > 0) {
println issue
assignOpts.each { propName, value ->
issue[propName] = value
println " set ${propName} to ${value}" } }}
def formattedValue = ExtendedPropertyHelp.format(value)
println " set ${propName} to ${formattedValue}" } }}
else { cli.usage(); return -1 }}