Commit 88c32d80 authored by pkasting@chromium.org's avatar pkasting@chromium.org

Fix gcl opened, gcl nothave, and gcl status to:

* Actually print unknown files
* Put things in the proper order (i.e. files with no changelist under the "no changelist" header)
Review URL: http://codereview.chromium.org/270047

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@28719 0039d316-1c4b-4281-b951-d872f2087c98
parent ea6c2c5c
...@@ -602,13 +602,14 @@ def GetIssueDescription(issue): ...@@ -602,13 +602,14 @@ def GetIssueDescription(issue):
return SendToRietveld("/%d/description" % issue) return SendToRietveld("/%d/description" % issue)
def Opened(): def Opened(show_unknown_files):
"""Prints a list of modified files in the current directory down.""" """Prints a list of modified files in the current directory down."""
files = GetModifiedFiles() files = GetModifiedFiles()
cl_keys = files.keys() cl_keys = files.keys()
cl_keys.sort() cl_keys.sort()
for cl_name in cl_keys: for cl_name in cl_keys:
if cl_name: if not cl_name:
continue
note = "" note = ""
change_info = ChangeInfo.Load(cl_name, GetRepositoryRoot(), change_info = ChangeInfo.Load(cl_name, GetRepositoryRoot(),
fail_on_not_found=True, update_status=False) fail_on_not_found=True, update_status=False)
...@@ -617,6 +618,15 @@ def Opened(): ...@@ -617,6 +618,15 @@ def Opened():
print "\n--- Changelist " + cl_name + note + ":" print "\n--- Changelist " + cl_name + note + ":"
for file in files[cl_name]: for file in files[cl_name]:
print "".join(file) 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): def Help(argv=None):
...@@ -1157,16 +1167,13 @@ def main(argv=None): ...@@ -1157,16 +1167,13 @@ def main(argv=None):
# Commands that don't require an argument. # Commands that don't require an argument.
command = argv[1] command = argv[1]
if command == "opened": if command == "opened" or command == "status":
Opened() Opened(command == "status")
return 0
if command == "status":
Opened()
print "\n--- Not in any changelist:"
UnknownFiles([])
return 0 return 0
if command == "nothave": if command == "nothave":
UnknownFiles(argv[2:]) unknown_files = UnknownFiles(argv[2:])
for file in unknown_files:
print "? " + "".join(file)
return 0 return 0
if command == "changes": if command == "changes":
Changes() Changes()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment