diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-03-11 18:08:58 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-03-12 23:12:22 +0100 |
commit | 40f4709668425b03b9f59c28176547c313957715 (patch) | |
tree | 166980187712abd948005dce6b348899956a0a8b /gbp | |
parent | 9bb73b46d2f215dc70482e55311a64debeca4d6e (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.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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""" |