merge with stable
authorAugie Fackler <augie@google.com>
Wed, 06 Dec 2017 16:45:38 -0500
changeset 40933 84607c8b5af824af4e04b5f60fbbd882754cb85e
parent 40932 d4ad9d695a9e453b2ccd622207d14bca80550457 (current diff)
parent 40910 aa905f9cdcdacfa28a5c1c001623ff6e3dd5a447 (diff)
child 40934 91a7204631f1aba64e9d8608e32a8106922a866e
push id615
push usergszorc@mozilla.com
push dateFri, 08 Dec 2017 00:11:22 +0000
merge with stable
new file mode 100644
--- /dev/null
+++ b/tests/list-tree.py
@@ -0,0 +1,27 @@
+from __future__ import (
+    absolute_import,
+    print_function,
+)
+
+import argparse
+import os
+
+ap = argparse.ArgumentParser()
+ap.add_argument('path', nargs='+')
+opts = ap.parse_args()
+
+def gather():
+    for p in opts.path:
+        if not os.path.exists(p):
+            return
+        if os.path.isdir(p):
+            yield p + os.path.sep
+            for dirpath, dirs, files in os.walk(p):
+                for d in dirs:
+                    yield os.path.join(dirpath, d) + os.path.sep
+                for f in files:
+                    yield os.path.join(dirpath, f)
+        else:
+            yield p
+
+print('\n'.join(sorted(gather())))
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -1090,18 +1090,17 @@ largefiles (issue4547)
   $ hg -R subrepo-root revert --all
   reverting subrepo-root/.hglf/large (glob)
   reverting subrepo no-largefiles
   reverting subrepo-root/no-largefiles/normal1 (glob)
 
 Move (and then undo) a directory move with only largefiles.
 
   $ listtree() {
-  >   find $@ \( -type d -printf "%p/\n" -o -type f -printf "%p\n" \) \
-  >           -a -name .hg -prune | sort
+  >   $PYTHON $TESTDIR/list-tree.py $@
   > }
 
   $ cd subrepo-root
   $ listtree .hglf dir* large*
   .hglf/
   .hglf/dir/
   .hglf/dir/subdir/
   .hglf/dir/subdir/large.bin