[PATCH 2 of 2] worker: catch all exceptions, try to exit usefully/safely

Bryan O'Sullivan bos at serpentine.com
Thu Apr 11 15:30:49 CDT 2013


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1365712231 25200
#      Thu Apr 11 13:30:31 2013 -0700
# Node ID dbcff0d4ff471fea5f2aae5a38aae36e367641b1
# Parent  3d2ead77daf3f2ec8a49fa4baf0cfb69e20fbaa6
worker: catch all exceptions, try to exit usefully/safely

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -89,6 +89,11 @@
                 os._exit(0)
             except KeyboardInterrupt:
                 os._exit(255)
+            except: # re-raises (close enough for debugging anyway)
+                try:
+                    ui.traceback()
+                finally:
+                    os._exit(255)
         pids.append(pid)
     pids.reverse()
     os.close(wfd)


More information about the Mercurial-devel mailing list