summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-08-24 11:06:11 +0200
committerGuido Günther <agx@sigxcpu.org>2013-08-24 11:30:22 +0200
commit34b207979986fb5ea7805f938b947f2680e38082 (patch)
treea511baee9fac1f8657b833f2ab68bfb73847867c
parent388cfb8fa9912f63168e6150a940e3a0f4cd71ed (diff)
GitRepository: allow to use '..' instead of '...'
The symmetric difference isn't always useful since it includes changes from both branches. See #680705.
-rw-r--r--gbp/git/repository.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 502a3914..3fe8d6f7 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)