From 07cf37678bcaf3691991d1f15e7d35b9241e9225 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 11 Aug 2010 19:53:05 -0700 Subject: Add a giturl command This prints out the url that would be passed to koji to do the build. --- src/pyfedpkg/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/pyfedpkg') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 8ab50e4..0e78f53 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1112,6 +1112,14 @@ class PackageModule: return f raise FedpkgError('No spec file found.') + def giturl(self): + """Return the git url that would be used for building""" + + # Get the commit hash + commit = self.repo.iter_commits().next().sha + url = ANONGITURL % {'module': self.module} + '?#%s' % commit + return url + def koji_upload(self, file, path, callback=None): """Upload a file to koji -- cgit