##// 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 #testcases dirstate-v1 dirstate-v2
1 #testcases dirstate-v1 dirstate-v2
2
2
3 #if dirstate-v2
3 #if dirstate-v2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [format]
5 > [format]
6 > exp-rc-dirstate-v2=1
6 > exp-rc-dirstate-v2=1
7 > [storage]
7 > [storage]
8 > dirstate-v2.slow-path=allow
8 > dirstate-v2.slow-path=allow
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 Checking the size/permissions/file-type of files stored in the
12 Checking the size/permissions/file-type of files stored in the
13 dirstate after an update where the files are changed concurrently
13 dirstate after an update where the files are changed concurrently
14 outside of hg's control.
14 outside of hg's control.
15
15
16 $ hg init repo
16 $ hg init repo
17 $ cd repo
17 $ cd repo
18 $ echo a > a
18 $ echo a > a
19 $ hg commit -qAm _
19 $ hg commit -qAm _
20 $ echo aa > a
20 $ echo aa > a
21 $ hg commit -m _
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 $ hg debugdirstate --no-dates
29 $ hg debugdirstate --no-dates
24 n 644 3 (set |unset) a (re)
30 n 644 3 (set |unset) a (re)
25
31
26 $ cat >> $TESTTMP/dirstaterace.py << EOF
32 $ cat >> $TESTTMP/dirstaterace.py << EOF
27 > from mercurial import (
33 > from mercurial import (
28 > extensions,
34 > extensions,
29 > merge,
35 > merge,
30 > )
36 > )
31 > def extsetup(ui):
37 > def extsetup(ui):
32 > extensions.wrapfunction(merge, 'applyupdates', wrap)
38 > extensions.wrapfunction(merge, 'applyupdates', wrap)
33 > def wrap(orig, *args, **kwargs):
39 > def wrap(orig, *args, **kwargs):
34 > res = orig(*args, **kwargs)
40 > res = orig(*args, **kwargs)
35 > with open("a", "w"):
41 > with open("a", "w"):
36 > pass # just truncate the file
42 > pass # just truncate the file
37 > return res
43 > return res
38 > EOF
44 > EOF
39
45
40 Do an update where file 'a' is changed between hg writing it to disk
46 Do an update where file 'a' is changed between hg writing it to disk
41 and hg writing the dirstate. The dirstate is correct nonetheless, and
47 and hg writing the dirstate. The dirstate is correct nonetheless, and
42 so hg status correctly shows a as clean.
48 so hg status correctly shows a as clean.
43
49
44 $ hg up -r 0 --config extensions.race=$TESTTMP/dirstaterace.py
50 $ hg up -r 0 --config extensions.race=$TESTTMP/dirstaterace.py
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ hg debugdirstate --no-dates
52 $ hg debugdirstate --no-dates
47 n 644 2 (set |unset) a (re)
53 n 644 2 (set |unset) a (re)
48 $ echo a > a; hg status; hg diff
54 $ echo a > a; hg status; hg diff
General Comments 0
You need to be logged in to leave comments. Login now