示例#1
0
 def getChangelog(self, tag1, tag2):
     """Return a changelog between 2 bundle tags."""
     # compute tags url
     url = self.bundle_url
     tag1_url = computeBundleTagUrl(url, tag1)
     tag2_url = computeBundleTagUrl(url, tag2)
     if not tag1_url or not tag2_url:
         msg = 'Invalid bundle url: %s' % url
         logger.error(msg)
         raise ValueError(msg)
     return self._changelog(tag1, tag2, tag1_url, tag2_url)
示例#2
0
 def addChangelog(self, tag1, tag2):
     """Add a global CHANGELOG.txt file to the tag2 url."""
     logger.info('Adding a global CHANGELOG.txt')
     try:
         changelog = self.getChangelog(tag1, tag2)
     except ValueError:
         return -1
     f = NamedTemporaryFile('w+', prefix='bm-')
     f.write(changelog)
     f.flush()
     tag_url = computeBundleTagUrl(self.bundle_url, tag2)
     command('svn import %s %s/CHANGELOG.txt '
             '-m"bundelman add CHANGELOG.txt to %s"' %
             (f.name, tag_url, tag_url))
     f.close()
     return 0