summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-05-18 14:33:18 +0300
committerGuido Günther <agx@sigxcpu.org>2012-06-17 10:22:37 +0200
commit36e09865e8ff0022378efe2305bd067b1ee38fc8 (patch)
treedb16ec103ac448d8de7db37b7cde052da94b5299
parent9b68e37096af76be8c00cdd9f25990fadd4765ab (diff)
common/pq: use strip in apply_and_commit_patch()
Use the strip information of the patch when applying patches. Also, changes GitRepository.apply_patch() to accept integer values as 'strip' argument. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/git/repository.py4
-rw-r--r--gbp/scripts/common/pq.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 8a99ff66..8f2aa0e0 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1226,8 +1226,8 @@ class GitRepository(object):
args += [ '-C', context ]
if index:
args.append("--index")
- if strip:
- args += [ '-p', strip ]
+ if strip != None:
+ args += [ '-p', str(strip) ]
args.append(patch)
self._git_command("apply", args)
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index e2293e87..2c4fa092 100644
--- a/gbp/scripts/common/pq.py
+++ b/gbp/scripts/common/pq.py
@@ -167,7 +167,7 @@ def apply_and_commit_patch(repo, patch, topic=None):
else:
gbp.log.warn("Patch %s has no authorship information")
- repo.apply_patch(patch.path)
+ repo.apply_patch(patch.path, strip=patch.strip)
tree = repo.write_tree()
msg = "%s\n\n%s" % (patch.subject, patch.long_desc)
if topic: