summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-07-26 13:34:56 -0700
committerJesse Keating <jkeating@redhat.com>2010-07-26 13:34:56 -0700
commit752b39b5b5803ef9b27e366c82ced9b7669d461c (patch)
tree8883706b756e5f2cf14ce4ac6a75f71c90e3d199
parent26b2ed80839c521a6b79fafda008220918ac05b5 (diff)
downloadfedora-packager-752b39b5b5803ef9b27e366c82ced9b7669d461c.tar.gz
fedora-packager-752b39b5b5803ef9b27e366c82ced9b7669d461c.tar.xz
fedora-packager-752b39b5b5803ef9b27e366c82ced9b7669d461c.zip
Impliment pushing. Thanks Jochen@herr-schmitt.de
-rwxr-xr-xsrc/fedpkg.py16
-rw-r--r--src/pyfedpkg/__init__.py9
2 files changed, 23 insertions, 2 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index f9db3c1..ba36f26 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -419,8 +419,7 @@ def commit(args):
log.error('Could not commit: %s' % e)
sys.exit(1)
if args.push:
- # do the push command here.
- pass
+ push(args)
def compile(args):
arch = None
@@ -559,6 +558,14 @@ def prep(args):
log.error('Could not prep: %s' % e)
sys.exit(1)
+def push(args):
+ try:
+ mymodule = pyfedpkg.PackageModule(args.path)
+ mymodule.push()
+ except pyfedpkg.FedpkgError, e:
+ log.error('Could not push: %s' % e)
+ sys.exit(1)
+
def scratchbuild(args):
# A scratch build is just a build with --scratch
args.scratch = True
@@ -855,6 +862,11 @@ packages will be built sequentially.
parser_prep.add_argument('--arch', help = 'Prep for a specific arch')
parser_prep.set_defaults(command = prep)
+ # Push stuff
+ parser_push = subparsers.add_parser('push',
+ help = 'Push changes to remote repository')
+ parser_push.set_defaults(command = push)
+
# scratch build
parser_scratchbuild = subparsers.add_parser('scratch-build',
help = 'Request scratch build',
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 07b3d60..0a941ca 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1266,6 +1266,15 @@ class PackageModule:
if error:
log.error(error)
return proc.returncode
+
+ def push(self):
+ """Push changes to the main repository"""
+
+ cmd = ['git', 'push']
+ _run_command(cmd)
+ return
+
+
def sources(self, outdir=None):
"""Download source files"""