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

Unified Diff: git_cl.py

Issue 1871463003: git cl diff: fix regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 8 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 | no next file » | 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 98d9c673784df3775b1bb930d632b85f01db27a2..fb12eafe9af6f444b916a00a09a0225b7aafe1fd 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1297,8 +1297,8 @@ class Changelist(object):
def CMDPatchIssue(self, issue_arg, reject, nocommit, directory):
"""Fetches and applies the issue patch from codereview to local branch."""
- if issue_arg.isdigit():
- parsed_issue_arg = _RietveldParsedIssueNumberArgument(int(issue_arg))
+ if isinstance(issue_arg, (int, long)) or issue_arg.isdigit():
+ parsed_issue_arg = _ParsedIssueNumberArgument(int(issue_arg))
else:
# Assume url.
parsed_issue_arg = self._codereview_impl.ParseIssueURL(
@@ -1603,7 +1603,8 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
if parsed_issue_arg.hostname:
self._rietveld_server = 'https://%s' % parsed_issue_arg.hostname
- if parsed_issue_arg.patch_url:
+ if (isinstance(parsed_issue_arg, _RietveldParsedIssueNumberArgument) and
+ parsed_issue_arg.patch_url):
assert parsed_issue_arg.patchset
patchset = parsed_issue_arg.patchset
patch_data = urllib2.urlopen(parsed_issue_arg.patch_url).read()
@@ -4316,6 +4317,9 @@ def CMDdiff(parser, args):
# Create a new branch based on the merge-base
RunGit(['checkout', '-q', '-b', TMP_BRANCH, base_branch])
+ # Update the cached branch in cl instance, to avoid overwriting original
Michael Achenbach 2016/04/07 09:35:53 This could do some more information hiding.
+ # branch properties.
+ cl.branch = cl.branchref = None
try:
rtn = cl.CMDPatchIssue(issue, reject=False, nocommit=False, directory=None)
if rtn != 0:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698