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

Unified Diff: git_cl.py

Issue 135213006: git_cl: Do not cache the relative root in Settings. (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: fix pylint error Created 6 years, 10 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 | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
===================================================================
--- git_cl.py (revision 250376)
+++ git_cl.py (working copy)
@@ -262,7 +262,7 @@
def __init__(self):
self.default_server = None
self.cc = None
- self.relative_root = None
+ self.root = None
self.is_git_svn = None
self.svn_branch = None
self.tree_status_url = None
@@ -303,13 +303,14 @@
self._GetRietveldConfig('server', error_message=error_message))
return self.default_server
- def GetRelativeRoot(self):
- if self.relative_root is None:
- self.relative_root = RunGit(['rev-parse', '--show-cdup']).strip()
- return self.relative_root
+ @staticmethod
+ def GetRelativeRoot():
+ return RunGit(['rev-parse', '--show-cdup']).strip()
def GetRoot(self):
- return os.path.abspath(self.GetRelativeRoot())
+ if self.root is None:
+ self.root = os.path.abspath(self.GetRelativeRoot())
+ return self.root
def GetIsGitSvn(self):
"""Return true if this repo looks like it's using git-svn."""
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698