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

Unified Diff: gcl.py

Issue 270047: Fix gcl opened, gcl nothave, and gcl status to:... (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 11 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
===================================================================
--- gcl.py (revision 28595)
+++ gcl.py (working copy)
@@ -602,21 +602,31 @@
return SendToRietveld("/%d/description" % issue)
-def Opened():
+def Opened(show_unknown_files):
"""Prints a list of modified files in the current directory down."""
files = GetModifiedFiles()
cl_keys = files.keys()
cl_keys.sort()
for cl_name in cl_keys:
- if cl_name:
- note = ""
- change_info = ChangeInfo.Load(cl_name, GetRepositoryRoot(),
- fail_on_not_found=True, update_status=False)
- if len(change_info.GetFiles()) != len(files[cl_name]):
- note = " (Note: this changelist contains files outside this directory)"
- print "\n--- Changelist " + cl_name + note + ":"
+ if not cl_name:
+ continue
+ note = ""
+ change_info = ChangeInfo.Load(cl_name, GetRepositoryRoot(),
+ fail_on_not_found=True, update_status=False)
+ if len(change_info.GetFiles()) != len(files[cl_name]):
+ note = " (Note: this changelist contains files outside this directory)"
+ print "\n--- Changelist " + cl_name + note + ":"
for file in files[cl_name]:
print "".join(file)
+ if show_unknown_files:
+ unknown_files = UnknownFiles([])
+ if (files.get('') or (show_unknown_files and len(unknown_files))):
+ print "\n--- Not in any changelist:"
+ for file in files.get('', []):
+ print "".join(file)
+ if show_unknown_files:
+ for file in unknown_files:
+ print "? %s" % file
def Help(argv=None):
@@ -1157,16 +1167,13 @@
# Commands that don't require an argument.
command = argv[1]
- if command == "opened":
- Opened()
+ if command == "opened" or command == "status":
+ Opened(command == "status")
return 0
- if command == "status":
- Opened()
- print "\n--- Not in any changelist:"
- UnknownFiles([])
- return 0
if command == "nothave":
- UnknownFiles(argv[2:])
+ unknown_files = UnknownFiles(argv[2:])
+ for file in unknown_files:
+ print "? " + "".join(file)
return 0
if command == "changes":
Changes()
« 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