~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

bugfix from Aaron Bentley - bzrlib.graph.max_distance had an off-by-1 error

Show diffs side-by-side

added added

removed removed

Lines of Context:
1331
1331
    return gen_file_id('TREE_ROOT')
1332
1332
 
1333
1333
 
1334
 
def copy_branch(branch_from, to_location, revision=None):
 
1334
def copy_branch(branch_from, to_location, revno=None):
1335
1335
    """Copy branch_from into the existing directory to_location.
1336
1336
 
1337
1337
    revision
1342
1342
        The name of a local directory that exists but is empty.
1343
1343
    """
1344
1344
    from bzrlib.merge import merge
1345
 
    from bzrlib.revisionspec import RevisionSpec
1346
1345
 
1347
1346
    assert isinstance(branch_from, Branch)
1348
1347
    assert isinstance(to_location, basestring)
1349
1348
    
1350
1349
    br_to = Branch.initialize(to_location)
1351
1350
    br_to.set_root_id(branch_from.get_root_id())
1352
 
    if revision is None:
 
1351
    if revno is None:
1353
1352
        revno = branch_from.revno()
1354
 
    else:
1355
 
        revno, rev_id = RevisionSpec(revision).in_history(branch_from)
1356
1353
    br_to.update_revisions(branch_from, stop_revision=revno)
1357
1354
    merge((to_location, -1), (to_location, 0), this_dir=to_location,
1358
1355
          check_clean=False, ignore_zero=True)