aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-03-11 18:08:58 +0100
committerGuido Günther <agx@sigxcpu.org>2011-03-12 23:12:22 +0100
commit40f4709668425b03b9f59c28176547c313957715 (patch)
tree166980187712abd948005dce6b348899956a0a8b /gbp
parent9bb73b46d2f215dc70482e55311a64debeca4d6e (diff)
gbp-pq: Allow to specify subdirs for patches
via the "Gbp-Pq-Tag: <subdir>" directive in the patch header. This also gets rid sed callouts. Add "apply" action to apply single patches
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index dc648a12..e43d58f7 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -486,6 +486,17 @@ class GitRepository(object):
output, ret = self.__git_getoutput('format-patch', options)
return [ line.strip() for line in output ]
+ def apply_patch(self, patch, index=True, context=None):
+ """Apply a patch using git apply"""
+
+ args = []
+ if context:
+ args += [ '-C', context ]
+ if index:
+ args.append("--index")
+ args.append(patch)
+ GitCommand("apply", args)()
+
class FastImport(object):
"""Invoke git-fast-import"""