~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-08-30 05:52:49 UTC
  • Revision ID: mbp@sourcefrog.net-20050830055249-ec41071769f5541c
- assertions and documentation for copy_branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1451
1451
def copy_branch(branch_from, to_location, revision=None):
1452
1452
    """Copy branch_from into the existing directory to_location.
1453
1453
 
1454
 
    If revision is not None, the head of the new branch will be revision.
 
1454
    revision
 
1455
        If not None, only revisions up to this point will be copied.
 
1456
        The head of the new branch will be that revision.
 
1457
 
 
1458
    to_location
 
1459
        The name of a local directory that exists but is empty.
1455
1460
    """
1456
1461
    from bzrlib.merge import merge
1457
1462
    from bzrlib.branch import Branch
 
1463
 
 
1464
    assert isinstance(branch_from, Branch)
 
1465
    assert isinstance(to_location, basestring)
 
1466
    
1458
1467
    br_to = Branch(to_location, init=True)
1459
1468
    br_to.set_root_id(branch_from.get_root_id())
1460
1469
    if revision is None: