From 258d17f296b2d10a1e67e28d2513a170201b16f4 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 17 May 2010 17:30:33 +0000 Subject: [PATCH] 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 --- trychange.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trychange.py b/trychange.py index 2bc5d6389..03d1bee28 100755 --- a/trychange.py +++ b/trychange.py @@ -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)