Detect description in quilt patches
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Fri, 16 Sep 2005 19:35:25 +0000 (21:35 +0200)
committerCatalin Marinas <catalin.marinas@gmail.com>
Sat, 17 Sep 2005 08:10:44 +0000 (09:10 +0100)
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

The current logic imports the whole quilt patch as description - the changes
themselves are correctly applied, luckily, but the description must be fixed up
by hand.
So, detect "Index: " lines as patch start. I've heard rumors that also
Subversion generates this format, so we become compatible with it, too.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
stgit/commands/files.py
stgit/commands/imprt.py

index 4b44f72..0694d83 100644 (file)
@@ -37,8 +37,7 @@ options = [make_option('-s', '--stat',
                        help = 'show the diff stat',
                        action = 'store_true'),
            make_option('-b', '--branch',
-                       help = 'use BRANCH instead of the default one')]
-                       action = 'store_true'),
+                       help = 'use BRANCH instead of the default one'),
            make_option('--bare',
                        help = 'bare file names (useful for scripting)',
                        action = 'store_true')]
index c956c91..8de0eaa 100644 (file)
@@ -108,7 +108,8 @@ def __parse_mail(filename = None):
 
     # the rest of the patch description
     for line in f:
-        if re.match('---\s*$', line) or re.match('diff -', line):
+        if re.match('---\s*$', line) or re.match('diff -', line) or \
+                re.match('^Index: ', line):
             break
         else:
             descr += line