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

Unified Diff: trychange.py

Issue 8771042: Enforces using cwd in all svn calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Address comments Created 9 years 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 | « tests/scm_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
diff --git a/trychange.py b/trychange.py
index 78b90a7705c16a1ff9431bd98567fc324bd692b7..5c6dd984a8de55e37df969bd08e691936ad4f072 100755
--- a/trychange.py
+++ b/trychange.py
@@ -244,11 +244,7 @@ class SVN(SCM):
return data
def CaptureStatus(self):
- previous_cwd = os.getcwd()
- os.chdir(self.checkout_root)
- result = scm.SVN.CaptureStatus(self.checkout_root)
- os.chdir(previous_cwd)
- return result
+ return scm.SVN.CaptureStatus(None, self.checkout_root)
def GenerateDiff(self):
"""Returns a string containing the diff for the given file list.
@@ -468,8 +464,9 @@ def GuessVCS(options, path, file_list):
# 128 = git error code when not in a repo.
logging.warning('Unexpected error code: %s' % e.returncode)
raise
- raise NoTryServerAccess("Could not guess version control system. "
- "Are you in a working copy directory?")
+ raise NoTryServerAccess(
+ ( 'Could not guess version control system for %s.\n'
+ 'Are you in a working copy directory?') % path)
def GetMungedDiff(path_diff, diff):
« no previous file with comments | « tests/scm_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698