##// END OF EJS Templates
tests: make sure no ambiguities remains after the commit...
marmoute -
r49197:a4a5d123 default
parent child Browse files
Show More
@@ -1,48 +1,54 b''
1 1 #testcases dirstate-v1 dirstate-v2
2 2
3 3 #if dirstate-v2
4 4 $ cat >> $HGRCPATH << EOF
5 5 > [format]
6 6 > exp-rc-dirstate-v2=1
7 7 > [storage]
8 8 > dirstate-v2.slow-path=allow
9 9 > EOF
10 10 #endif
11 11
12 12 Checking the size/permissions/file-type of files stored in the
13 13 dirstate after an update where the files are changed concurrently
14 14 outside of hg's control.
15 15
16 16 $ hg init repo
17 17 $ cd repo
18 18 $ echo a > a
19 19 $ hg commit -qAm _
20 20 $ echo aa > a
21 21 $ hg commit -m _
22 # this sleep is there to ensure current time has -at-least- one second away
23 # from the current time. It ensure the mtime is not ambiguous. If the test
24 # "sleep" longer this will be fine.
25 # It is not used to synchronise parallele operation so it is "fine" to use it.
26 $ sleep 1
27 $ hg status
22 28
23 29 $ hg debugdirstate --no-dates
24 30 n 644 3 (set |unset) a (re)
25 31
26 32 $ cat >> $TESTTMP/dirstaterace.py << EOF
27 33 > from mercurial import (
28 34 > extensions,
29 35 > merge,
30 36 > )
31 37 > def extsetup(ui):
32 38 > extensions.wrapfunction(merge, 'applyupdates', wrap)
33 39 > def wrap(orig, *args, **kwargs):
34 40 > res = orig(*args, **kwargs)
35 41 > with open("a", "w"):
36 42 > pass # just truncate the file
37 43 > return res
38 44 > EOF
39 45
40 46 Do an update where file 'a' is changed between hg writing it to disk
41 47 and hg writing the dirstate. The dirstate is correct nonetheless, and
42 48 so hg status correctly shows a as clean.
43 49
44 50 $ hg up -r 0 --config extensions.race=$TESTTMP/dirstaterace.py
45 51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 52 $ hg debugdirstate --no-dates
47 53 n 644 2 (set |unset) a (re)
48 54 $ echo a > a; hg status; hg diff
General Comments 0
You need to be logged in to leave comments. Login now