843
842
profiled or debugged so easily.
845
844
:param retcode: The status code that is expected. Defaults to 0. If
846
None is supplied, the status code is not checked.
845
None is supplied, the status code is not checked.
846
:param env_changes: A dictionary which lists changes to environment
847
variables. A value of None will unset the env variable.
848
The values must be strings. The change will only occur in the
849
child, so you don't need to fix the environment after running.
851
env_changes = kwargs.get('env_changes', {})
852
def cleanup_environment():
853
for env_var, value in env_changes.iteritems():
855
del os.environ[env_var]
857
os.environ[env_var] = value
848
859
bzr_path = os.path.dirname(os.path.dirname(bzrlib.__file__))+'/bzr'
849
860
args = list(args)
850
process = Popen([sys.executable, bzr_path]+args, stdout=PIPE,
861
process = Popen([sys.executable, bzr_path]+args,
862
stdout=PIPE, stderr=PIPE,
863
preexec_fn=cleanup_environment)
852
864
out = process.stdout.read()
853
865
err = process.stderr.read()
854
866
retcode = process.wait()
920
932
base_rev = common_ancestor(branch_from.last_revision(),
921
933
wt_to.branch.last_revision(),
922
934
wt_to.branch.repository)
923
merge_inner(wt_to.branch, branch_from.basis_tree(),
935
merge_inner(wt_to.branch, branch_from.basis_tree(),
924
936
wt_to.branch.repository.revision_tree(base_rev),
926
wt_to.add_pending_merge(branch_from.last_revision())
938
wt_to.add_parent_tree_id(branch_from.last_revision())
929
941
BzrTestBase = TestCase
1361
1373
'bzrlib.tests.test_progress',
1362
1374
'bzrlib.tests.test_reconcile',
1363
1375
'bzrlib.tests.test_repository',
1376
'bzrlib.tests.test_revert',
1364
1377
'bzrlib.tests.test_revision',
1365
1378
'bzrlib.tests.test_revisionnamespaces',
1366
1379
'bzrlib.tests.test_revisiontree',