~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-12 08:33:58 UTC
  • mfrom: (4948.3.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100112083358-3q0c7ngiwtja7qba
(igc) branch --bind option

Show diffs side-by-side

added added

removed removed

Lines of Context:
1180
1180
                    ' directory exists, but does not already'
1181
1181
                    ' have a control directory.  This flag will'
1182
1182
                    ' allow branch to proceed.'),
 
1183
        Option('bind',
 
1184
            help="Bind new branch to from location."),
1183
1185
        ]
1184
1186
    aliases = ['get', 'clone']
1185
1187
 
1186
1188
    def run(self, from_location, to_location=None, revision=None,
1187
1189
            hardlink=False, stacked=False, standalone=False, no_tree=False,
1188
 
            use_existing_dir=False, switch=False):
 
1190
            use_existing_dir=False, switch=False, bind=False):
1189
1191
        from bzrlib import switch as _mod_switch
1190
1192
        from bzrlib.tag import _merge_tags_if_possible
1191
1193
        accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
1244
1246
        except (errors.NotStacked, errors.UnstackableBranchFormat,
1245
1247
            errors.UnstackableRepositoryFormat), e:
1246
1248
            note('Branched %d revision(s).' % branch.revno())
 
1249
        if bind:
 
1250
            # Bind to the parent
 
1251
            parent_branch = Branch.open(from_location)
 
1252
            branch.bind(parent_branch)
 
1253
            note('New branch bound to %s' % from_location)
1247
1254
        if switch:
1248
1255
            # Switch to the new branch
1249
1256
            wt, _ = WorkingTree.open_containing('.')