changeset 38599:f9805627af1f

fileset: sort debugfileset output Unlike revset, the order of fileset result doesn't matter since it's used as a matcher predicate. This stabilizes debugfileset output for upcoming changes.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jun 2018 18:26:04 +0900
parents d046bf37f1ba
children a936d1368fc5
files mercurial/debugcommands.py tests/test-fileset.t
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sat Jun 09 18:00:26 2018 +0900
+++ b/mercurial/debugcommands.py	Sat Jun 09 18:26:04 2018 +0900
@@ -884,7 +884,7 @@
         tree = fileset.parse(expr)
         ui.note(fileset.prettyformat(tree), "\n")
 
-    for f in ctx.getfileset(expr):
+    for f in sorted(ctx.getfileset(expr)):
         ui.write("%s\n" % f)
 
 @command('debugformat',
--- a/tests/test-fileset.t	Sat Jun 09 18:00:26 2018 +0900
+++ b/tests/test-fileset.t	Sat Jun 09 18:26:04 2018 +0900
@@ -169,8 +169,8 @@
   R a2
   ? c3
   $ fileset -r0 'added() and revs("wdir()", modified() or removed() or unknown())'
+  a2
   b2
-  a2
   $ fileset -r0 'added() or revs("wdir()", added())'
   a1
   a2
@@ -192,9 +192,9 @@
   bin
 
   $ fileset 'grep("b{1}")'
+  b1
   b2
   c1
-  b1
   $ fileset 'grep("missingparens(")'
   hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re)
   [255]
@@ -403,21 +403,18 @@
   dos
   mixed
   $ fileset 'eol(unix)'
-  mixed
   .hgsub
   .hgsubstate
   b1
   b2
   c1
+  mixed
   $ fileset 'eol(mac)'
   mac
 
 Test safety of 'encoding' on removed files
 
   $ fileset 'encoding("ascii")'
-  dos
-  mac
-  mixed
   .hgsub
   .hgsubstate
   1k
@@ -427,6 +424,9 @@
   b2link (symlink !)
   bin
   c1
+  dos
+  mac
+  mixed
 
 Test detection of unintentional 'matchctx.existing()' invocation
 
@@ -561,12 +561,12 @@
 ---------------------------------------
 
   $ fileset "revs('0+4', added())"
+  .hgsub
+  .hgsubstate
   a1
   a2
   b1
   b2
-  .hgsub
-  .hgsubstate
 
 overlapping set