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

Unified Diff: gcl.py

Issue 6735029: gcl delete <non-existent change> won't throw an exception anymore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: better error message Created 9 years, 9 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: gcl.py
diff --git a/gcl.py b/gcl.py
index 6136d1c5a96ee6f198d37ed1606621294b854b90..2b63e36779bf0fe5ee3fdde133c5fb198cab79d0 100755
--- a/gcl.py
+++ b/gcl.py
@@ -1304,7 +1304,10 @@ def CMDdelete(args):
"""Deletes a changelist."""
if not len(args) == 1:
ErrorExit('You need to pass a change list name')
- os.remove(GetChangelistInfoFile(args[0]))
+ filepath = GetChangelistInfoFile(args[0])
+ if not os.path.isfile(filepath):
+ ErrorExit('You need to pass a valid change list name')
+ os.remove(filepath)
return 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