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

Unified Diff: apply_issue.py

Issue 10914068: Enable anonymous apply_issue behavior by default and only fall back to login when needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Update help Created 8 years, 3 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 | rietveld.py » ('j') | third_party/upload.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apply_issue.py
diff --git a/apply_issue.py b/apply_issue.py
index d79ee7b88ccc387cff4c0fcd5d0f7fcbbc879e1e..3d606466e710afdeaa1a4c0bad0a2eb0f34566f6 100755
--- a/apply_issue.py
+++ b/apply_issue.py
@@ -28,7 +28,7 @@ def main():
parser.add_option(
'-e',
'--email',
- help='Email address for authenticating with Rietveld')
+ help='IGNORED: Kept for compatibility.')
parser.add_option(
'-i', '--issue', type='int', help='Rietveld issue number')
parser.add_option(
@@ -56,15 +56,16 @@ def main():
if not options.server:
parser.error('Require a valid server')
- # TODO(rogerta): Remove me, it's ugly.
- if options.email == '=':
- options.email = ''
-
- obj = rietveld.Rietveld(options.server, options.email, None)
+ obj = rietveld.Rietveld(options.server, '', None)
+ try:
+ properties = obj.get_issue_properties(options.issue, False)
+ except rietveld.upload.ClientLoginError:
+ # Requires login.
+ obj = rietveld.Rietveld(options.server, None, None)
+ properties = obj.get_issue_properties(options.issue, False)
if not options.patchset:
- options.patchset = obj.get_issue_properties(
- options.issue, False)['patchsets'][-1]
+ options.patchset = properties['patchsets'][-1]
print('No patchset specified. Using patchset %d' % options.patchset)
print('Downloading the patch.')
« no previous file with comments | « no previous file | rietveld.py » ('j') | third_party/upload.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698