Source

repoman / tests / output / commit.py

# coding: cp1252
import os
from mercurial import encoding

from repoman import cmdutil

from tests.pytest import run, Quiet

def get_commit_message(forest, text=[''], extra=[]):
    return u'fancy c\xf8mmit message\r\n'.encode(encoding.encoding) + '\r\n'.join(extra)

with Quiet():
    run('clone ../forest1 -M * -b core/dev -d committest')
os.chdir('committest')

orig_gcm = cmdutil.get_commit_message
cmdutil.get_commit_message = get_commit_message

try:
    with open(os.path.join('a', 'foo'), 'ab') as f:
        f.write('foo\r\n')
    with open(os.path.join('a', 'křdpĺlćg'), 'ab') as f:
        f.write('foo\r\n')
    with open(os.path.join('b', 'foo'), 'ab') as f:
        f.write('foo\r\n')
    os.system('hg add --cwd a křdpĺlćg')

    run('status')
    run('commit -m -d "0 0"')
    run('parents --template "{rev}:{node|short}  {author}  {date|isodate}\n{desc}\n"')

    run('commit -m')
finally:
    cmdutil.get_commit_message = orig_gcm
    os.chdir('..')