~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clone.py

  • Committer: Martin Pool
  • Date: 2005-09-30 00:58:02 UTC
  • mto: (1185.14.2)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: mbp@sourcefrog.net-20050930005802-721cfc318e393817
- copy_branch creates destination if it doesn't exist

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# all the whole weaves and revisions, rather than getting one
19
19
# revision at a time.
20
20
 
 
21
import os
21
22
import sys
22
 
import os
23
23
 
24
24
from bzrlib.merge import build_working_dir
25
25
from bzrlib.branch import Branch
34
34
        The head of the new branch will be that revision.  Must be a
35
35
        revid or None.
36
36
 
37
 
    to_location
38
 
        The name of a local directory that exists but is empty.
 
37
    to_location -- The destination directory; must either exist and be 
 
38
        empty, or not exist, in which case it is created.
39
39
 
40
40
    revno
41
41
        The revision to copy up to
45
45
    """
46
46
    assert isinstance(branch_from, Branch)
47
47
    assert isinstance(to_location, basestring)
48
 
    
 
48
    if not os.path.exists(to_location):
 
49
        os.mkdir(to_location)
49
50
    br_to = Branch.initialize(to_location)
50
51
    mutter("copy branch from %s to %s", branch_from, br_to)
51
52
    if basis_branch is not None: