Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: git_cl.py

Issue 2260453002: git cl: avoid infinite recursion during debug/development. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 and Gerrit.""" 8 """A git-command for integrating reviews on Rietveld and Gerrit."""
9 9
10 from __future__ import print_function 10 from __future__ import print_function
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 def GetApprovingReviewers(self): 1454 def GetApprovingReviewers(self):
1455 return self._codereview_impl.GetApprovingReviewers() 1455 return self._codereview_impl.GetApprovingReviewers()
1456 1456
1457 def GetMostRecentPatchset(self): 1457 def GetMostRecentPatchset(self):
1458 return self._codereview_impl.GetMostRecentPatchset() 1458 return self._codereview_impl.GetMostRecentPatchset()
1459 1459
1460 def __getattr__(self, attr): 1460 def __getattr__(self, attr):
1461 # This is because lots of untested code accesses Rietveld-specific stuff 1461 # This is because lots of untested code accesses Rietveld-specific stuff
1462 # directly, and it's hard to fix for sure. So, just let it work, and fix 1462 # directly, and it's hard to fix for sure. So, just let it work, and fix
1463 # on a case by case basis. 1463 # on a case by case basis.
1464 return getattr(self._codereview_impl, attr) 1464 # Note that child method defines __getattr__ as well, and forwards it here,
1465 # because _RietveldChangelistImpl is not cleaned up yet, and given
1466 # deprecation of Rietveld, it should probably be just removed.
1467 # Until that time, avoid infinite recursion by bypassing __getattr__
1468 # of implementation class.
1469 return self._codereview_impl.__getattribute__(attr)
1465 1470
1466 1471
1467 class _ChangelistCodereviewBase(object): 1472 class _ChangelistCodereviewBase(object):
1468 """Abstract base class encapsulating codereview specifics of a changelist.""" 1473 """Abstract base class encapsulating codereview specifics of a changelist."""
1469 def __init__(self, changelist): 1474 def __init__(self, changelist):
1470 self._changelist = changelist # instance of Changelist 1475 self._changelist = changelist # instance of Changelist
1471 1476
1472 def __getattr__(self, attr): 1477 def __getattr__(self, attr):
1473 # Forward methods to changelist. 1478 # Forward methods to changelist.
1474 # TODO(tandrii): maybe clean up _GerritChangelistImpl and 1479 # TODO(tandrii): maybe clean up _GerritChangelistImpl and
(...skipping 3673 matching lines...) Expand 10 before | Expand all | Expand 10 after
5148 if __name__ == '__main__': 5153 if __name__ == '__main__':
5149 # These affect sys.stdout so do it outside of main() to simplify mocks in 5154 # These affect sys.stdout so do it outside of main() to simplify mocks in
5150 # unit testing. 5155 # unit testing.
5151 fix_encoding.fix_encoding() 5156 fix_encoding.fix_encoding()
5152 setup_color.init() 5157 setup_color.init()
5153 try: 5158 try:
5154 sys.exit(main(sys.argv[1:])) 5159 sys.exit(main(sys.argv[1:]))
5155 except KeyboardInterrupt: 5160 except KeyboardInterrupt:
5156 sys.stderr.write('interrupted\n') 5161 sys.stderr.write('interrupted\n')
5157 sys.exit(1) 5162 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698