view tests/test-dispatch.py @ 22765:55dcc7fb731c

log: do not hide the public phase in debug mode (BC) When 51fc43253a52 introduced phases to the `hg log --debug` output, it also disabled outputting public phase. At the same time, it always shows phases in the default template, `hg log --debug -T default`. Those two should produce the same output, but they don't. I think it makes a lot more sense to always show all phases. There's already loss of backwards compatibility in this case when using a newer hg on an old hg repo, since draft commits will show up in the output of `hg log --debug`. Finally, I just don't think that any sort of information should be hidden with --debug. This flag should be about showing as much information as possible.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sat, 04 Oct 2014 16:28:28 -0400
parents 08bfec2ef031
children 06245740b408
line wrap: on
line source

import os
from mercurial import dispatch

def testdispatch(cmd):
    """Simple wrapper around dispatch.dispatch()

    Prints command and result value, but does not handle quoting.
    """
    print "running: %s" % (cmd,)
    req = dispatch.request(cmd.split())
    result = dispatch.dispatch(req)
    print "result: %r" % (result,)


testdispatch("init test1")
os.chdir('test1')

# create file 'foo', add and commit
f = open('foo', 'wb')
f.write('foo\n')
f.close()
testdispatch("add foo")
testdispatch("commit -m commit1 -d 2000-01-01 foo")

# append to file 'foo' and commit
f = open('foo', 'ab')
f.write('bar\n')
f.close()
testdispatch("commit -m commit2 -d 2000-01-02 foo")

# check 88803a69b24 (fancyopts modified command table)
testdispatch("log -r 0")
testdispatch("log -r tip")