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

Side by Side Diff: git_cl.py

Issue 1768583002: temporary fix for repos that directly used DownloadHooks from git_cl.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 9 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.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 from distutils.version import LooseVersion 10 from distutils.version import LooseVersion
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 'chmod +x .git/hooks/commit-msg' % (dst, src)) 1597 'chmod +x .git/hooks/commit-msg' % (dst, src))
1598 os.chmod(dst, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) 1598 os.chmod(dst, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
1599 except Exception: 1599 except Exception:
1600 if os.path.exists(dst): 1600 if os.path.exists(dst):
1601 os.remove(dst) 1601 os.remove(dst)
1602 DieWithError('\nFailed to download hooks.\n' 1602 DieWithError('\nFailed to download hooks.\n'
1603 'You need to download from\n%s\n' 1603 'You need to download from\n%s\n'
1604 'into .git/hooks/commit-msg and ' 1604 'into .git/hooks/commit-msg and '
1605 'chmod +x .git/hooks/commit-msg' % src) 1605 'chmod +x .git/hooks/commit-msg' % src)
1606 1606
1607 # TODO(tandrii): remove this once repos which call this method directly are
1608 # upgraded.
1609 DownloadHooks = DownloadGerritHook
1607 1610
1608 @subcommand.usage('[repo root containing codereview.settings]') 1611 @subcommand.usage('[repo root containing codereview.settings]')
1609 def CMDconfig(parser, args): 1612 def CMDconfig(parser, args):
1610 """Edits configuration for this tree.""" 1613 """Edits configuration for this tree."""
1611 1614
1612 parser.add_option('--activate-update', action='store_true', 1615 parser.add_option('--activate-update', action='store_true',
1613 help='activate auto-updating [rietveld] section in ' 1616 help='activate auto-updating [rietveld] section in '
1614 '.git/config') 1617 '.git/config')
1615 parser.add_option('--deactivate-update', action='store_true', 1618 parser.add_option('--deactivate-update', action='store_true',
1616 help='deactivate auto-updating [rietveld] section in ' 1619 help='deactivate auto-updating [rietveld] section in '
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after
3985 if __name__ == '__main__': 3988 if __name__ == '__main__':
3986 # These affect sys.stdout so do it outside of main() to simplify mocks in 3989 # These affect sys.stdout so do it outside of main() to simplify mocks in
3987 # unit testing. 3990 # unit testing.
3988 fix_encoding.fix_encoding() 3991 fix_encoding.fix_encoding()
3989 colorama.init() 3992 colorama.init()
3990 try: 3993 try:
3991 sys.exit(main(sys.argv[1:])) 3994 sys.exit(main(sys.argv[1:]))
3992 except KeyboardInterrupt: 3995 except KeyboardInterrupt:
3993 sys.stderr.write('interrupted\n') 3996 sys.stderr.write('interrupted\n')
3994 sys.exit(1) 3997 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