summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ace3685)
raw | patch | inline | side by side (parent: ace3685)
author | Fredrik Kuivinen <freku045@student.liu.se> | |
Mon, 12 Sep 2005 21:30:47 +0000 (23:30 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 12 Sep 2005 21:53:58 +0000 (14:53 -0700) |
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge-fredrik.py | patch | blob | history | |
gitMergeCommon.py | patch | blob | history |
diff --git a/git-merge-fredrik.py b/git-merge-fredrik.py
index a5ca0760213386cd2755c4b77f6363c01013fe94..e4c6fe3c61ba3a02045bb7efe0f1f482c7a393d1 100755 (executable)
--- a/git-merge-fredrik.py
+++ b/git-merge-fredrik.py
e.stages[stage].mode = mode
e.stages[stage].sha1 = sha1
else:
- print 'Error: Merge program failed: Unexpected output from', \
- 'git-ls-files:', l
- sys.exit(2)
+ die('Error: Merge program failed: Unexpected output from', \
+ 'git-ls-files:', l)
return res
def mergeTrees(head, merge, common, branch1Name, branch2Name,
os.unlink(src1)
os.unlink(src2)
else:
- print 'ERROR: Fatal merge failure.'
- print "ERROR: Shouldn't happen"
- sys.exit(2)
+ die("ERROR: Fatal merge failure, shouldn't happen.")
return cleanMerge
def usage():
- print 'Usage:', sys.argv[0], ' <base>... -- <head> <remote>..'
- sys.exit(2)
+ die('Usage:', sys.argv[0], ' <base>... -- <head> <remote>..')
# main entry point as merge strategy module
# The first parameters up to -- are merge bases, and the rest are heads.
for nextArg in xrange(1, len(sys.argv)):
if sys.argv[nextArg] == '--':
if len(sys.argv) != nextArg + 3:
- print 'Not handling anything other than two heads merge.'
- sys.exit(2)
+ die('Not handling anything other than two heads merge.')
try:
h1 = firstBranch = sys.argv[nextArg + 1]
h2 = secondBranch = sys.argv[nextArg + 2]
diff --git a/gitMergeCommon.py b/gitMergeCommon.py
index dfa49ff7ec95453d680020866e3c9658b1f77870..7e7f317119b4a7082e9151053ad28225f151f1aa 100644 (file)
--- a/gitMergeCommon.py
+++ b/gitMergeCommon.py
import subprocess
+def die(*args):
+ printList(args, sys.stderr)
+ sys.exit(2)
+
# Debugging machinery
# -------------------
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
# -----------------