##// END OF EJS Templates
changelog: ensure changelog._delaybuf is initialized...
changelog: ensure changelog._delaybuf is initialized The ``localrepo.writepending`` method is using the ``changelog._delaybuff`` attribute to know if it has anything to do. However the ``changelog._delaybuff`` is never initialised at ``__init__`` time. This can lead to crash when using bundle2 for part that never touch the changelog. We simply initialize it to its base value. This is scheduled for stable as it both trivial and blocking for experimenting with bundle2.

File last commit:

r21243:8b5c039f default
r21544:667df8f4 stable
Show More
debugshell.py
53 lines | 1.2 KiB | text/x-python | PythonLexer
Vishakh H
contrib: add debugshell extension
r11633 # debugshell extension
"""a python shell with repo, changelog & manifest objects"""
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773 import sys
Vishakh H
contrib: add debugshell extension
r11633 import mercurial
import code
Sean Farley
debugshell: abstract out pdb code.interact
r19771 def pdb(ui, repo, msg, **opts):
Vishakh H
contrib: add debugshell extension
r11633 objects = {
'mercurial': mercurial,
'repo': repo,
'cl': repo.changelog,
'mf': repo.manifest,
}
Sean Farley
debugshell: abstract out pdb code.interact
r19771
code.interact(msg, local=objects)
Sean Farley
debugshell: add function to embed ipython
r19772 def ipdb(ui, repo, msg, **opts):
import IPython
cl = repo.changelog
mf = repo.manifest
Matt Mackall
debugshell: appease pyflakes
r19794 cl, mf # use variables to appease pyflakes
Sean Farley
debugshell: add function to embed ipython
r19772
IPython.embed()
Sean Farley
debugshell: abstract out pdb code.interact
r19771 def debugshell(ui, repo, **opts):
Vishakh H
contrib: add debugshell extension
r11633 bannermsg = "loaded repo : %s\n" \
"using source: %s" % (repo.root,
mercurial.__path__[0])
Sean Farley
debugshell: abstract out pdb code.interact
r19771
Sean Farley
debugshell: check ui.debugger for which debugger to use
r19773 pdbmap = {
'pdb' : 'code',
'ipdb' : 'IPython'
}
debugger = ui.config("ui", "debugger")
if not debugger:
debugger = 'pdb'
# if IPython doesn't exist, fallback to code.interact
try:
__import__(pdbmap[debugger])
except ImportError:
ui.warn("%s debugger specified but %s module was not found\n"
% (debugger, pdbmap[debugger]))
debugger = 'pdb'
getattr(sys.modules[__name__], debugger)(ui, repo, bannermsg, **opts)
Vishakh H
contrib: add debugshell extension
r11633
cmdtable = {
"debugshell|dbsh": (debugshell, [])
}