diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/fedpkg.py | 6 | ||||
-rw-r--r-- | src/pyfedpkg/__init__.py | 28 |
2 files changed, 16 insertions, 18 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index 257d7a7..8fc21ad 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -600,16 +600,14 @@ def prep(args): def pull(args): try: - mymodule = pyfedpkg.PackageModule(args.path) - mymodule.pull() + pyfedpkg.pull() except pyfedpkg.FedpkgError, e: log.error('Could not push: %s' % e) sys.exit(1) def push(args): try: - mymodule = pyfedpkg.PackageModule(args.path) - mymodule.push() + pyfedpkg.push() except pyfedpkg.FedpkgError, e: log.error('Could not push: %s' % e) sys.exit(1) diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 790cb93..a49f4ed 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -638,6 +638,20 @@ def new(path=None): log.debug('Diffing from tag %s' % tag) return repo.git.diff('-M', tag) +def pull(): + """Pull changes from the main repository""" + + cmd = ['git', 'pull'] + _run_command(cmd) + return + +def push(): + """Push changes to the main repository""" + + cmd = ['git', 'push'] + _run_command(cmd) + return + def sources(path, outdir=None): """Download source files""" @@ -1544,20 +1558,6 @@ class PackageModule: _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""" - - cmd = ['git', 'push'] - _run_command(cmd) - return - def srpm(self, hashtype=None): """Create an srpm using hashtype from content in the module |