summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-24 19:12:37 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-12-18 11:54:28 +0200
commit7c1a2a4c55e1e16f33e398acefba22c61936fa00 (patch)
treea7d945de99fa57755660d68e7a7750d771712ea1
parenta318df268c7752410938cdaa01c60cc569dbdba8 (diff)
downloadgit-buildpackage-7c1a2a4c55e1e16f33e398acefba22c61936fa00.tar.gz
git-buildpackage-7c1a2a4c55e1e16f33e398acefba22c61936fa00.tar.bz2
git-buildpackage-7c1a2a4c55e1e16f33e398acefba22c61936fa00.zip
patchseries: strip numbering when guessing subject from filename
Change-Id: I58c4f8871411dae15d0e0e4246f0eebe65e3967d Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-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 10fccfc6..327997f5 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):
"""