From e8043d11afcc486157033b2e64561098d624f9b4 Mon Sep 17 00:00:00 2001 From: "supersat@chromium.org" Date: Fri, 2 Dec 2011 20:03:18 +0000 Subject: [PATCH] Fix pulling in patches from git subrepos git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@112765 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 2 +- scm.py | 4 ++-- trychange.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/git_cl.py b/git_cl.py index 387aa9b01..904be1fdd 100755 --- a/git_cl.py +++ b/git_cl.py @@ -500,7 +500,7 @@ or verify this branch is set up to track another (via the --track argument to name = RunCommand(['git', 'rev-parse', 'HEAD']).strip() # Need to pass a relative path for msysgit. try: - files = scm.GIT.CaptureStatus([root], upstream_branch) + files = scm.GIT.CaptureStatus(root, [root], upstream_branch) except subprocess2.CalledProcessError: DieWithError( ('\nFailed to diff against upstream branch %s!\n\n' diff --git a/scm.py b/scm.py index 261cb6491..6c6d4389b 100644 --- a/scm.py +++ b/scm.py @@ -102,14 +102,14 @@ class GIT(object): ['git'] + args, stderr=subprocess2.PIPE, **kwargs) @staticmethod - def CaptureStatus(files, upstream_branch=None): + def CaptureStatus(cwd, files, upstream_branch=None): """Returns git status. @files can be a string (one file) or a list of files. Returns an array of (status, file) tuples.""" if upstream_branch is None: - upstream_branch = GIT.GetUpstreamBranch(os.getcwd()) + upstream_branch = GIT.GetUpstreamBranch(cwd) if upstream_branch is None: raise gclient_utils.Error('Cannot determine upstream branch') command = ['diff', '--name-status', '-r', '%s...' % upstream_branch] diff --git a/trychange.py b/trychange.py index 78b90a770..82672ffe3 100755 --- a/trychange.py +++ b/trychange.py @@ -279,7 +279,8 @@ class GIT(SCM): logging.info("GIT(%s)" % self.checkout_root) def CaptureStatus(self): - return scm.GIT.CaptureStatus(self.checkout_root.replace(os.sep, '/'), + return scm.GIT.CaptureStatus(self.checkout_root, + self.checkout_root.replace(os.sep, '/'), self.diff_against) def GenerateDiff(self):