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

Unified Diff: gcl.py

Issue 4135011: Make gcl delete foo more useful by being able to delete corrupted change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 10 years, 2 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 09364251f18bb7ef34ecfbc1916224055aef78e4..04c62b73c01b6bee2ab84db804db368fdd555a59 100755
--- a/gcl.py
+++ b/gcl.py
@@ -445,7 +445,10 @@ class ChangeInfo(object):
split_data = gclient_utils.FileRead(info_file, 'r').split(
ChangeInfo._SEPARATOR, 2)
if len(split_data) != 3:
- ErrorExit("Changelist file %s is corrupt" % info_file)
+ ErrorExit(
+ ('Changelist file %s is corrupt.\n'
+ 'Either run "gcl delete %s" or manually edit the file') % (
+ info_file, changename))
items = split_data[0].split(', ')
issue = 0
patchset = 0
@@ -464,7 +467,7 @@ class ChangeInfo(object):
description = split_data[2]
save = False
if update_status:
- for item in files:
+ for item in files[:]:
filename = os.path.join(local_root, item[1])
status_result = SVN.CaptureStatus(filename)
if not status_result or not status_result[0][0]:
@@ -1193,10 +1196,11 @@ def CMDdescription(change_info):
return 0
-@need_change
-def CMDdelete(change_info):
+def CMDdelete(args):
"""Deletes a changelist."""
- change_info.Delete()
+ if not len(args) == 1:
+ ErrorExit('You need to pass a change list name')
+ os.remove(GetChangelistInfoFile(args[0]))
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