Mercurial > hg-stable
changeset 8654:f6cc3638f468
mq: rename setheader to updateheader and fix comment
author | Cédric Duval <cedricduval@free.fr> |
---|---|
date | Sat, 30 May 2009 19:37:01 +0200 |
parents | aa011d123f71 |
children | 21688b8a594b |
files | hgext/mq.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Sat May 30 19:18:29 2009 +0200 +++ b/hgext/mq.py Sat May 30 19:37:01 2009 +0200 @@ -139,7 +139,7 @@ self.haspatch = diffstart > 1 def setuser(self, user): - if not self.setheader(['From: ', '# User '], user): + if not self.updateheader(['From: ', '# User '], user): try: patchheaderat = self.comments.index('# HG changeset patch') self.comments.insert(patchheaderat + 1,'# User ' + user) @@ -148,7 +148,7 @@ self.user = user def setdate(self, date): - if self.setheader(['# Date '], date): + if self.updateheader(['# Date '], date): self.date = date def setmessage(self, message): @@ -157,9 +157,9 @@ self.message = [message] self.comments += self.message - def setheader(self, prefixes, new): + def updateheader(self, prefixes, new): '''Update all references to a field in the patch header. - If none found, add it email style.''' + Return whether the field is present.''' res = False for prefix in prefixes: for i in xrange(len(self.comments)):