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

Unified Diff: presubmit_support.py

Issue 191002: Change directory to repository root before running CheckSvnModifiedDirectorie... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
===================================================================
--- presubmit_support.py (revision 25258)
+++ presubmit_support.py (working copy)
@@ -683,19 +683,31 @@
def __init__(self, *args, **kwargs):
Change.__init__(self, *args, **kwargs)
self.scm = 'svn'
+ self._changelists = None
+ def _GetChangeLists(self):
+ """Get all change lists."""
+ if self._changelists == None:
+ previous_cwd = os.getcwd()
+ os.chdir(self.RepositoryRoot())
+ self._changelists = gcl.GetModifiedFiles()
+ os.chdir(previous_cwd)
+ return self._changelists
+
def GetAllModifiedFiles(self):
"""Get all modified files."""
- changelists = gcl.GetModifiedFiles()
+ changelists = self._GetChangeLists()
all_modified_files = []
for cl in changelists.values():
- all_modified_files.extend([f[1] for f in cl])
+ all_modified_files.extend(
+ [os.path.join(self.RepositoryRoot(), f[1]) for f in cl])
return all_modified_files
def GetModifiedFiles(self):
"""Get modified files in the current CL."""
- changelists = gcl.GetModifiedFiles()
- return [f[1] for f in changelists[self.Name()]]
+ changelists = self._GetChangeLists()
+ return [os.path.join(self.RepositoryRoot(), f[1])
+ for f in changelists[self.Name()]]
class GitChange(Change):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698