From 21ca17d3cd79e4f9887a51dff672cc0a47e11ae9 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 9 Feb 2011 15:39:10 -0700 Subject: Add a --rebase and --no-rebase option to pull I decided to emulate git here and not default to a rebase. --- src/pyfedpkg/__init__.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/pyfedpkg/__init__.py') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 8696026..dcea285 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -710,12 +710,22 @@ def new(path=None): log.debug('Diffing from tag %s' % tag) return repo.git.diff('-M', tag) -def pull(path=None): - """Pull changes from the main repository using optional path""" +def pull(path=None, rebase=False, norebase=False): + """Pull changes from the main repository using optional path + + Optionally rebase current branch on top of upstream branch + + Optionally override .git setting to always rebase + + """ if not path: path = os.getcwd() cmd = ['git', 'pull'] + if rebase: + cmd.append('--rebase') + if norebase: + cmd.append('--no-rebase') _run_command(cmd, cwd=path) return -- cgit