]> source.dussan.org Git - dcevm.git/commitdiff
Fixing Mercurial MQ extension check
authorIvan Dubrov <idubrov@guidewire.com>
Wed, 8 Jul 2015 19:57:14 +0000 (12:57 -0700)
committerIvan Dubrov <idubrov@guidewire.com>
Wed, 8 Jul 2015 19:57:14 +0000 (12:57 -0700)
build.gradle

index 3bbdb30c11457b0b065097b0171702624d10932a..de9ebce78d1390a8909e69d880c7b675f1a930fb 100644 (file)
@@ -36,19 +36,19 @@ project('hotspot') {
     task checkMercurial(description: 'Verify Mercurial is installed') << {
         def os = new ByteArrayOutputStream()
         try {
-            exec {
+            def result = exec {
                 executable 'hg'
-                args 'help', 'init'
+                args 'help', 'qinit'
                 standardOutput = os
                 errorOutput = os
+                ignoreExitValue = true
+            }
+            if (result.getExitValue() != 0) {
+                throw new GradleException("Mercurial does not have mq extension installed! Consult README.md for details.")
             }
         } catch (GradleException e) {
             throw new GradleException("Failed to execute 'hg'. Make sure you have Mercurial installed!")
         }
-        def str = os.toString()
-        if (!str.contains('--mq')) {
-            throw new GradleException("Mercurial does not have mq extension installed! Consult README.md for details.")
-        }
     }
 
     task init(description: 'Initialize HotSpot repository', dependsOn: checkMercurial) << {