repoman / tests / output / pullexpandfastforwards.py

import os

from repoman import util

from tests.pytest import run, Quiet

def run1(s):
    run('-R pullexpandtest1 ' + s)

def run2(s):
    run('-R pullexpandtest2 ' + s)

def hg1(s):
    os.system('hg -R pullexpandtest1/a ' + s)

def hg2(s):
    os.system('hg -R pullexpandtest2/a ' + s)

def update_foo(s):
    with open(os.path.join('pullexpandtest1', 'a', 'foo'), 'ab') as fh:
        fh.write(s)
    os.system('hg -R pullexpandtest1/a ci -d "0 0" -m foo')

with Quiet() as _:
    run('clone ../forest1 -M * -b * -d pullexpandtest1')
    run1('up core/dev')
    run('clone pullexpandtest1 -M * -b * -d pullexpandtest2')
    run2('up core/stable')

update_foo('foo\r\n')
#hg1('glog --template "{node}\\n{user}\\n{desc|firstline}\\n')

util.write_default(os.path.join('pullexpandtest1', '.root', 'branches', 'core', 'stable.b'), '35b4d849058a0764b9a25c85515791954ab72219 a\n0000000000000000000000000000000000000000 b\n0000000000000000000000000000000000000000 c\n0000000000000000000000000000000000000000 d\n')
os.system('hg -R pullexpandtest1/.root ci -m "Fast-forward of branch core/stable"')

run2('info')
run2('pull -b core/stable')
run2('info')

hg1('glog')
hg2('glog')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.