[PATCH 3 of 5] hg: extend warning with stack trace when debugging configured

Simon Heimberg simohe at besonet.ch
Thu Oct 4 22:03:00 CDT 2012


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1349394588 -7200
# Node ID 6d197b08a9e45eaaadecff8ce08423feb2680ddf
# Parent  ff1415eadfcf9ac09ef2284c96ee634c8d026c7a
hg: extend warning with stack trace when debugging configured

diff -r ff1415eadfcf -r 6d197b08a9e4 mercurial/hg.py
--- a/mercurial/hg.py	Don Okt 04 19:46:43 2012 +0200
+++ b/mercurial/hg.py	Fre Okt 05 01:49:48 2012 +0200
@@ -580,6 +580,11 @@
         if src.isinrepo:
             src.write_err(' PROGRAMMER WARNING: '
                           'pass repo (not repo.ui) to hg.peer\n')
+            if src.debugflag:
+                 import traceback
+                 src.write_err(' Traceback (most recent call last):\n')
+                 # print traceback ending at hg.peer, maximum 6 calls
+                 src.write_err(''.join(traceback.format_stack(limit=8)[:-2]))
 
     # copy ssh-specific options
     for o in 'ssh', 'remotecmd':


More information about the Mercurial-devel mailing list