summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-24 19:12:37 +0200
committerGuido Günther <agx@sigxcpu.org>2015-02-18 08:58:42 +0100
commit55d5422efbe81008e10856a7221e36a60deab7ce (patch)
tree641c73918afa734232eeb54b6833c7f840cd6d8f /gbp
parent1c6df3eada8a75089ccfaa4e75d036623762d4b5 (diff)
patchseries: strip numbering when guessing subject from filename
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rw-r--r--gbp/patch_series.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gbp/patch_series.py b/gbp/patch_series.py
index 10fccfc..327997f 100644
--- a/gbp/patch_series.py
+++ b/gbp/patch_series.py
@@ -95,6 +95,12 @@ class Patch(object):
>>> p = Patch('debian/patches/foo')
>>> p._get_subject_from_filename()
'foo'
+ >>> Patch('0123-foo.patch')._get_subject_from_filename()
+ 'foo'
+ >>> Patch('0123.patch')._get_subject_from_filename()
+ '0123'
+ >>> Patch('0123-foo-0123.patch')._get_subject_from_filename()
+ 'foo-0123'
@return: the patch's subject
@rtype: C{str}
@@ -107,7 +113,7 @@ class Patch(object):
subject = base
except ValueError:
pass # No ext so keep subject as is
- return subject
+ return subject.lstrip('0123456789-') or subject
def _get_info_field(self, key, get_val=None):
"""