##// END OF EJS Templates
amend: fix amend with copies in extras...
amend: fix amend with copies in extras If copy information is stored only in the commit extras and not in filelogs, then they get lost on amend if the file wasn't also modified in the working copy. That's because we create `filectx` object from the old commit in those cases, and the `.copysource()` of such objects read only from the filelog. This patch fixes it by always creating a new `memfilectx` in these cases, passing the calculated copy information to it. Differential Revision: https://phab.mercurial-scm.org/D12387

File last commit:

r49730:6000f5b2 default
r49833:877d7e1a stable
Show More
showstack.py
31 lines | 734 B | text/x-python | PythonLexer
Matt Mackall
contrib: add showstack extension...
r26123 # showstack.py - extension to dump a Python stack trace on signal
#
# binds to both SIGQUIT (Ctrl-\) and SIGINFO (Ctrl-T on BSDs)
Gregory Szorc
showstack: use raw docstring...
r41689 r"""dump stack trace when receiving SIGQUIT (Ctrl-\) or SIGINFO (Ctrl-T on BSDs)
Boris Feld
showstack: add an extension docstring...
r35674 """
Matt Mackall
contrib: add showstack extension...
r26123
Augie Fackler
showstack: also handle SIGALRM...
r40072 from __future__ import absolute_import, print_function
Pulkit Goyal
showstack: use absolute_import
r28522 import signal
import sys
import traceback
Matt Mackall
contrib: add showstack extension...
r26123
Augie Fackler
formatting: blacken the codebase...
r43346
Matt Mackall
contrib: add showstack extension...
r26123 def sigshow(*args):
sys.stderr.write("\n")
traceback.print_stack(args[1], limit=10, file=sys.stderr)
sys.stderr.write("----\n")
Augie Fackler
formatting: blacken the codebase...
r43346
Augie Fackler
showstack: also handle SIGALRM...
r40072 def sigexit(*args):
sigshow(*args)
print('alarm!')
sys.exit(1)
Augie Fackler
formatting: blacken the codebase...
r43346
Matt Mackall
contrib: add showstack extension...
r26123 def extsetup(ui):
signal.signal(signal.SIGQUIT, sigshow)
Augie Fackler
showstack: also handle SIGALRM...
r40072 signal.signal(signal.SIGALRM, sigexit)
Matt Mackall
contrib: add showstack extension...
r26123 try:
signal.signal(signal.SIGINFO, sigshow)
except AttributeError:
pass