Source

repoman / tests / output / extensions.py

Full commit
import os

from tests.pytest import run, Quiet

os.mkdir('extensiontest')
with Quiet():
    run('clone ../forest1 -M * -b core/dev -d extensiontest/foo')

os.chdir('extensiontest')
try:
    with open('extensions_test.py', 'w') as f:
        f.write('''import mercurial.commands
    
def manifest(ui, f):
    for mod in f:
        ui.write_module_header(mod)
        mercurial.commands.manifest(ui, f[mod])

cmdtable = {
    'manifest': (manifest, [], [], 'show manifest for each module')
}
''')

    print
    print 'running extension command'
    os.chdir('foo')
    try:
        run('--config "repo-extensions.manifest=../extensions_test.py" -M c manifest -M a')
    finally:
        os.chdir('..')
finally:
    os.chdir('..')