##// END OF EJS Templates
schemes: extract scheme expansion as its own method on ShortRepository
Jason R. Coombs -
r27981:d630eac3 default
parent child Browse files
Show More
@@ -65,6 +65,10 b' class ShortRepository(object):'
65 return '<ShortRepository: %s>' % self.scheme
65 return '<ShortRepository: %s>' % self.scheme
66
66
67 def instance(self, ui, url, create):
67 def instance(self, ui, url, create):
68 url = self.resolve(url)
69 return hg._peerlookup(url).instance(ui, url, create)
70
71 def resolve(self, url):
68 # Should this use the util.url class, or is manual parsing better?
72 # Should this use the util.url class, or is manual parsing better?
69 try:
73 try:
70 url = url.split('://', 1)[1]
74 url = url.split('://', 1)[1]
@@ -77,8 +81,7 b' class ShortRepository(object):'
77 else:
81 else:
78 tail = ''
82 tail = ''
79 context = dict((str(i + 1), v) for i, v in enumerate(parts))
83 context = dict((str(i + 1), v) for i, v in enumerate(parts))
80 url = ''.join(self.templater.process(self.url, context)) + tail
84 return ''.join(self.templater.process(self.url, context)) + tail
81 return hg._peerlookup(url).instance(ui, url, create)
82
85
83 def hasdriveletter(orig, path):
86 def hasdriveletter(orig, path):
84 if path:
87 if path:
General Comments 0
You need to be logged in to leave comments. Login now