Paulo Köch  committed 9943658

Add support for Mercurial URLs.

  • Participants
  • Parent commits ef1eff5
  • Branches default

Comments (0)

Files changed (1)

File setuptools/

             return self._download_svn(url, filename)
         elif scheme=='git' or scheme.startswith('git+'):
             return self._download_git(url, filename)
+        elif scheme.startswith('hg+'):
+            return self._download_hg(url, filename)
         elif scheme=='file':
             return urllib.url2pathname(urlparse.urlparse(url)[2])
         os.system("git clone -q %s %s" % (url, filename))
         return filename
+    def _download_hg(self, url, filename):
+        if url.startswith('hg+'):
+            url = url[3:]
+        url = url.split('#',1)[0]   # remove any fragment for svn's sake
+        filename = filename.split('#',1)[0]   # remove any fragment to get a decent name.
+"Doing hg clone from %s to %s", url, filename)
+        os.system("hg clone --quiet %s %s" % (url, filename))
+        return filename
     def debug(self, msg, *args):
         log.debug(msg, *args)