##// END OF EJS Templates
dirstate: deal with read-race for python code using rust object...
marmoute -
r51133:c9066fc6 stable
parent child Browse files
Show More
@@ -133,6 +133,7 b' class _dirstatemapcommon:'
133 while attempts < V2_MAX_READ_ATTEMPTS:
133 while attempts < V2_MAX_READ_ATTEMPTS:
134 attempts += 1
134 attempts += 1
135 try:
135 try:
136 # TODO: use mmap when possible
136 data = self._opener.read(self.docket.data_filename())
137 data = self._opener.read(self.docket.data_filename())
137 except FileNotFoundError:
138 except FileNotFoundError:
138 # read race detected between docket and data file
139 # read race detected between docket and data file
@@ -568,14 +569,12 b' if rustmod is not None:'
568
569
569 testing.wait_on_cfg(self._ui, b'dirstate.pre-read-file')
570 testing.wait_on_cfg(self._ui, b'dirstate.pre-read-file')
570 if self._use_dirstate_v2:
571 if self._use_dirstate_v2:
571 if self.docket.uuid:
572 self.docket # load the data if needed
572 testing.wait_on_cfg(
573 testing.wait_on_cfg(self._ui, b'dirstate.post-docket-read-file')
573 self._ui, b'dirstate.post-docket-read-file'
574 if not self.docket.uuid:
574 )
575 data = b''
575 # TODO: use mmap when possible
576 data = self._opener.read(self.docket.data_filename())
577 else:
576 else:
578 data = b''
577 data = self._read_v2_data()
579 self._map = rustmod.DirstateMap.new_v2(
578 self._map = rustmod.DirstateMap.new_v2(
580 data, self.docket.data_size, self.docket.tree_metadata
579 data, self.docket.data_size, self.docket.tree_metadata
581 )
580 )
@@ -204,8 +204,12 b' The status process should return a consi'
204 #if rust
204 #if rust
205 #if dirstate-v2-rewrite
205 #if dirstate-v2-rewrite
206 $ cat $TESTTMP/status-race-lock.out
206 $ cat $TESTTMP/status-race-lock.out
207 A dir/n
208 A dir/o
209 R dir/nested/m
210 ? p
211 ? q
207 $ cat $TESTTMP/status-race-lock.log
212 $ cat $TESTTMP/status-race-lock.log
208 abort: $ENOENT$: '$TESTTMP/race-with-add/.hg/dirstate.* (glob)
209 #else
213 #else
210 $ cat $TESTTMP/status-race-lock.out
214 $ cat $TESTTMP/status-race-lock.out
211 A dir/o
215 A dir/o
@@ -309,8 +313,12 b' The status process should return a consi'
309 #if rust
313 #if rust
310 #if dirstate-v2-rewrite
314 #if dirstate-v2-rewrite
311 $ cat $TESTTMP/status-race-lock.out
315 $ cat $TESTTMP/status-race-lock.out
316 M dir/o
317 ? dir/n
318 ? p
319 ? q
312 $ cat $TESTTMP/status-race-lock.log
320 $ cat $TESTTMP/status-race-lock.log
313 abort: $ENOENT$: '$TESTTMP/race-with-commit/.hg/dirstate.* (glob)
321 warning: ignoring unknown working parent 02a67a77ee9b!
314 #else
322 #else
315 $ cat $TESTTMP/status-race-lock.out
323 $ cat $TESTTMP/status-race-lock.out
316 A dir/o
324 A dir/o
@@ -441,8 +449,11 b' The status process should return a consi'
441 #if rust
449 #if rust
442 #if dirstate-v2-rewrite
450 #if dirstate-v2-rewrite
443 $ cat $TESTTMP/status-race-lock.out
451 $ cat $TESTTMP/status-race-lock.out
452 A dir/o
453 ? dir/n
454 ? p
455 ? q
444 $ cat $TESTTMP/status-race-lock.log
456 $ cat $TESTTMP/status-race-lock.log
445 abort: $ENOENT$: '$TESTTMP/race-with-update/.hg/dirstate.* (glob)
446 #else
457 #else
447 $ cat $TESTTMP/status-race-lock.out
458 $ cat $TESTTMP/status-race-lock.out
448 A dir/o
459 A dir/o
@@ -540,8 +551,12 b' The status process should return a consi'
540 #if rust
551 #if rust
541 #if dirstate-v2-rewrite
552 #if dirstate-v2-rewrite
542 $ cat $TESTTMP/status-race-lock.out
553 $ cat $TESTTMP/status-race-lock.out
554 A dir/o
555 R dir/nested/m
556 ? dir/n
557 ? p
558 ? q
543 $ cat $TESTTMP/status-race-lock.log
559 $ cat $TESTTMP/status-race-lock.log
544 abort: $ENOENT$: '$TESTTMP/race-with-status/.hg/dirstate.* (glob)
545 #else
560 #else
546 $ cat $TESTTMP/status-race-lock.out
561 $ cat $TESTTMP/status-race-lock.out
547 A dir/o
562 A dir/o
General Comments 0
You need to be logged in to leave comments. Login now