Source

repoman / tests / output / branchencoding.py

# coding: cp1252
import os
import shutil
from mercurial import encoding
from repoman import cmdutil
from tests.pytest import run, Quiet

def get_commit_message(forest, text=[''], extra=[]):
    return u'fancy commit message'.encode(encoding.encoding)

with Quiet():
    run('clone ../forest1 -d forest2 -b core/dev -M *')
    run('-R forest2 branch --create core/זרו -d "0 0"')

orig_gcm = cmdutil.get_commit_message
cmdutil.get_commit_message = get_commit_message

try:
    run('-R forest2 info')

    with open('forest2/a/foo', 'ab') as f:
        f.write('foo\r\n')
    run('-R forest2 commit -d "0 0" -m')

    run('-R forest2 info')
    run('-R forest2 out ../forest1')
finally:
    cmdutil.get_commit_message = orig_gcm
    shutil.rmtree('forest2')