~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/controldir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    revision as _mod_revision,
32
32
    transport as _mod_transport,
33
33
    ui,
 
34
    urlutils,
34
35
    )
35
36
from bzrlib.push import (
36
37
    PushResult,
273
274
        except errors.NotBranchError:
274
275
            return False
275
276
 
 
277
    def _get_selected_branch(self):
 
278
        """Return the name of the branch selected by the user.
 
279
 
 
280
        :return: Name of the branch selected by the user, or None.
 
281
        """
 
282
        branch = self.root_transport.get_segment_parameters().get("branch")
 
283
        if branch is not None:
 
284
            branch = urlutils.unescape(branch)
 
285
        return branch
 
286
 
276
287
    def has_workingtree(self):
277
288
        """Tell if this controldir contains a working tree.
278
289