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

Side by Side Diff: git_common.py

Issue 2277513002: Run auto-spell-checker (codespell) on files in depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 3 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 | « git_cl.py ('k') | presubmit_canned_checks.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. 5 # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly.
6 # Derived from https://gist.github.com/aljungberg/626518 6 # Derived from https://gist.github.com/aljungberg/626518
7 import multiprocessing.pool 7 import multiprocessing.pool
8 from multiprocessing.pool import IMapIterator 8 from multiprocessing.pool import IMapIterator
9 def wrapper(func): 9 def wrapper(func):
10 def wrap(self, timeout=None): 10 def wrap(self, timeout=None):
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 yield branch, parent 893 yield branch, parent
894 parent_to_branches[parent].discard(branch) 894 parent_to_branches[parent].discard(branch)
895 del branch_tree[branch] 895 del branch_tree[branch]
896 896
897 897
898 def tree(treeref, recurse=False): 898 def tree(treeref, recurse=False):
899 """Returns a dict representation of a git tree object. 899 """Returns a dict representation of a git tree object.
900 900
901 Args: 901 Args:
902 treeref (str) - a git ref which resolves to a tree (commits count as trees). 902 treeref (str) - a git ref which resolves to a tree (commits count as trees).
903 recurse (bool) - include all of the tree's decendants too. File names will 903 recurse (bool) - include all of the tree's descendants too. File names will
904 take the form of 'some/path/to/file'. 904 take the form of 'some/path/to/file'.
905 905
906 Return format: 906 Return format:
907 { 'file_name': (mode, type, ref) } 907 { 'file_name': (mode, type, ref) }
908 908
909 mode is an integer where: 909 mode is an integer where:
910 * 0040000 - Directory 910 * 0040000 - Directory
911 * 0100644 - Regular non-executable file 911 * 0100644 - Regular non-executable file
912 * 0100664 - Regular non-executable group-writeable file 912 * 0100664 - Regular non-executable group-writeable file
913 * 0100755 - Regular executable file 913 * 0100755 - Regular executable file
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 ['HEAD']) 1013 ['HEAD'])
1014 1014
1015 1015
1016 def clone_file(repository, new_workdir, link, operation): 1016 def clone_file(repository, new_workdir, link, operation):
1017 if not os.path.exists(os.path.join(repository, link)): 1017 if not os.path.exists(os.path.join(repository, link)):
1018 return 1018 return
1019 link_dir = os.path.dirname(os.path.join(new_workdir, link)) 1019 link_dir = os.path.dirname(os.path.join(new_workdir, link))
1020 if not os.path.exists(link_dir): 1020 if not os.path.exists(link_dir):
1021 os.makedirs(link_dir) 1021 os.makedirs(link_dir)
1022 operation(os.path.join(repository, link), os.path.join(new_workdir, link)) 1022 operation(os.path.join(repository, link), os.path.join(new_workdir, link))
OLDNEW
« no previous file with comments | « git_cl.py ('k') | presubmit_canned_checks.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698