~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to mirror.py

  • Committer: Robert Collins
  • Date: 2005-09-07 13:02:59 UTC
  • mto: (147.2.6) (364.1.3 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: robertc@robertcollins.net-20050907130259-35bb613478f3ec74
start adding baz_import unit test cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from bzrlib.transport import get_transport
2
 
 
3
 
 
4
 
def create_mirror(source_branch, target_location, possible_transports):
5
 
    possible_transports.append(source_branch.bzrdir.root_transport)
6
 
    t = get_transport(target_location, possible_transports)
7
 
    mirror = source_branch.bzrdir.clone_on_transport(t).open_branch()
8
 
    mirror.set_public_branch(source_branch.base)
9
 
    mirror.set_parent(source_branch.base)
10
 
    if source_branch.get_config().has_explicit_nickname():
11
 
        mirror.nick = source_branch.nick
12
 
    mirror.set_submit_branch(source_branch.get_submit_branch())
13
 
    source_config = source_branch.get_config()
14
 
    child_submit_to = source_config.get_user_option('child_submit_to')
15
 
    if child_submit_to is not None:
16
 
        mirror.get_config().set_user_option('child_submit_to', child_submit_to)
17
 
    return mirror