Beispiel #1
0
 def instance(self, ui, url, create, intents=None, createopts=None):
     url = self.resolve(url)
     return hg._peerlookup(url).instance(ui,
                                         url,
                                         create,
                                         intents=intents,
                                         createopts=createopts)
Beispiel #2
0
def expandscheme(ui, url, **opts):
    """given a repo path, provide the scheme-expanded path
    """
    repo = hg._peerlookup(url)
    if isinstance(repo, ShortRepository):
        url = repo.resolve(url)
    ui.write(url + '\n')
Beispiel #3
0
def expandscheme(ui, url, **opts):
    """given a repo path, provide the scheme-expanded path
    """
    repo = hg._peerlookup(url)
    if isinstance(repo, ShortRepository):
        url = repo.resolve(url)
    ui.write(url + '\n')
Beispiel #4
0
 def instance(self, ui, url, create):
     # Should this use urlmod.url(), or is manual parsing better?
     url = url.split('://', 1)[1]
     parts = url.split('/', self.parts)
     if len(parts) > self.parts:
         tail = parts[-1]
         parts = parts[:-1]
     else:
         tail = ''
     context = dict((str(i + 1), v) for i, v in enumerate(parts))
     url = ''.join(self.templater.process(self.url, context)) + tail
     return hg._peerlookup(url).instance(ui, url, create)
Beispiel #5
0
 def instance(self, ui, url, create):
     # Should this use urlmod.url(), or is manual parsing better?
     url = url.split('://', 1)[1]
     parts = url.split('/', self.parts)
     if len(parts) > self.parts:
         tail = parts[-1]
         parts = parts[:-1]
     else:
         tail = ''
     context = dict((str(i + 1), v) for i, v in enumerate(parts))
     url = ''.join(self.templater.process(self.url, context)) + tail
     return hg._peerlookup(url).instance(ui, url, create)
Beispiel #6
0
 def instance(self, ui, url, create):
     # Should this use the util.url class, or is manual parsing better?
     try:
         url = url.split('://', 1)[1]
     except IndexError:
         raise util.Abort(_("no '://' in scheme url '%s'") % url)
     parts = url.split('/', self.parts)
     if len(parts) > self.parts:
         tail = parts[-1]
         parts = parts[:-1]
     else:
         tail = ''
     context = dict((str(i + 1), v) for i, v in enumerate(parts))
     url = ''.join(self.templater.process(self.url, context)) + tail
     return hg._peerlookup(url).instance(ui, url, create)
Beispiel #7
0
    def instance(self, ui, path, create):
        path_pieces = path.split(":", 1)
        if len(path_pieces) <= 1:
            return None

        suffix = path_pieces[1]
        if suffix.startswith("//"):
            suffix = suffix[2:]

        path_full = urlcombine(self.prefix, suffix)
        try:
            # Mercurial >= 1.9
            return hg._peerlookup(path_full).instance(ui, path_full, create)
        except AttributeError:
            # Mercurial <= 1.8
            return hg._lookup(path_full).instance(ui, path_full, create)
Beispiel #8
0
    def instance(self, ui, path, create):
        path_pieces = path.split(":", 1)
        if len(path_pieces) <= 1:
            return None

        suffix = path_pieces[1]
        if suffix.startswith("//"):
            suffix = suffix[2:]

        path_full = urlcombine(self.prefix, suffix)
        try:
            # Mercurial >= 1.9
            return hg._peerlookup(path_full).instance(ui, path_full, create)
        except AttributeError:
            # Mercurial <= 1.8
            return hg._lookup(path_full).instance(ui, path_full, create)
Beispiel #9
0
 def instance(self, ui, url, create):
     url = self.resolve(url)
     return hg._peerlookup(url).instance(ui, url, create)
Beispiel #10
0
 def instance(self, ui, url, create):
     url = self.resolve(url)
     return hg._peerlookup(url).instance(ui, url, create)