diff options
author | Jochen Schmitt <Jochen@herr-schmitt.de> | 2010-08-31 16:53:44 +0200 |
---|---|---|
committer | Jochen Schmitt <Jochen@herr-schmitt.de> | 2010-09-02 19:38:24 +0200 |
commit | 6fe559212e655b09f17fc38f63a0f6bf2158da76 (patch) | |
tree | 22c6a35a549069ff2dc5867c540ca83b7aeb141f | |
parent | da1b2e516deb5d44b9991d6ad24c2d7de27a70c5 (diff) | |
download | fedora-packager-6fe559212e655b09f17fc38f63a0f6bf2158da76.tar.gz fedora-packager-6fe559212e655b09f17fc38f63a0f6bf2158da76.tar.xz fedora-packager-6fe559212e655b09f17fc38f63a0f6bf2158da76.zip |
Implementation of a pull command
-rw-r--r-- | src/fedpkg.bash | 2 | ||||
-rwxr-xr-x | src/fedpkg.py | 13 | ||||
-rw-r--r-- | src/pyfedpkg/__init__.py | 7 |
3 files changed, 21 insertions, 1 deletions
diff --git a/src/fedpkg.bash b/src/fedpkg.bash index 04cdcfe..11fc147 100644 --- a/src/fedpkg.bash +++ b/src/fedpkg.bash @@ -11,7 +11,7 @@ _fedpkg() # define all available commands to complete commands='help build chain-build clean clog clone co commit ci compile \ diff gimmespec giturl import install lint local mockbuild new new-sources \ - patch prep push scratch-build sources srpm switch-branch tag tag-request \ + patch prep push pull scratch-build sources srpm switch-branch tag tag-request \ unused-patches update upload verrel' if [[ $COMP_CWORD -eq 1 ]] ; then diff --git a/src/fedpkg.py b/src/fedpkg.py index 09bcd36..eb7250f 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -596,6 +596,14 @@ def push(args): log.error('Could not push: %s' % e) sys.exit(1) +def pull(args): + try: + mymodule = pyfedpkg.PackageModule(args.path) + mymodule.pull() + except pyfedpkg.FedpkgError, e: + log.error('Could not pull: %s' % e) + sys.exit(1) + def tag(args): try: mymodule = pyfedpkg.PackageModule(args.path) @@ -1030,6 +1038,11 @@ packages will be built sequentially. help = 'Push changes to remote repository') parser_push.set_defaults(command = push) + # Pusllstuff + parser_pull = subparsers.add_parser('pull', + help = 'Pull changes to remote repository') + parser_pull.set_defaults(command = pull) + # 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 b84b74f..1936f2c 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1532,6 +1532,13 @@ class PackageModule: _run_command(cmd) return + def pull(self): + """Pull changes from the main repository""" + + cmd = ['git', 'pull'] + _run_command(cmd) + return + def srpm(self, hashtype=None): """Create an srpm using hashtype from content in the module |