Fix SCM.ReadRootFile when self.gclient_root is not yet defined

Review URL: http://codereview.chromium.org/2102004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@47426 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 15 years ago
parent 7c1a02b577
commit 258d17f296

@ -158,8 +158,11 @@ class SCM(object):
logging.info('Found %s at %s' % (filename, self.checkout_root))
return gclient_util.FileRead(filepath)
return None
root = os.path.abspath(self.gclient_root)
cur = os.path.abspath(self.checkout_root)
if self.gclient_root:
root = os.path.abspath(self.gclient_root)
else:
root = gclient_utils.FindGclientRoot(cur)
assert cur.startswith(root), (root, cur)
while cur.startswith(root):
filepath = os.path.join(cur, filename)

Loading…
Cancel
Save