changeset 6322:108636b9b981

hgk: don't exit if mercurial commands only print warnings
author Dennis Schoen <ds@1d10t.de>
date Wed, 16 Jan 2008 11:50:24 +0100
parents 55ba3bc5b8fd
children 6e1308a09ffd
files contrib/hgk
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk	Fri Mar 14 15:38:56 2008 -0700
+++ b/contrib/hgk	Wed Jan 16 11:50:24 2008 +0100
@@ -343,11 +343,24 @@
 proc readrefs {} {
     global tagids idtags headids idheads tagcontents env curid
 
-    set curid [exec $env(HG) --config ui.report_untrusted=false id]
+    set status [catch {exec $env(HG) --config ui.report_untrusted=false id} curid]
+    if { $status != 0 } {
+        puts $::errorInfo
+        if { ![string equal $::errorCode NONE] } {
+            exit 2
+        }
+    }
     regexp -- {[[:xdigit:]]+} $curid curid
 
-    set tags [exec $env(HG) --config ui.report_untrusted=false tags]
+    set status [catch {exec $env(HG) --config ui.report_untrusted=false tags} tags]
+    if { $status != 0 } {
+        puts $::errorInfo
+        if { ![string equal $::errorCode NONE] } {
+            exit 2
+        }
+    }
     regsub -all "\r\n" $tags "\n" tags
+
     set lines [split $tags "\n"]
     foreach f $lines {
 	regexp {(\S+)$} $f full