tests/test-dirstate-status-write-race.t
branchstable
changeset 50244 07d030b38097
parent 50225 53ca3e3bc013
child 50245 dbe09fb038fc
equal deleted inserted replaced
50243:6cce0afc1454 50244:07d030b38097
   240   $ wait
   240   $ wait
   241 
   241 
   242 The file should in a "added" state
   242 The file should in a "added" state
   243 
   243 
   244   $ hg status
   244   $ hg status
   245   A dir/n (no-rhg !)
   245   A dir/n (no-rhg dirstate-v1 !)
   246   A dir/n (rhg dirstate-v2-rewrite !)
   246   A dir/n (no-dirstate-v1 !)
   247   A dir/n (missing-correct-output rhg dirstate-v1 !)
   247   A dir/n (missing-correct-output rhg dirstate-v1 !)
   248   A dir/o
   248   A dir/o
   249   R dir/nested/m
   249   R dir/nested/m
   250   ? dir/n (known-bad-output rhg no-dirstate-v2-rewrite !)
   250   ? dir/n (known-bad-output rhg dirstate-v1 !)
   251   ? p
   251   ? p
   252   ? q
   252   ? q
   253 
   253 
   254 The status process should return a consistent result and not crash.
   254 The status process should return a consistent result and not crash.
   255 
   255 
   258   R dir/nested/m
   258   R dir/nested/m
   259   ? dir/n
   259   ? dir/n
   260   ? p
   260   ? p
   261   ? q
   261   ? q
   262   $ cat $TESTTMP/status-race-lock.log
   262   $ cat $TESTTMP/status-race-lock.log
   263   abort: when writing $TESTTMP/race-with-add/.hg/dirstate.*: $ENOENT$ (glob) (known-bad-output rhg dirstate-v2-rewrite !)
       
   264 
   263 
   265 final cleanup
   264 final cleanup
   266 
   265 
   267   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   266   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   268   $ cd ..
   267   $ cd ..
   289   $ wait
   288   $ wait
   290 
   289 
   291 The parent must change and the status should be clean
   290 The parent must change and the status should be clean
   292 
   291 
   293 # XXX rhg misbehaves here
   292 # XXX rhg misbehaves here
   294 #if no-rhg
   293 #if rhg dirstate-v1
       
   294   $ hg summary
       
   295   parent: 1:c349430a1631 
       
   296    more files to have two commits
       
   297   branch: default
       
   298   commit: 1 added, 1 removed, 3 unknown (new branch head)
       
   299   update: 1 new changesets (update)
       
   300   phases: 3 draft
       
   301   $ hg status
       
   302   A dir/o
       
   303   R dir/nested/m
       
   304   ? dir/n
       
   305   ? p
       
   306   ? q
       
   307 #else
   295   $ hg summary
   308   $ hg summary
   296   parent: 2:2e3b442a2fd4 tip
   309   parent: 2:2e3b442a2fd4 tip
   297    created-during-status
   310    created-during-status
   298   branch: default
   311   branch: default
   299   commit: 1 removed, 3 unknown
   312   commit: 1 removed, 3 unknown
   302   $ hg status
   315   $ hg status
   303   R dir/nested/m
   316   R dir/nested/m
   304   ? dir/n
   317   ? dir/n
   305   ? p
   318   ? p
   306   ? q
   319   ? q
   307 #else
       
   308   $ hg summary
       
   309   parent: 1:c349430a1631 
       
   310    more files to have two commits
       
   311   branch: default
       
   312   commit: 1 added, 1 removed, 3 unknown (new branch head)
       
   313   update: 1 new changesets (update)
       
   314   phases: 3 draft
       
   315   $ hg status
       
   316   A dir/o
       
   317   R dir/nested/m
       
   318   ? dir/n
       
   319   ? p
       
   320   ? q
       
   321 #endif
   320 #endif
   322 
   321 
   323 The status process should return a consistent result and not crash.
   322 The status process should return a consistent result and not crash.
   324 
   323 
   325   $ cat $TESTTMP/status-race-lock.out
   324   $ cat $TESTTMP/status-race-lock.out
   327   R dir/nested/m
   326   R dir/nested/m
   328   ? dir/n
   327   ? dir/n
   329   ? p
   328   ? p
   330   ? q
   329   ? q
   331   $ cat $TESTTMP/status-race-lock.log
   330   $ cat $TESTTMP/status-race-lock.log
   332   abort: when removing $TESTTMP/race-with-commit/.hg/dirstate.*: $ENOENT$ (glob) (known-bad-output rhg dirstate-v2-rewrite !)
       
   333 
   331 
   334 final cleanup
   332 final cleanup
   335 
   333 
   336   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   334   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   337   $ cd ..
   335   $ cd ..
   416   $ wait
   414   $ wait
   417 
   415 
   418 the first update should be on disk
   416 the first update should be on disk
   419 
   417 
   420   $ hg debugstate --all | grep "g"
   418   $ hg debugstate --all | grep "g"
       
   419   n 644          0 2000-01-01 00:10:00 g (known-bad-output rhg dirstate-v1 !)
       
   420   n 644          0 2000-01-01 00:25:00 g (rhg no-dirstate-v1 !)
   421   n 644          0 2000-01-01 00:25:00 g (no-rhg !)
   421   n 644          0 2000-01-01 00:25:00 g (no-rhg !)
   422   n 644          0 2000-01-01 00:25:00 g (missing-correct-output rhg !)
       
   423   n 644          0 2000-01-01 00:10:00 g (known-bad-output rhg !)
       
   424 
   422 
   425 The status process should return a consistent result and not crash.
   423 The status process should return a consistent result and not crash.
   426 
   424 
   427   $ cat $TESTTMP/status-race-lock.out
   425   $ cat $TESTTMP/status-race-lock.out
   428   A dir/o
   426   A dir/o
   429   R dir/nested/m
   427   R dir/nested/m
   430   ? dir/n
   428   ? dir/n
   431   ? p
   429   ? p
   432   ? q
   430   ? q
   433   $ cat $TESTTMP/status-race-lock.log
   431   $ cat $TESTTMP/status-race-lock.log
   434   abort: when removing $TESTTMP/race-with-status/.hg/dirstate.*: $ENOENT$ (glob) (known-bad-output rhg dirstate-v2-rewrite !)
       
   435 
   432 
   436 final cleanup
   433 final cleanup
   437 
   434 
   438   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   435   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   439   $ cd ..
   436   $ cd ..