Ejemplo n.º 1
0
 def getcommit(self, rev):
     elt = self.changes[rev]
     date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
     desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
     return commit(author=elt.get('author'),
                   date=util.datestr(date),
                   desc=desc.strip(),
                   parents=self.parents[rev])
Ejemplo n.º 2
0
 def getcommit(self, rev):
     certs = self.mtngetcerts(rev)
     return commit(author=certs["author"],
                   date=util.datestr(
                       util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
                   desc=certs["changelog"],
                   rev=rev,
                   parents=self.mtnrun("parents", rev).splitlines(),
                   branch=certs["branch"])
Ejemplo n.º 3
0
 def getcommit(self, rev):
     certs   = self.mtngetcerts(rev)
     return commit(
         author=certs["author"],
         date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
         desc=certs["changelog"],
         rev=rev,
         parents=self.mtnrun("parents", rev).splitlines(),
         branch=certs["branch"])
Ejemplo n.º 4
0
 def getcommit(self, rev):
     elt = self.changes[rev]
     date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
     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.
     return commit(author=self.recode(elt.get('author')),
                   date=util.datestr(date),
                   desc=self.recode(desc).strip(),
                   parents=self.parents[rev])
Ejemplo n.º 5
0
 def getcommit(self, rev):
     elt = self.changes[rev]
     date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
     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.
     return common.commit(author=self.recode(elt.get('author')),
                          date=util.datestr(date, '%Y-%m-%d %H:%M:%S %1%2'),
                          desc=self.recode(desc).strip(),
                          parents=self.parents[rev])
Ejemplo n.º 6
0
 def getcommit(self, rev):
     elt = self.changes[rev]
     date = util.strdate(elt.get("local_date"), "%a %b %d %H:%M:%S %Z %Y")
     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.
     return commit(
         author=self.recode(elt.get("author")),
         date=util.datestr(date),
         desc=self.recode(desc).strip(),
         parents=self.parents[rev],
     )
Ejemplo n.º 7
0
 def getcommit(self, rev):
     extra = {}
     certs = self.mtngetcerts(rev)
     if certs.get('suspend') == certs["branch"]:
         extra['close'] = '1'
     return commit(author=certs["author"],
                   date=util.datestr(
                       util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
                   desc=certs["changelog"],
                   rev=rev,
                   parents=self.mtnrun("parents", rev).splitlines(),
                   branch=certs["branch"],
                   extra=extra)
Ejemplo n.º 8
0
 def getcommit(self, rev):
     extra = {}
     certs = self.mtngetcerts(rev)
     if certs.get('suspend') == certs["branch"]:
         extra['close'] = 1
     return commit(
         author=certs["author"],
         date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
         desc=certs["changelog"],
         rev=rev,
         parents=self.mtnrun("parents", rev).splitlines(),
         branch=certs["branch"],
         extra=extra)
Ejemplo n.º 9
0
 def _parsecatlog(self, data, rev):
     summary = []
     for l in data:
         l = l.strip()
         if summary:
             summary.append(l)
         elif l.startswith('Summary:'):
             summary.append(l[len('Summary: '):])
         elif l.startswith('Standard-date:'):
             date = l[len('Standard-date: '):]
             strdate = util.strdate(date, '%Y-%m-%d %H:%M:%S')
             self.changes[rev].date = util.datestr(strdate)
         elif l.startswith('Creator:'):
             self.changes[rev].author = l[len('Creator: '):]
     self.changes[rev].summary = '\n'.join(summary)
Ejemplo n.º 10
0
    def _parsecatlog(self, data, rev):
        try:
            catlog = self.catlogparser.parsestr(data)

            # Commit date
            self.changes[rev].date = util.datestr(
                util.strdate(catlog['Standard-date'], '%Y-%m-%d %H:%M:%S'))

            # Commit author
            self.changes[rev].author = self.recode(catlog['Creator'])

            # Commit description
            self.changes[rev].summary = '\n\n'.join(
                (catlog['Summary'], 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(_('could not parse cat-log of %s') % rev)
Ejemplo n.º 11
0
    def _parsecatlog(self, data, rev):
        try:
            catlog = self.catlogparser.parsestr(data)

            # Commit date
            self.changes[rev].date = util.datestr(
                util.strdate(catlog['Standard-date'],
                             '%Y-%m-%d %H:%M:%S'))

            # Commit author
            self.changes[rev].author = self.recode(catlog['Creator'])

            # Commit description
            self.changes[rev].summary = '\n\n'.join((catlog['Summary'],
                                                    catlog.get_payload()))
            self.changes[rev].summary = self.recode(self.changes[rev].summary)

            # Commit revision origin when dealing with a branch or tag
            if catlog.has_key('Continuation-of'):
                self.changes[rev].continuationof = self.recode(catlog['Continuation-of'])
        except Exception:
            raise util.Abort(_('could not parse cat-log of %s') % rev)
Ejemplo n.º 12
0
 def getcommit(self, rev):
     elt = self.changes[rev]
     date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
     desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
     return commit(author=elt.get('author'), date=util.datestr(date),
                   desc=desc.strip(), parents=self.parents[rev])