Lines Matching refs:directory
76 def git_repository_sync_is_disabled(git, directory): argument
79 [git, 'config', 'sync-deps.disable'], cwd=directory)
85 def is_git_toplevel(git, directory): argument
96 [git, 'rev-parse', '--show-toplevel'], cwd=directory).strip()
97 return os.path.realpath(directory) == os.path.realpath(toplevel.decode())
102 def status(directory, commithash, change): argument
106 directory = truncate(directory, dlen)
109 sys.stdout.write('%-*s %s %s\n' % (dlen, directory, symbol, commithash))
112 def git_checkout_to_directory(git, repo, commithash, directory, verbose): argument
130 if not os.path.isdir(directory):
132 [git, 'clone', '--quiet', '--no-checkout', repo, directory])
134 cwd=directory)
136 status(directory, commithash, True)
139 if not is_git_toplevel(git, directory):
142 sys.stdout.write('%s\n IS NOT TOP-LEVEL GIT DIRECTORY.\n' % directory)
146 if git_repository_sync_is_disabled(git, directory):
147 sys.stdout.write('%s\n SYNC IS DISABLED.\n' % directory)
154 cwd=directory, stderr=devnull):
157 status(directory, commithash, False) # Success.
163 [git, 'remote', 'set-url', 'origin', repo], cwd=directory)
165 subprocess.check_call([git, 'fetch', '--quiet'], cwd=directory)
167 subprocess.check_call([git, 'checkout', '--quiet', commithash], cwd=directory)
170 status(directory, commithash, True) # Success.
212 for directory in dependencies:
214 if directory.startswith(other_dir + '/'):
215 raise Exception('%r is parent of %r' % (other_dir, directory))
217 for directory in sorted(dependencies):
218 if not isinstance(dependencies[directory], str):
220 sys.stdout.write( 'Skipping "%s".\n' % directory)
222 if '@' in dependencies[directory]:
223 repo, commithash = dependencies[directory].split('@', 1)
229 relative_directory = os.path.join(deps_file_directory, directory)