OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 """Returns an upload.RpcServer() to access this review's rietveld instance. | 1321 """Returns an upload.RpcServer() to access this review's rietveld instance. |
1322 """ | 1322 """ |
1323 if not self._rpc_server: | 1323 if not self._rpc_server: |
1324 self._rpc_server = rietveld.CachingRietveld( | 1324 self._rpc_server = rietveld.CachingRietveld( |
1325 self.GetRietveldServer(), | 1325 self.GetRietveldServer(), |
1326 self._auth_config or auth.make_auth_config()) | 1326 self._auth_config or auth.make_auth_config()) |
1327 return self._rpc_server | 1327 return self._rpc_server |
1328 | 1328 |
1329 def _IssueSetting(self): | 1329 def _IssueSetting(self): |
1330 """Return the git setting that stores this change's issue.""" | 1330 """Return the git setting that stores this change's issue.""" |
1331 if settings.GetIsGerrit(): | |
1332 return 'branch.%s.gerritissue' % self.GetBranch() | |
1333 return 'branch.%s.rietveldissue' % self.GetBranch() | 1331 return 'branch.%s.rietveldissue' % self.GetBranch() |
1334 | 1332 |
1335 def _PatchsetSetting(self): | 1333 def _PatchsetSetting(self): |
1336 """Return the git setting that stores this change's most recent patchset.""" | 1334 """Return the git setting that stores this change's most recent patchset.""" |
1337 return 'branch.%s.rietveldpatchset' % self.GetBranch() | 1335 return 'branch.%s.rietveldpatchset' % self.GetBranch() |
1338 | 1336 |
1339 def _RietveldServer(self): | 1337 def _RietveldServer(self): |
1340 """Returns the git setting that stores this change's rietveld server.""" | 1338 """Returns the git setting that stores this change's rietveld server.""" |
1341 branch = self.GetBranch() | 1339 branch = self.GetBranch() |
1342 if branch: | 1340 if branch: |
(...skipping 2666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4009 if __name__ == '__main__': | 4007 if __name__ == '__main__': |
4010 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4008 # These affect sys.stdout so do it outside of main() to simplify mocks in |
4011 # unit testing. | 4009 # unit testing. |
4012 fix_encoding.fix_encoding() | 4010 fix_encoding.fix_encoding() |
4013 colorama.init() | 4011 colorama.init() |
4014 try: | 4012 try: |
4015 sys.exit(main(sys.argv[1:])) | 4013 sys.exit(main(sys.argv[1:])) |
4016 except KeyboardInterrupt: | 4014 except KeyboardInterrupt: |
4017 sys.stderr.write('interrupted\n') | 4015 sys.stderr.write('interrupted\n') |
4018 sys.exit(1) | 4016 sys.exit(1) |
OLD | NEW |