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

Unified Diff: git_cl.py

Issue 2032433003: git cl issue 0 should really clear issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: fix Created 4 years, 7 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
diff --git a/git_cl.py b/git_cl.py
index 241e203153a6bb12bd6c08531936b03e99bcdcf3..9c3059ade2238f59b6c9a956c8abf33ee6280748 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1255,11 +1255,15 @@ class Changelist(object):
if codereview_server:
RunGit(['config', codereview_setting, codereview_server])
else:
- current_issue = self.GetIssue()
- if current_issue:
- RunGit(['config', '--unset', issue_setting])
+ # Reset it regardless. It doesn't hurt.
+ config_settings = [issue_setting, self._codereview_impl.PatchsetSetting()]
+ for prop in (['last-upload-hash'] +
+ self._codereview_impl._PostUnsetIssueProperties()):
+ config_settings.append('branch.%s.%s' % (self.GetBranch(), prop))
+ for setting in config_settings:
+ RunGit(['config', '--unset', setting], error_ok=True)
self.issue = None
- self.SetPatchset(None)
+ self.patchset = None
def GetChange(self, upstream_branch, author):
if not self.GitSanityChecks(upstream_branch):
@@ -1497,6 +1501,10 @@ class _ChangelistCodereviewBase(object):
"""Returns name of git config setting which stores issue number."""
raise NotImplementedError()
+ def _PostUnsetIssueProperties(self):
+ """Which branch-specific properties to erase when unsettin issue."""
+ raise NotImplementedError()
+
def GetRieveldObjForPresubmit(self):
# This is an unfortunate Rietveld-embeddedness in presubmit.
# For non-Rietveld codereviews, this probably should return a dummy object.
@@ -1738,6 +1746,10 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
return 'branch.%s.rietveldserver' % branch
return None
+ def _PostUnsetIssueProperties(self):
+ """Which branch-specific properties to erase when unsetting issue."""
+ return ['rietveldserver']
+
def GetRieveldObjForPresubmit(self):
return self.RpcServer()
@@ -2094,6 +2106,13 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
return 'branch.%s.gerritserver' % branch
return None
+ def _PostUnsetIssueProperties(self):
+ """Which branch-specific properties to erase when unsetting issue."""
+ return [
+ 'gerritserver',
+ 'gerritsquashhash',
+ ]
+
def GetRieveldObjForPresubmit(self):
class ThisIsNotRietveldIssue(object):
def __nonzero__(self):
« 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