summaryrefslogtreecommitdiff
path: root/gitMergeCommon.py
diff options
context:
space:
mode:
authorFredrik Kuivinen <freku045@student.liu.se>2005-09-12 23:30:47 +0200
committerJunio C Hamano <junkio@cox.net>2005-09-12 14:53:58 -0700
commit654291a2acb1c28b884cb9376a0d7eb5f8c090b5 (patch)
tree7e88e8a4369465bf419360dbda6bca111a110ffd /gitMergeCommon.py
parentace36858d3adfde1e497404e831f1cac8034fd4a (diff)
downloadgit-654291a2acb1c28b884cb9376a0d7eb5f8c090b5.tar.gz
[PATCH] Introduce a 'die' function.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitMergeCommon.py')
-rw-r--r--gitMergeCommon.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/gitMergeCommon.py b/gitMergeCommon.py
index dfa49ff7ec..7e7f317119 100644
--- a/gitMergeCommon.py
+++ b/gitMergeCommon.py
@@ -10,6 +10,10 @@ if sys.version_info[0] < 2 or \
import subprocess
+def die(*args):
+ printList(args, sys.stderr)
+ sys.exit(2)
+
# Debugging machinery
# -------------------
@@ -28,11 +32,11 @@ def debug(*args):
if funcName in functionsToDebug:
printList(args)
-def printList(list):
+def printList(list, file=sys.stdout):
for x in list:
- sys.stdout.write(str(x))
- sys.stdout.write(' ')
- sys.stdout.write('\n')
+ file.write(str(x))
+ file.write(' ')
+ file.write('\n')
# Program execution
# -----------------