tests/test-subrepo-recursion.t
changeset 12588 41fa32a6b6f8
parent 12587 e3247ceaca5e
child 12591 4b9f23885a55
equal deleted inserted replaced
12587:e3247ceaca5e 12588:41fa32a6b6f8
     1 Make status look into subrepositories by default:
     1 Make status look into subrepositories by default:
     2 
     2 
     3   $ echo '[defaults]' >> $HGRCPATH
     3   $ echo '[defaults]' >> $HGRCPATH
     4   $ echo 'status = -S' >> $HGRCPATH
       
     5   $ echo 'diff = --nodates -S' >> $HGRCPATH
       
     6 
     4 
     7 Create test repository:
     5 Create test repository:
     8 
     6 
     9   $ hg init repo
     7   $ hg init repo
    10   $ cd repo
     8   $ cd repo
    34   adding x.txt
    32   adding x.txt
    35   adding foo/y.txt
    33   adding foo/y.txt
    36 
    34 
    37 Test recursive status without committing anything:
    35 Test recursive status without committing anything:
    38 
    36 
    39   $ hg status
    37   $ hg status -S
    40   A .hgsub
    38   A .hgsub
    41   A foo/.hgsub
    39   A foo/.hgsub
    42   A foo/bar/z.txt
    40   A foo/bar/z.txt
    43   A foo/y.txt
    41   A foo/y.txt
    44   A x.txt
    42   A x.txt
    45 
    43 
    46 Test recursive diff without committing anything:
    44 Test recursive diff without committing anything:
    47 
    45 
    48   $ hg diff foo
    46   $ hg diff --nodates -S foo
    49   diff -r 000000000000 foo/.hgsub
    47   diff -r 000000000000 foo/.hgsub
    50   --- /dev/null
    48   --- /dev/null
    51   +++ b/foo/.hgsub
    49   +++ b/foo/.hgsub
    52   @@ -0,0 +1,1 @@
    50   @@ -0,0 +1,1 @@
    53   +bar = bar
    51   +bar = bar
    86 
    84 
    87 Change working directory:
    85 Change working directory:
    88 
    86 
    89   $ echo y3 >> foo/y.txt
    87   $ echo y3 >> foo/y.txt
    90   $ echo z3 >> foo/bar/z.txt
    88   $ echo z3 >> foo/bar/z.txt
    91   $ hg status
    89   $ hg status -S
    92   M foo/bar/z.txt
    90   M foo/bar/z.txt
    93   M foo/y.txt
    91   M foo/y.txt
    94   $ hg diff
    92   $ hg diff --nodates -S
    95   diff -r d254738c5f5e foo/y.txt
    93   diff -r d254738c5f5e foo/y.txt
    96   --- a/foo/y.txt
    94   --- a/foo/y.txt
    97   +++ b/foo/y.txt
    95   +++ b/foo/y.txt
    98   @@ -1,2 +1,3 @@
    96   @@ -1,2 +1,3 @@
    99    y1
    97    y1
   107    z2
   105    z2
   108   +z3
   106   +z3
   109 
   107 
   110 Status call crossing repository boundaries:
   108 Status call crossing repository boundaries:
   111 
   109 
   112   $ hg status foo/bar/z.txt
   110   $ hg status -S foo/bar/z.txt
   113   M foo/bar/z.txt
   111   M foo/bar/z.txt
   114   $ hg status -I 'foo/?.txt'
   112   $ hg status -S -I 'foo/?.txt'
   115   M foo/y.txt
   113   M foo/y.txt
   116   $ hg status -I '**/?.txt'
   114   $ hg status -S -I '**/?.txt'
   117   M foo/bar/z.txt
   115   M foo/bar/z.txt
   118   M foo/y.txt
   116   M foo/y.txt
   119   $ hg diff -I '**/?.txt'
   117   $ hg diff --nodates -S -I '**/?.txt'
   120   diff -r d254738c5f5e foo/y.txt
   118   diff -r d254738c5f5e foo/y.txt
   121   --- a/foo/y.txt
   119   --- a/foo/y.txt
   122   +++ b/foo/y.txt
   120   +++ b/foo/y.txt
   123   @@ -1,2 +1,3 @@
   121   @@ -1,2 +1,3 @@
   124    y1
   122    y1
   135 Status from within a subdirectory:
   133 Status from within a subdirectory:
   136 
   134 
   137   $ mkdir dir
   135   $ mkdir dir
   138   $ cd dir
   136   $ cd dir
   139   $ echo a1 > a.txt
   137   $ echo a1 > a.txt
   140   $ hg status
   138   $ hg status -S
   141   M foo/bar/z.txt
   139   M foo/bar/z.txt
   142   M foo/y.txt
   140   M foo/y.txt
   143   ? dir/a.txt
   141   ? dir/a.txt
   144   $ hg diff
   142   $ hg diff --nodates -S
   145   diff -r d254738c5f5e foo/y.txt
   143   diff -r d254738c5f5e foo/y.txt
   146   --- a/foo/y.txt
   144   --- a/foo/y.txt
   147   +++ b/foo/y.txt
   145   +++ b/foo/y.txt
   148   @@ -1,2 +1,3 @@
   146   @@ -1,2 +1,3 @@
   149    y1
   147    y1
   157    z2
   155    z2
   158   +z3
   156   +z3
   159 
   157 
   160 Status with relative path:
   158 Status with relative path:
   161 
   159 
   162   $ hg status ..
   160   $ hg status -S ..
   163   M ../foo/bar/z.txt
   161   M ../foo/bar/z.txt
   164   M ../foo/y.txt
   162   M ../foo/y.txt
   165   ? a.txt
   163   ? a.txt
   166   $ hg diff ..
   164   $ hg diff --nodates -S ..
   167   diff -r d254738c5f5e foo/y.txt
   165   diff -r d254738c5f5e foo/y.txt
   168   --- a/foo/y.txt
   166   --- a/foo/y.txt
   169   +++ b/foo/y.txt
   167   +++ b/foo/y.txt
   170   @@ -1,2 +1,3 @@
   168   @@ -1,2 +1,3 @@
   171    y1
   169    y1
   205   1:9647f22de499 0-1-1
   203   1:9647f22de499 0-1-1
   206   0:4904098473f9 0-0-0
   204   0:4904098473f9 0-0-0
   207 
   205 
   208 Status between revisions:
   206 Status between revisions:
   209 
   207 
   210   $ hg status
   208   $ hg status -S
   211   $ hg status --rev 0:1
   209   $ hg status -S --rev 0:1
   212   M .hgsubstate
   210   M .hgsubstate
   213   M foo/.hgsubstate
   211   M foo/.hgsubstate
   214   M foo/bar/z.txt
   212   M foo/bar/z.txt
   215   M foo/y.txt
   213   M foo/y.txt
   216   $ hg diff -I '**/?.txt' --rev 0:1
   214   $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
   217   diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
   215   diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
   218   --- a/foo/y.txt
   216   --- a/foo/y.txt
   219   +++ b/foo/y.txt
   217   +++ b/foo/y.txt
   220   @@ -1,1 +1,2 @@
   218   @@ -1,1 +1,2 @@
   221    y1
   219    y1
   279   [1]
   277   [1]
   280 
   278 
   281 Make nested change:
   279 Make nested change:
   282 
   280 
   283   $ echo y4 >> foo/y.txt
   281   $ echo y4 >> foo/y.txt
   284   $ hg diff
   282   $ hg diff --nodates -S
   285   diff -r 65903cebad86 foo/y.txt
   283   diff -r 65903cebad86 foo/y.txt
   286   --- a/foo/y.txt
   284   --- a/foo/y.txt
   287   +++ b/foo/y.txt
   285   +++ b/foo/y.txt
   288   @@ -1,3 +1,4 @@
   286   @@ -1,3 +1,4 @@
   289    y1
   287    y1
   311   
   309   
   312   comparing with */repo/foo/bar (glob)
   310   comparing with */repo/foo/bar (glob)
   313   searching for changes
   311   searching for changes
   314   no changes found
   312   no changes found
   315 
   313 
       
   314 
   316 Switch to original repo and setup default path:
   315 Switch to original repo and setup default path:
   317 
   316 
   318   $ cd ../repo
   317   $ cd ../repo
   319   $ echo '[paths]' >> .hg/hgrc
   318   $ echo '[paths]' >> .hg/hgrc
   320   $ echo 'default = ../repo2' >> .hg/hgrc
   319   $ echo 'default = ../repo2' >> .hg/hgrc
   347   [255]
   346   [255]
   348 
   347 
   349 Test missing subrepo:
   348 Test missing subrepo:
   350 
   349 
   351   $ rm -r foo
   350   $ rm -r foo
   352   $ hg status
   351   $ hg status -S
   353   warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
   352   warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"