tests/test-dirstate-status-write-race.t
branchstable
changeset 50217 718fcccae326
parent 50216 02bf2f94a04c
child 50218 ee75dd844ab6
equal deleted inserted replaced
50216:02bf2f94a04c 50217:718fcccae326
   236 
   236 
   237 final cleanup
   237 final cleanup
   238 
   238 
   239   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   239   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
   240   $ cd ..
   240   $ cd ..
       
   241 
       
   242 Race with a `hg commit`
       
   243 ----------------------
       
   244 
       
   245   $ cp -a reference-repo race-with-commit
       
   246   $ cd race-with-commit
       
   247 
       
   248 spin a `hg status` with some caches to update
       
   249 
       
   250   $ touch -t 200001020001 dir/j
       
   251   $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
       
   252   > --config rhg.on-unsupported=abort \
       
   253   > --config devel.sync.status.pre-dirstate-write-file=$TESTTMP/status-race-lock \
       
   254   > &
       
   255   $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
       
   256 
       
   257 Add a file and force the data file rewrite
       
   258 
       
   259   $ hg commit -m created-during-status dir/o
       
   260   $ touch $TESTTMP/status-race-lock
       
   261   $ wait
       
   262 
       
   263 The parent must change and the status should be clean
       
   264 
       
   265 # XXX rhg misbehaves here
       
   266 #if no-rhg
       
   267   $ hg summary
       
   268   parent: 2:2e3b442a2fd4 tip
       
   269    created-during-status
       
   270   branch: default
       
   271   commit: 1 removed, 3 unknown
       
   272   update: (current)
       
   273   phases: 3 draft
       
   274   $ hg status
       
   275   R dir/nested/m
       
   276   ? dir/n
       
   277   ? p
       
   278   ? q
       
   279 #else
       
   280   $ hg summary
       
   281   parent: 1:c349430a1631 
       
   282    more files to have two commits
       
   283   branch: default
       
   284   commit: 1 added, 1 removed, 3 unknown (new branch head)
       
   285   update: 1 new changesets (update)
       
   286   phases: 3 draft
       
   287   $ hg status
       
   288   A dir/o
       
   289   R dir/nested/m
       
   290   ? dir/n
       
   291   ? p
       
   292   ? q
       
   293 #endif
       
   294 
       
   295 The status process should return a consistent result and not crash.
       
   296 
       
   297   $ cat $TESTTMP/status-race-lock.out
       
   298   A dir/o
       
   299   R dir/nested/m
       
   300   ? dir/n
       
   301   ? p
       
   302   ? q
       
   303   $ cat $TESTTMP/status-race-lock.log
       
   304 
       
   305 final cleanup
       
   306 
       
   307   $ rm $TESTTMP/status-race-lock $TESTTMP/status-race-lock.waiting
       
   308   $ cd ..
       
   309