summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-20 14:05:26 -0700
committerJesse Keating <jkeating@redhat.com>2010-09-20 14:05:26 -0700
commit3810d8d56a046206628c9d906d561e2931367bf2 (patch)
treee15601ef8d1c1f92ba28a0f3f769e1f1a9af0384
parent53146ca4838576cb7383f2218d8ad3c51d9c564d (diff)
downloadfedora-packager-3810d8d56a046206628c9d906d561e2931367bf2.tar.gz
fedora-packager-3810d8d56a046206628c9d906d561e2931367bf2.tar.xz
fedora-packager-3810d8d56a046206628c9d906d561e2931367bf2.zip
Handle paths with push/pull
-rwxr-xr-xsrc/fedpkg.py4
-rw-r--r--src/pyfedpkg/__init__.py16
2 files changed, 12 insertions, 8 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py
index ecfbbf8..04b8073 100755
--- a/src/fedpkg.py
+++ b/src/fedpkg.py
@@ -620,14 +620,14 @@ def prep(args):
def pull(args):
try:
- pyfedpkg.pull()
+ pyfedpkg.pull(path=args.path)
except pyfedpkg.FedpkgError, e:
log.error('Could not push: %s' % e)
sys.exit(1)
def push(args):
try:
- pyfedpkg.push()
+ pyfedpkg.push(path=args.path)
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 9e15057..bb7449f 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -676,18 +676,22 @@ 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"""
+def pull(path=None):
+ """Pull changes from the main repository using optional path"""
+ if not path:
+ path = os.getcwd()
cmd = ['git', 'pull']
- _run_command(cmd)
+ _run_command(cmd, cwd=path)
return
-def push():
- """Push changes to the main repository"""
+def push(path=None):
+ """Push changes to the main repository using optional path"""
+ if not path:
+ path = os.getcwd()
cmd = ['git', 'push']
- _run_command(cmd)
+ _run_command(cmd, cwd=path)
return
def sources(path, outdir=None):