Mercurial > pybugzilla
changeset 23:09817175c9aa
fixed a bug where patches with no header and multiple files had their first file diff removed.
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Wed, 14 Apr 2010 16:59:22 -0700 |
parents | 97b3eb038314 |
children | 96f841399b40 |
files | bzpatch.py |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bzpatch.py Tue Apr 13 22:33:53 2010 -0700 +++ b/bzpatch.py Wed Apr 14 16:59:22 2010 -0700 @@ -13,8 +13,19 @@ >>> strip_patch_header('sup') 'sup' + + >>> print strip_patch_header('diff --git\\n' + ... 'bleh\\n' + ... 'diff --git\\n' + ... 'yo') + diff --git + bleh + diff --git + yo """ - + + if patch.startswith('diff'): + return patch index = patch.find('\ndiff') if index == -1: return patch