~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/directory_service.py

  • Committer: Vincent Ladeuil
  • Date: 2013-05-27 10:22:27 UTC
  • mfrom: (6571.2.1 cmdline-empty-quotes)
  • mto: This revision was merged to the branch mainline in revision 6578.
  • Revision ID: v.ladeuil+lp@free.fr-20130527102227-qfc5dwoz41j5fk1z
Finish cleanup including merging original Ross fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
lazy_import(globals(), """
31
31
from bzrlib import (
32
32
    branch as _mod_branch,
 
33
    controldir as _mod_controldir,
33
34
    urlutils,
34
35
    )
35
36
""")
131
132
 
132
133
directories.register(':', AliasDirectory,
133
134
                     'Easy access to remembered branch locations')
 
135
 
 
136
 
 
137
class ColocatedDirectory(object):
 
138
    """Directory lookup for colocated branches.
 
139
 
 
140
    co:somename will resolve to the colocated branch with "somename" in
 
141
    the current directory.
 
142
    """
 
143
 
 
144
    def look_up(self, name, url):
 
145
        dir = _mod_controldir.ControlDir.open_containing('.')[0]
 
146
        return urlutils.join_segment_parameters(dir.user_url,
 
147
            {"branch": urlutils.escape(name)})
 
148
 
 
149
 
 
150
directories.register('co:', ColocatedDirectory,
 
151
                     'Easy access to colocated branches')
 
152