# HG changeset patch # User Atul Varma # Date 1271289562 25200 # Node ID 09817175c9aaa5a5a58c47ab4672c67ed069f0ce # Parent 97b3eb038314df9bec7ca89e3424d58b5c7b15c5 fixed a bug where patches with no header and multiple files had their first file diff removed. diff -r 97b3eb038314 -r 09817175c9aa bzpatch.py --- 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