comparison init.gradle @ 143:1963264c39c4

handle merge working directories (multiple parent branches)
author Dave Smith <smith@nwoca.org>
date Fri, 25 Oct 2013 21:21:28 +0100
parents d3c09b4e3332
children 7fead80bdd6a
comparison
equal deleted inserted replaced
142:45d2396e9fc8 143:1963264c39c4
23 23
24 gradle.ext.hgRepositoryUrl = "" 24 gradle.ext.hgRepositoryUrl = ""
25 gradle.ext.branchName = "" 25 gradle.ext.branchName = ""
26 gradle.ext.branchStream = "" 26 gradle.ext.branchStream = ""
27 try { 27 try {
28 gradle.ext.branchName = "hg branch".execute().text.trim() 28 gradle.ext.branchName = "hg branch".execute().text.trim()
29 gradle.ext.hgRepositoryUrl = ("hg path".execute().text.split('=') ?: ['',''] )[1].trim() 29 def parents = "hg parents --template \"{branch} \"".execute().text.trim().split(" ")
30 def parent = parents.find { it != 'default' }
31 gradle.ext.branchName = parent ?: gradle.branchName
32 gradle.ext.hgRepositoryUrl = ("hg path".execute().text.split('=') ?: ['',''] )[1].trim()
30 } catch (e) { } 33 } catch (e) { }
31 34
32 35
33 if (file('.hgflow').exists()) { 36 if (file('.hgflow').exists()) {
34 def flows = new Properties() 37 def flows = new Properties()
35 flows.load(file('.hgflow').newReader()) 38 flows.load(file('.hgflow').newReader())
36 flows.stringPropertyNames().each { 39 flows.stringPropertyNames().each {
37 if (!it.startsWith("[") && gradle.ext.branchName.startsWith(flows.getProperty(it))) { 40 if (!it.startsWith("[") && gradle.ext.branchName.startsWith(flows.getProperty(it))) {
38 gradle.ext.branchStream = it 41 gradle.ext.branchStream = it
39 } 42 }
40 43 }
41 } 44 }
42 } 45
43 gradle.environment.put('hgRepositoryUrl',gradle.hgRepositoryUrl) 46 gradle.environment.put('hgRepositoryUrl',gradle.hgRepositoryUrl)
44 gradle.environment.put('branchName',gradle.branchName) 47 gradle.environment.put('branchName',gradle.branchName)
45 gradle.environment.put('branchStream',gradle.branchStream) 48 gradle.environment.put('branchStream',gradle.branchStream)
46 49
47 rootProject.ext.indyCapable = { 50 rootProject.ext.indyCapable = {