diff options
| author | Colin Walters <walters@verbum.org> | 2010-03-01 17:23:22 -0500 |
|---|---|---|
| committer | Colin Walters <walters@verbum.org> | 2010-03-01 17:23:22 -0500 |
| commit | 5ca9f31da121d2d998edf2e70221f16f444d537a (patch) | |
| tree | 6cb7b05e37c330fc931c6ac2810209cbbfd2e042 | |
| parent | d5e761791ce4e6b5074317a0f3fc4cd9b399bbcd (diff) | |
| download | fedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.tar.gz fedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.tar.xz fedpkg-make-pull-5ca9f31da121d2d998edf2e70221f16f444d537a.zip | |
[fedpkg-vcs] Change expected VCS scheme closer to maven
Now require a type in front.
| -rwxr-xr-x | fedpkg-vcs | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -63,14 +63,21 @@ class Vcs(object): subprocess.check_call(*args, **kwargs) @classmethod - def new_from_url(cls, url): + def new_from_spec(cls, spec): + """See http://maven.apache.org/scm/scm-url-format.html ; we use this format, + but without the "scm:" prefix.""" + # Hack for backwards compatibility + if spec.startswith('git://'): + (vcstype, url) = ('git', spec) + else: + (vcstype, url) = spec.split(':', 1) orig = urlparse.urlsplit(url) # We want to support fragments, even if the URL type isn't recognized. So change the # scheme to http temporarily. temp = urlparse.urlunsplit(('http', orig.netloc, orig.path, orig.query, orig.fragment)) new = urlparse.urlsplit(temp) combined = urlparse.SplitResult(orig.scheme, new.netloc, new.path, new.query, new.fragment) - if combined.scheme == 'git': + if vcstype == 'git': return GitVcs(combined) class GitVcs(Vcs): @@ -453,7 +460,7 @@ def main(): sys.stderr.write(unicode(e) + '\n') sys.exit(1) - vcs = Vcs.new_from_url(vcsurl) + vcs = Vcs.new_from_spec(vcsurl) vcsdir = '%s.%s' % (spec.get_name(), vcs.get_scheme()) opts = {'force': force, |
