Debian Codegraph @

tests/test-dirstate-backup.t

raw
1 Set up
2
3 $ cat >> $HGRCPATH << EOF
4 > [format]
5 > use-dirstate-v2=true
6 > [storage]
7 > dirstate-v2.slow-path=allow
8 > EOF
9
10 $ hg init repo
11 $ cd repo
12 $ echo a > a
13 $ hg add a
14 $ hg commit -m a
15
16 Try to import an empty patch
17
18 $ hg import --no-commit - <<EOF
19 > EOF
20 applying patch from stdin
21 abort: stdin: no diffs found
22 [10]
23
24 No dirstate backups are left behind
25
26 $ ls .hg/dirstate* | sort
27 .hg/dirstate
28 .hg/dirstate.* (glob) (dirstate-v2 !)
29
30 $ cd ..
31
32 Transaction undo doesn't leave garbage dirstate .bck files around:
33
34 $ hg share --config extensions.share= repo +share1+ -q
35 $ hg share --config extensions.share= repo +share2+ -q
36
37 $ c() {
38 > echo "$1" >> x;
39 > hg commit x -qAmx --config devel.dirstate.v2.data_update_mode=force-new;
40 > ls .hg/undo.*dirstate* | wc -l | grep -o '[0-9]*';
41 > }
42 $ c1() { (cd +share1+; c "$@"); }
43 $ c2() { (cd +share2+; c "$@"); }
44 $ c1 a
45 3
46 $ c2 b
47 3
48 $ c1 c
49 3
50 $ c2 d
51 3
52 $ c1 e
53 3
54 $ c2 f
55 3