/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/directory_service.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-17 00:47:52 UTC
  • mfrom: (7182 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20181117004752-6ywampe5pfywlby4
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        service, name = match
86
86
        return service().look_up(name, url)
87
87
 
 
88
 
88
89
directories = DirectoryServiceRegistry()
89
90
 
 
91
 
90
92
class AliasDirectory(object):
91
93
    """Directory lookup for locations associated with a branch.
92
94
 
96
98
 
97
99
    branch_aliases = registry.Registry()
98
100
    branch_aliases.register('parent', lambda b: b.get_parent(),
99
 
        help="The parent of this branch.")
 
101
                            help="The parent of this branch.")
100
102
    branch_aliases.register('submit', lambda b: b.get_submit_branch(),
101
 
        help="The submit branch for this branch.")
 
103
                            help="The submit branch for this branch.")
102
104
    branch_aliases.register('public', lambda b: b.get_public_branch(),
103
 
        help="The public location of this branch.")
 
105
                            help="The public location of this branch.")
104
106
    branch_aliases.register('bound', lambda b: b.get_bound_location(),
105
 
        help="The branch this branch is bound to, for bound branches.")
 
107
                            help="The branch this branch is bound to, for bound branches.")
106
108
    branch_aliases.register('push', lambda b: b.get_push_location(),
107
 
        help="The saved location used for `brz push` with no arguments.")
 
109
                            help="The saved location used for `brz push` with no arguments.")
108
110
    branch_aliases.register('this', lambda b: b.base,
109
 
        help="This branch.")
 
111
                            help="This branch.")
110
112
 
111
113
    def look_up(self, name, url):
112
114
        branch = _mod_branch.Branch.open_containing('.')[0]
164
166
    def look_up(self, name, url):
165
167
        dir = _mod_controldir.ControlDir.open_containing('.')[0]
166
168
        return urlutils.join_segment_parameters(dir.user_url,
167
 
            {"branch": urlutils.escape(name)})
 
169
                                                {"branch": urlutils.escape(name)})
168
170
 
169
171
 
170
172
directories.register('co:', ColocatedDirectory,
171
173
                     'Easy access to colocated branches')
172