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

Unified Diff: git_cl.py

Issue 9385010: git_cl: drop migration code (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 8 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 121504)
+++ git_cl.py (working copy)
@@ -146,7 +146,6 @@
self.tree_status_url = None
self.viewvc_url = None
self.updated = False
- self.did_migrate_check = False
self.is_gerrit = None
def LazyUpdateIfNeeded(self):
@@ -276,32 +275,6 @@
return RunGit(['config', param], **kwargs).strip()
-def CheckForMigration():
- """Migrate from the old issue format, if found.
-
- We used to store the branch<->issue mapping in a file in .git, but it's
- better to store it in the .git/config, since deleting a branch deletes that
- branch's entry there.
- """
-
- # Don't run more than once.
- if settings.did_migrate_check:
- return
-
- gitdir = RunGit(['rev-parse', '--git-dir']).strip()
- storepath = os.path.join(gitdir, 'cl-mapping')
- if os.path.exists(storepath):
- print "old-style git-cl mapping file (%s) found; migrating." % storepath
- store = open(storepath, 'r')
- for line in store:
- branch, issue = line.strip().split()
- RunGit(['config', 'branch.%s.rietveldissue' % ShortBranchName(branch),
- issue])
- store.close()
- os.remove(storepath)
- settings.did_migrate_check = True
-
-
def ShortBranchName(branch):
"""Convert a name like 'refs/heads/foo' to just 'foo'."""
return branch.replace('refs/heads/', '')
@@ -421,7 +394,6 @@
def GetIssue(self):
if not self.has_issue:
- CheckForMigration()
issue = RunGit(['config', self._IssueSetting()], error_ok=True).strip()
if issue:
self.issue = issue
« 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