| OLD | NEW |
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 | 2 |
| 3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
| 4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # Copyright (C) 2006-2014 Eyeo GmbH |
| 5 # | 5 # |
| 6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
| 7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
| 8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
| 9 # | 9 # |
| 10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 self.outputFilename = None | 57 self.outputFilename = None |
| 58 self.changelogFilename = None | 58 self.changelogFilename = None |
| 59 | 59 |
| 60 def hasChanges(self): | 60 def hasChanges(self): |
| 61 return self.revision != self.previousRevision | 61 return self.revision != self.previousRevision |
| 62 | 62 |
| 63 def getCurrentRevision(self): | 63 def getCurrentRevision(self): |
| 64 """ | 64 """ |
| 65 retrieves the current revision number from the repository | 65 retrieves the current revision number from the repository |
| 66 """ | 66 """ |
| 67 command = ['hg', 'log', '-R', self.config.repository, '-r', 'default', '--te
mplate', '{rev}'] | 67 command = ['hg', 'log', '-R', self.config.repository, '-r', 'default', |
| 68 '--template', '{rev}', '--config', 'defaults.log='] |
| 68 return subprocess.check_output(command) | 69 return subprocess.check_output(command) |
| 69 | 70 |
| 70 def getChanges(self): | 71 def getChanges(self): |
| 71 """ | 72 """ |
| 72 retrieve changes between the current and previous ("first") revision | 73 retrieve changes between the current and previous ("first") revision |
| 73 """ | 74 """ |
| 74 | 75 |
| 75 command = ['hg', 'log', '-R', self.config.repository, '-r', 'tip:0', | 76 command = ['hg', 'log', '-R', self.config.repository, '-r', 'tip:0', |
| 76 '-b', 'default', '-l', '50', '--encoding', 'utf-8', | 77 '-b', 'default', '-l', '50', '--encoding', 'utf-8', |
| 77 '--template', '{date|isodate}\\0{author|person}\\0{rev}\\0{desc}\\0\\0'] | 78 '--template', '{date|isodate}\\0{author|person}\\0{rev}\\0{desc}\\0\\0', |
| 79 '--config', 'defaults.log='] |
| 78 result = subprocess.check_output(command).decode('utf-8') | 80 result = subprocess.check_output(command).decode('utf-8') |
| 79 | 81 |
| 80 for change in result.split('\0\0'): | 82 for change in result.split('\0\0'): |
| 81 if change: | 83 if change: |
| 82 date, author, revision, description = change.split('\0') | 84 date, author, revision, description = change.split('\0') |
| 83 yield {'date': date, 'author': author, 'revision': revision, 'descriptio
n': description} | 85 yield {'date': date, 'author': author, 'revision': revision, 'descriptio
n': description} |
| 84 | 86 |
| 85 def copyRepository(self): | 87 def copyRepository(self): |
| 86 ''' | 88 ''' |
| 87 Create a repository copy in a temporary directory | 89 Create a repository copy in a temporary directory |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 except Exception, ex: | 505 except Exception, ex: |
| 504 print >>sys.stderr, "The build for %s failed:" % repo | 506 print >>sys.stderr, "The build for %s failed:" % repo |
| 505 traceback.print_exc() | 507 traceback.print_exc() |
| 506 | 508 |
| 507 file = open(nightlyConfigFile, 'wb') | 509 file = open(nightlyConfigFile, 'wb') |
| 508 nightlyConfig.write(file) | 510 nightlyConfig.write(file) |
| 509 | 511 |
| 510 | 512 |
| 511 if __name__ == '__main__': | 513 if __name__ == '__main__': |
| 512 main() | 514 main() |
| OLD | NEW |