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

Unified Diff: appengine/findit/util_scripts/git_checkout/local_git_repository.py

Issue 2605943002: Removing the mutation in the factories for getting dep repositories (Closed)
Patch Set: rebase Created 3 years, 12 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
Index: appengine/findit/util_scripts/git_checkout/local_git_repository.py
diff --git a/appengine/findit/util_scripts/git_checkout/local_git_repository.py b/appengine/findit/util_scripts/git_checkout/local_git_repository.py
index 3dba0492ba16b0512f840f11ea01a47a9f459887..a74301b240ece6558577391d421aa0b807871e92 100644
--- a/appengine/findit/util_scripts/git_checkout/local_git_repository.py
+++ b/appengine/findit/util_scripts/git_checkout/local_git_repository.py
@@ -43,8 +43,14 @@ class LocalGitRepository(GitRepository):
def __init__(self, repo_url=None):
self._host = None
self._repo_path = None
- self._repo_url = None
- self.repo_url = repo_url
+ self._repo_url = repo_url
+ if repo_url is not None:
+ parsed_url = urlparse(repo_url)
+ self._host = parsed_url.netloc
+ # Remove the / in the front of path.
+ self._repo_path = parsed_url.path[1:]
+ self._CloneOrUpdateRepoIfNeeded()
+
self.changelog_parser = local_git_parsers.GitChangeLogParser()
self.changelogs_parser = local_git_parsers.GitChangeLogsParser()
self.blame_parser = local_git_parsers.GitBlameParser()
@@ -64,22 +70,6 @@ class LocalGitRepository(GitRepository):
"""Url of remote repository which the local repo checks out from."""
return self._repo_url
- @repo_url.setter
- def repo_url(self, repo_url):
- if self._repo_url == repo_url:
- return
-
- self._repo_url = repo_url
- if not self._repo_url:
- return
-
- parsed_url = urlparse(repo_url)
- self._host = parsed_url.netloc
- # Remove the / in the front of path.
- self._repo_path = parsed_url.path[1:]
-
- self._CloneOrUpdateRepoIfNeeded()
-
def _CloneOrUpdateRepoIfNeeded(self):
"""Clones repo, or update it if it didn't got updated before."""
with LocalGitRepository.lock:

Powered by Google App Engine
This is Rietveld 408576698