Mercurial > public > develkit
changeset 153:8dbc79c5bbb0
remove --template and parse manually
author | Dave Smith <smith@nwoca.org> |
---|---|
date | Fri, 25 Oct 2013 21:54:20 +0100 |
parents | 2226a55023e4 |
children | 6666e1cd8bae |
files | init.gradle |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/init.gradle Fri Oct 25 21:45:06 2013 +0100 +++ b/init.gradle Fri Oct 25 21:54:20 2013 +0100 @@ -24,16 +24,16 @@ gradle.ext.hgRepositoryUrl = "" gradle.ext.branchName = "" gradle.ext.branchStream = "" -try { + gradle.ext.branchName = "hg branch".execute().text.trim() - def parents = 'hg parents --template "\\{branches\\}\n"'.execute().text - println "raw parents: $parents" - parents = parents.trim().split("\n") - println "working directory parents: $parents " - def parent = parents.find { it != 'default' } + def rawParents = 'hg parents'.execute().text + println "raw parents: $rawParents" + def parent = rawParents.split('\n').find { it.startsWith("branch") }?.split(":")[1].trim() gradle.ext.branchName = parent ?: gradle.branchName + +try { gradle.ext.hgRepositoryUrl = ("hg path".execute().text.split('=') ?: ['',''] )[1].trim() -} catch (e) { println e } +} catch (e) { } if (file('.hgflow').exists()) {