Mercurial > hg-stable
changeset 9335:6eaadd777bc4
mq: add function to check if a header exists in a patch
author | Yann E. MORIN <yann.morin.1998@anciens.enib.fr> |
---|---|
date | Wed, 12 Aug 2009 10:46:16 +0200 |
parents | 08f59f7916f9 |
children | dd6f605b15c0 |
files | hgext/mq.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Wed Aug 12 10:46:03 2009 +0200 +++ b/hgext/mq.py Wed Aug 12 10:46:16 2009 +0200 @@ -170,6 +170,14 @@ break return res + def _hasheader(self, prefixes): + '''Check if a header starts with any of the given prefixes.''' + for prefix in prefixes: + for comment in self.comments: + if comment.startswith(prefix): + return True + return False + def __str__(self): if not self.comments: return ''