comparison init20.gradle @ 179:f9087f939b0a

correct handling of hgflow file when in subproject
author smith@nwoca.org
date Sat, 13 Dec 2014 22:44:49 +0000
parents 5a3a875a1f3e
children 1bdb6e1f2fdb
comparison
equal deleted inserted replaced
178:5a3a875a1f3e 179:f9087f939b0a
485 } 485 }
486 486
487 487
488 @ToString class BranchInfo { 488 @ToString class BranchInfo {
489 def name 489 def name
490 def stream 490 def stream = "none"
491 491
492 BranchInfo(name) { 492 BranchInfo(name) {
493 this.name = name 493 this.name = name
494 if (!name) { 494 if (!name) {
495 this.name = determineName() 495 this.name = determineName()
513 def parent = rawParents.split('\n').find { it.startsWith("branch") }?.split(":")?.getAt(1)?.trim() 513 def parent = rawParents.split('\n').find { it.startsWith("branch") }?.split(":")?.getAt(1)?.trim()
514 return parent ?: branch 514 return parent ?: branch
515 } 515 }
516 516
517 void determineStream() { 517 void determineStream() {
518 if (new File('.hgflow').exists()) { 518 def flowConfig = new File('.hgflow').exists() ? new File('.hgflow') : new File('../.hgflow')
519 if (flowConfig.exists()) {
519 def flows = new Properties() 520 def flows = new Properties()
520 flows.load(new File('.hgflow').newReader()) 521 flows.load(flowConfig.newReader())
521 flows.stringPropertyNames().each { 522 flows.stringPropertyNames().each {
522 if (!it.startsWith("[") && name.startsWith(flows.getProperty(it))) { 523 if (!it.startsWith("[") && name.startsWith(flows.getProperty(it))) {
523 stream = it 524 stream = it
524 } 525 }
525 } 526 }