diff test-onsub.t @ 12:90b54c4fe4fe

onsub extension: pre and post order
author jakob krainz <jakob@hawo-net.de>
date Tue, 06 Mar 2012 12:55:40 +0100
parents 4cb3f28590fd
children b10dd4461b52
line wrap: on
line diff
--- a/test-onsub.t	Tue Mar 06 12:22:06 2012 +0100
+++ b/test-onsub.t	Tue Mar 06 12:55:40 2012 +0100
@@ -39,11 +39,13 @@
   
   options:
   
-   -b --breadth-first  use breadth-first traversal
-      --max-depth N    limit recursion to N levels (negative for no limit)
-                       (default: -1)
-      --ignore-errors  continue execution despite errors
-   -0 --print0         end subrepository names with NUL, for use with xargs
+   -b --breadth-first use breadth-first traversal
+   -p --post-order    use post-order depth-first traversal
+      --root-repo     include root repository in traversal
+      --max-depth N   limit recursion to N levels (negative for no limit)
+                      (default: -1)
+      --ignore-errors continue execution despite errors
+   -0 --print0        end subrepository names with NUL, for use with xargs
   
   use "hg -v help onsub" to show global options
 
@@ -81,7 +83,7 @@
   committing subrepository b/u
   committing subrepository b/v
 
-The default depth-first traversal:
+The default depth-first pre-order traversal:
 
   $ hg onsub 'echo $HG_SUBPATH'
   a
@@ -94,6 +96,55 @@
   b/u
   b/v
 
+Traversal including the root repository:
+
+  $ hg onsub 'echo $HG_SUBPATH' --root-repo
+  .
+  a
+  a/x
+  a/y
+  a/y/r
+  a/y/s
+  a/y/t
+  b
+  b/u
+  b/v
+
+Depth-first post-order traversal: 
+
+  $ hg onsub 'echo $HG_SUBPATH' --post-order
+  a/x
+  a/y/r
+  a/y/s
+  a/y/t
+  a/y
+  a
+  b/u
+  b/v
+  b
+
+Depth-first pre- and post-order traversal:
+
+  $ hg onsub 'echo pre $HG_SUBPATH'  'echo post $HG_SUBPATH'
+  pre a
+  pre a/x
+  post a/x
+  pre a/y
+  pre a/y/r
+  post a/y/r
+  pre a/y/s
+  post a/y/s
+  pre a/y/t
+  post a/y/t
+  post a/y
+  post a
+  pre b
+  pre b/u
+  post b/u
+  pre b/v
+  post b/v
+  post b
+
 Breadth-first traversal:
 
   $ hg onsub 'echo $HG_SUBPATH' --breadth-first
@@ -125,6 +176,10 @@
   a/y
   b/u
   b/v
+  $ hg onsub --max-depth 1 -b --root-repo 'echo $HG_SUBPATH'
+  .
+  a
+  b
 
 Test aborting: