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

Side by Side Diff: tools/git-sync-deps

Issue 258053005: git-sync-deps - handle symbolic links to directories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/python 1 #!/usr/bin/python
2 # Copyright 2014 Google Inc. 2 # Copyright 2014 Google Inc.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 7
8 """Parse a DEPS file and git checkout all of the dependencies. 8 """Parse a DEPS file and git checkout all of the dependencies.
9 9
10 Args: 10 Args:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 Args: 70 Args:
71 git (string) the git executable 71 git (string) the git executable
72 72
73 directory (string) the path into which the repository 73 directory (string) the path into which the repository
74 is expected to be checked out. 74 is expected to be checked out.
75 """ 75 """
76 try: 76 try:
77 toplevel = subprocess.check_output( 77 toplevel = subprocess.check_output(
78 [git, 'rev-parse', '--show-toplevel'], cwd=directory).strip() 78 [git, 'rev-parse', '--show-toplevel'], cwd=directory).strip()
79 return os.path.abspath(directory) == os.path.abspath(toplevel) 79 return os.path.realpath(directory) == os.path.realpath(toplevel)
80 except subprocess.CalledProcessError: 80 except subprocess.CalledProcessError:
81 return False 81 return False
82 82
83 83
84 def git_checkout_to_directory(git, repo, checkoutable, directory, verbose): 84 def git_checkout_to_directory(git, repo, checkoutable, directory, verbose):
85 """Checkout (and clone if needed) a Git repository. 85 """Checkout (and clone if needed) a Git repository.
86 86
87 Args: 87 Args:
88 git (string) the git executable 88 git (string) the git executable
89 89
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 try: 196 try:
197 git_sync_deps(deps_file_path, argv, verbose) 197 git_sync_deps(deps_file_path, argv, verbose)
198 return 0 198 return 0
199 except DepsError: 199 except DepsError:
200 usage(deps_file_path) 200 usage(deps_file_path)
201 return 1 201 return 1
202 202
203 203
204 if __name__ == '__main__': 204 if __name__ == '__main__':
205 exit(main(sys.argv[1:])) 205 exit(main(sys.argv[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