def _parsecatlog(self, data, rev): try: catlog = mail.parsebytes(data) # Commit date self.changes[rev].date = dateutil.datestr( dateutil.strdate(catlog['Standard-date'], b'%Y-%m-%d %H:%M:%S')) # Commit author self.changes[rev].author = self.recode(catlog['Creator']) # Commit description self.changes[rev].summary = b'\n\n'.join(( self.recode(catlog['Summary']), self.recode(catlog.get_payload()), )) self.changes[rev].summary = self.recode(self.changes[rev].summary) # Commit revision origin when dealing with a branch or tag if 'Continuation-of' in catlog: self.changes[rev].continuationof = self.recode( catlog['Continuation-of']) except Exception: raise error.Abort(_(b'could not parse cat-log of %s') % rev)
def getcommit(self, rev): elt = self.changes[rev] dateformat = '%a %b %d %H:%M:%S %Z %Y' date = dateutil.strdate(elt.get('local_date'), dateformat) desc = elt.findtext('name') + '\n' + elt.findtext('comment', '') # etree can return unicode objects for name, comment, and author, # so recode() is used to ensure str objects are emitted. newdateformat = '%Y-%m-%d %H:%M:%S %1%2' return common.commit(author=self.recode(elt.get('author')), date=dateutil.datestr(date, newdateformat), desc=self.recode(desc).strip(), parents=self.parents[rev])
def getcommit(self, rev): extra = {} certs = self.mtngetcerts(rev) if certs.get('suspend') == certs["branch"]: extra['close'] = 1 dateformat = "%Y-%m-%dT%H:%M:%S" return common.commit(author=certs["author"], date=dateutil.datestr( dateutil.strdate(certs["date"], dateformat)), desc=certs["changelog"], rev=rev, parents=self.mtnrun("parents", rev).splitlines(), branch=certs["branch"], extra=extra)