{"thread":{"id":"9987","subject":"[StGit PATCH] Make sure that the output of \"stg status\" is sorted","startedAt":"2007-09-23T23:52:23Z","lastAt":"2007-09-23T23:52:23Z","messageCount":1,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"53874","messageId":"20070923235212.26396.53222.stgit@yoghurt","threadId":"9987","inReplyTo":null,"subject":"[StGit PATCH] Make sure that the output of \"stg status\" is sorted","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-09-23T23:52:23Z","receivedAt":"2007-09-23T23:52:23Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This simplifies testing, but also makes it easier for the user to find\nspecific files.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/status.py |   13 ++++++++-----\n 1 files changed, 8 insertions(+), 5 deletions(-)\n\n\ndiff --git a/stgit/commands/status.py b/stgit/commands/status.py\nindex bbfb5df..b2835ab 100644\n--- a/stgit/commands/status.py\n+++ b/stgit/commands/status.py\n@@ -91,12 +91,15 @@ def status(files = None, modified = False, new = False, deleted = False,\n             filestat.append('?')\n         cache_files = [x for x in cache_files if x[0] in filestat]\n \n-    for fs in cache_files:\n-        assert files == None or fs[1] in files\n-        if not filtered:\n-            out.stdout('%s %s' % (fs[0], fs[1]))\n+    output = []\n+    for st, fn in cache_files:\n+        assert files == None or fn in files\n+        if filtered:\n+            output.append(fn)\n         else:\n-            out.stdout('%s' % fs[1])\n+            output.append('%s %s' % (st, fn))\n+    for o in sorted(output):\n+        out.stdout(o)\n \n def func(parser, options, args):\n     \"\"\"Show the tree status\n"}]}