[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>
Fredrik Kuivinen committed
Sep 12, 2005 at 23:29 UTC
ace36858d3adfde1e497404e831f1cac8034fd4a
1 file changed
+12
-7
git-merge-fredrik.py
+12
-7
@@ -1,6 +1,6 @@
1
#!/usr/bin/python
2
3
-import sys, math, random, os, re, signal, tempfile, stat, errno
3
+import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
4
from heapq import heappush, heappop
5
from sets import Set
6
@@ -409,15 +409,20 @@ for nextArg in xrange(1, len(sys.argv)):
409
break
410
411
print 'Merging', h1, 'with', h2
412
-h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
413
-h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
412
415
-graph = buildGraph([h1, h2])
413
+try:
414
+ h1 = runProgram(['git-rev-parse', '--verify', h1 + '^0']).rstrip()
415
+ h2 = runProgram(['git-rev-parse', '--verify', h2 + '^0']).rstrip()
416
417
-[res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
418
- firstBranch, secondBranch, graph)
417
+ graph = buildGraph([h1, h2])
418
420
-print ''
419
+ [res, clean] = merge(graph.shaMap[h1], graph.shaMap[h2],
420
+ firstBranch, secondBranch, graph)
421
+
422
+ print ''
423
+except:
424
+ traceback.print_exc(None, sys.stderr)
425
+ sys.exit(2)
426
427
if clean:
428
sys.exit(0)