~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2009-07-06 08:39:58 UTC
  • mto: This revision was merged to the branch mainline in revision 4566.
  • Revision ID: mbp@sourcefrog.net-20090706083958-1qqtqc0eik4d4ow5
Very basic support for 'reconfigure --stacked-on'

Show diffs side-by-side

added added

removed removed

Lines of Context:
5255
5255
            stacked_on=None):
5256
5256
        directory = bzrdir.BzrDir.open(location)
5257
5257
        if stacked_on is not None:
5258
 
            pass
 
5258
            branch = directory.open_branch()
 
5259
            # it may be a path relative to the cwd or a url; the branch wants
 
5260
            # a path relative to itself...
 
5261
            on_url = urlutils.relative_url(branch.base,
 
5262
                urlutils.normalize_url(stacked_on))
 
5263
            branch.lock_write()
 
5264
            try:
 
5265
                branch.set_stacked_on_url(on_url)
 
5266
                if not is_quiet():
 
5267
                    self.outf.write(
 
5268
                        "%s is now stacked on %s\n"
 
5269
                        % (branch.base,
 
5270
                           branch.get_stacked_on_url()))
 
5271
            finally:
 
5272
                branch.unlock()
5259
5273
        # At the moment you can use --stacked-on and a different
5260
5274
        # reconfiguration shape at the same time; there seems no good reason
5261
5275
        # to ban it.