aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Kuivinen <freku045@student.liu.se>2005-09-12 23:29:54 +0200
committerJunio C Hamano <junkio@cox.net>2005-09-12 14:53:57 -0700
commitace36858d3adfde1e497404e831f1cac8034fd4a (patch)
tree9dd02597f01e25d1709c08cc73484abacb390fa2
parent8ceba720ba5e5e76384e46629e599124c6f36409 (diff)
downloadgit-ace36858d3adfde1e497404e831f1cac8034fd4a.tar.gz
git-ace36858d3adfde1e497404e831f1cac8034fd4a.tar.xz
[PATCH] Exit with status code 2 if we get an exception.
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-merge-fredrik.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/git-merge-fredrik.py b/git-merge-fredrik.py
index 9a05ab797..a5ca07602 100755
--- a/git-merge-fredrik.py
+++ b/git-merge-fredrik.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
-import sys, math, random, os, re, signal, tempfile, stat, errno
+import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
from heapq import heappush, heappop
from sets import Set
@@ -409,15 +409,20 @@ for nextArg in xrange(1, len(sys.argv)):
break
print 'Merging', h1, 'with', h2
-h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
-h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
-graph = buildGraph([h1, h2])
+try:
+ h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
+ h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
-[res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
- firstBranch, secondBranch, graph)
+ graph = buildGraph([h1, h2])
-print ''
+ [res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
+ firstBranch, secondBranch, graph)
+
+ print ''
+except:
+ traceback.print_exc(None, sys.stderr)
+ sys.exit(2)
if clean:
sys.exit(0)