changeset 5198:f5ca981918d9

repository: grok git+http/http+git urls.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Fri, 03 Apr 2009 19:41:29 +0200
parents 41cf21ecdef6
children 733bb1c087fd
files gub/repository.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gub/repository.py	Fri Apr 03 19:38:38 2009 +0200
+++ b/gub/repository.py	Fri Apr 03 19:41:29 2009 +0200
@@ -115,7 +115,9 @@
     def check_url (rety, url):
         vcs = rety.vc_system.replace ('_', '',).replace ('.', '').lower ()
         return url and (url.startswith (vcs + ':')
-                        or url.startswith (vcs + '+'))
+                        or url.startswith (vcs + '+')
+                        or url.startswith ('http' + '+' + vcs)
+                        or url.startswith ('ssh' + '+' + vcs))
     @staticmethod
     def check_suffix (rety, url):
         return url and url.endswith (rety.vc_system)
@@ -499,6 +501,9 @@
             self.url_host = u.host
             self.url_dir = u.dir.replace ('~', '_')
             self.source = self.source.replace ('git+file://' + u.host, '')
+            # ``I don't handle protocol git+http/http+git''
+            self.source = self.source.replace ('git+http://', 'http://')
+            self.source = self.source.replace ('http+git://', 'http://')
         else:
             # repository proxy determined git vcs from dir
             printf ('FIXME: get url from .git dir info')