예제 #1
0
    def _vcs_split_rev_from_url(url, pop_prefix=False):
        scheme, netloc, path, query, frag = urlsplit(url)

        scheme = scheme.split('+', 1)[-1]

        # Some fragment identification fails
        path = path.split('#', 1)[0]

        rev = None
        if '@' in path:
            path, rev = path.rsplit('@', 1)

        # Also, discard fragment
        url = urlunsplit((scheme, netloc, path, query, ''))

        return url, rev
예제 #2
0
    def _vcs_split_rev_from_url(url, pop_prefix=False):
        scheme, netloc, path, query, frag = urlsplit(url)

        scheme = scheme.split('+', 1)[-1]

        # Some fragment identification fails
        path = path.split('#',1)[0]

        rev = None
        if '@' in path:
            path, rev = path.rsplit('@', 1)

        # Also, discard fragment
        url = urlunsplit((scheme, netloc, path, query, ''))

        return url, rev
예제 #3
0
=======
        scheme, netloc, path, query, frag = urllib.parse.urlsplit(url)
>>>>>>> 54eef0be98b1b67c8507db91f4cfa90b64991027

        scheme = scheme.split('+', 1)[-1]

        # Some fragment identification fails
        path = path.split('#',1)[0]

        rev = None
        if '@' in path:
            path, rev = path.rsplit('@', 1)

        # Also, discard fragment
<<<<<<< HEAD
        url = urlunsplit((scheme, netloc, path, query, ''))
=======
        url = urllib.parse.urlunsplit((scheme, netloc, path, query, ''))
>>>>>>> 54eef0be98b1b67c8507db91f4cfa90b64991027

        return url, rev

    def _download_git(self, url, filename):
        filename = filename.split('#',1)[0]
        url, rev = self._vcs_split_rev_from_url(url, pop_prefix=True)

        self.info("Doing git clone from %s to %s", url, filename)
        os.system("git clone --quiet %s %s" % (url, filename))

        if rev is not None:
            self.info("Checking out %s", rev)