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

Unified Diff: gclient_utils.py

Issue 8174009: Add repo-managed checkout support to trychange.py (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/trychange_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
===================================================================
--- gclient_utils.py (revision 104937)
+++ gclient_utils.py (working copy)
@@ -432,14 +432,17 @@
def FindFileUpwards(filename, path=None):
- """Search upwards from the a directory (default: current) to find a file."""
+ """Search upwards from the a directory (default: current) to find a file.
+
+ Returns nearest upper-level directory with the passed in file.
+ """
if not path:
path = os.getcwd()
path = os.path.realpath(path)
while True:
file_path = os.path.join(path, filename)
- if os.path.isfile(file_path):
- return file_path
+ if os.path.exists(file_path):
+ return path
(new_path, _) = os.path.split(path)
if new_path == path:
return None
@@ -449,7 +452,7 @@
def GetGClientRootAndEntries(path=None):
"""Returns the gclient root and the dict of entries."""
config_file = '.gclient_entries'
- config_path = FindFileUpwards(config_file, path)
+ config_path = os.path.join(FindFileUpwards(config_file, path), config_file)
if not config_path:
print "Can't find %s" % config_file
« no previous file with comments | « no previous file | tests/trychange_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698