1. Henrik Stuart
  2. repoman

Source

repoman / tests / output / pullpartialbranch.py

import os
import shutil

from tests.pytest import run, Quiet

def append(path, text):
    with file(path, 'ab') as f:
        f.write(text)

with Quiet() as _:
    run('clone ../forest1 -M * -b * -d forest2')
    run('clone forest2 -M * -b * -d forest3')
    run('-R forest2 up core/dev')

try:
    run('-R forest2 branch -c core/restricted -M a -M b -M c')
    run('-R forest2 branch -c core/full')

    append('forest2/d/foo', 'a new line added!\n')
    os.system('hg -R forest2/d ci -d "0 0" -m change')

    os.system('hg -R forest3/d glog')
    run('-R forest3 pull -b core/restricted')
    os.system('hg -R forest3/d glog')
finally:
    try:
        shutil.rmtree('forest2')
        shutil.rmtree('forest3')
    except Exception:
        pass