From 34b207979986fb5ea7805f938b947f2680e38082 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Sat, 24 Aug 2013 11:06:11 +0200 Subject: [PATCH] GitRepository: allow to use '..' instead of '...' The symmetric difference isn't always useful since it includes changes from both branches. See #680705. --- gbp/git/repository.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 502a391..3fe8d6f 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1443,14 +1443,27 @@ class GitRepository(object): 'files' : files} #{ Patches - def format_patches(self, start, end, output_dir, signature=True, thread=None): + def format_patches(self, start, end, output_dir, + signature=True, + thread=None, + symmetric=True): """ - Output the commits between start and end as patches in output_dir + Output the commits between start and end as patches in output_dir. + + This outputs the revisions I{start...end} by default. When using + I{symmetric} to C{false} it uses I{start..end} instead. + + @param start: the commit on the left side of the revision range + @param end: the commit on the right hand side of the revisino range + @param output_dir: directory to write the patches to + @param signature: whether to output a signature + @param thread: whether to include In-Reply-To references + @param symmetric: whether to use the symmetric difference (see above) """ options = GitArgs('-N', '-k', '-o', output_dir) options.add_cond(not signature, '--no-signature') - options.add('%s...%s' % (start, end)) + options.add('%s%s%s' % (start, '...' if symmetric else '..', end)) options.add_cond(thread, '--thread=%s' % thread, '--no-thread') output, ret = self._git_getoutput('format-patch', options.args) -- 2.7.4