summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJochen Schmitt <Jochen@herr-schmitt.de>2010-09-16 20:05:46 +0200
committerJesse Keating <jkeating@redhat.com>2010-09-20 13:17:49 -0700
commitf9443e37b7ca3863ba79f9603d074bcd7c749abe (patch)
tree98670e6b6dbd4fb815febe3c7d8b40f6c4591d6d /src
parent16a524c980984505914635c9c232366bf5aa27d2 (diff)
downloadfedora-packager-f9443e37b7ca3863ba79f9603d074bcd7c749abe.tar.gz
fedora-packager-f9443e37b7ca3863ba79f9603d074bcd7c749abe.tar.xz
fedora-packager-f9443e37b7ca3863ba79f9603d074bcd7c749abe.zip
Implementation of a pull command
Hello Jesse, this patch implemts a pull command for fedpkg. Best Regards: Jochen Schmitt
Diffstat (limited to 'src')
-rw-r--r--src/fedpkg.bash2
-rwxr-xr-xsrc/fedpkg.py14
-rw-r--r--src/pyfedpkg/__init__.py7
3 files changed, 22 insertions, 1 deletions
diff --git a/src/fedpkg.bash b/src/fedpkg.bash
index 8c81ccc..bb57b94 100644
--- a/src/fedpkg.bash
+++ b/src/fedpkg.bash
@@ -36,7 +36,7 @@ _fedpkg()
local options="-h --help -v -q"
local options_value="-u --user --path"
local commands="build chain-build ci clean clog clone co commit compile diff gimmespec giturl help \
- import install lint local mockbuild new new-sources patch prep push scratch-build sources srpm \
+ import install lint local mockbuild new new-sources patch prep pull push scratch-build sources srpm \
switch-branch tag tag-request unused-patches update upload verrel"
# parse main options and get command
diff --git a/src/fedpkg.py b/src/fedpkg.py
index 0319c70..257d7a7 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -598,6 +598,14 @@ def prep(args):
log.error('Could not prep: %s' % e)
sys.exit(1)
+def pull(args):
+ try:
+ mymodule = pyfedpkg.PackageModule(args.path)
+ mymodule.pull()
+ except pyfedpkg.FedpkgError, e:
+ log.error('Could not push: %s' % e)
+ sys.exit(1)
+
def push(args):
try:
mymodule = pyfedpkg.PackageModule(args.path)
@@ -1024,6 +1032,12 @@ packages will be built sequentially.
parser_prep.add_argument('--arch', help = 'Prep for a specific arch')
parser_prep.set_defaults(command = prep)
+ # Pull stuff
+ parser_pull = subparsers.add_parser('pull',
+ help = 'Pull changes from remote repository')
+ parser_pull.set_defaults(command = pull)
+
+
# Push stuff
parser_push = subparsers.add_parser('push',
help = 'Push changes to remote repository')
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index c975afc..790cb93 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1543,7 +1543,14 @@ class PackageModule:
# Run the command
_run_command(cmd, shell=True)
return
+
+ def pull(self):
+ """Pull changes from the main repository"""
+ cmd = ['git', 'pull']
+ _run_command(cmd)
+ return
+
def push(self):
"""Push changes to the main repository"""