##// END OF EJS Templates
narrow: show repo corruption when commiting empty files...
Valentin Gatien-Baron -
r48769:cc33deae stable
parent child Browse files
Show More
@@ -1,106 +1,118 b''
1 #testcases flat tree
1 #testcases flat tree
2
2
3 $ . "$TESTDIR/narrow-library.sh"
3 $ . "$TESTDIR/narrow-library.sh"
4
4
5 #if tree
5 #if tree
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [experimental]
7 > [experimental]
8 > treemanifest = 1
8 > treemanifest = 1
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 create full repo
12 create full repo
13
13
14 $ hg init master
14 $ hg init master
15 $ cd master
15 $ cd master
16
16
17 $ mkdir inside
17 $ mkdir inside
18 $ echo inside > inside/f1
18 $ echo inside > inside/f1
19 $ mkdir outside
19 $ mkdir outside
20 $ echo outside > outside/f1
20 $ echo outside > outside/f1
21 $ hg ci -Aqm 'initial'
21 $ hg ci -Aqm 'initial'
22
22
23 $ echo modified > inside/f1
23 $ echo modified > inside/f1
24 $ hg ci -qm 'modify inside'
24 $ hg ci -qm 'modify inside'
25
25
26 $ echo modified > outside/f1
26 $ echo modified > outside/f1
27 $ hg ci -qm 'modify outside'
27 $ hg ci -qm 'modify outside'
28
28
29 $ cd ..
29 $ cd ..
30
30
31 (The lfs extension does nothing here, but this test ensures that its hook that
31 (The lfs extension does nothing here, but this test ensures that its hook that
32 determines whether to add the lfs requirement, respects the narrow boundaries.)
32 determines whether to add the lfs requirement, respects the narrow boundaries.)
33
33
34 $ hg --config extensions.lfs= clone --narrow ssh://user@dummy/master narrow \
34 $ hg --config extensions.lfs= clone --narrow ssh://user@dummy/master narrow \
35 > --include inside
35 > --include inside
36 requesting all changes
36 requesting all changes
37 adding changesets
37 adding changesets
38 adding manifests
38 adding manifests
39 adding file changes
39 adding file changes
40 added 3 changesets with 2 changes to 1 files
40 added 3 changesets with 2 changes to 1 files
41 new changesets *:* (glob)
41 new changesets *:* (glob)
42 updating to branch default
42 updating to branch default
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd narrow
44 $ cd narrow
45
45
46 $ hg update -q 0
46 $ hg update -q 0
47
47
48 Can not modify dirstate outside
48 Can not modify dirstate outside
49
49
50 $ mkdir outside
50 $ mkdir outside
51 $ touch outside/f1
51 $ touch outside/f1
52 $ hg debugwalk -v -I 'relglob:f1'
52 $ hg debugwalk -v -I 'relglob:f1'
53 * matcher:
53 * matcher:
54 <includematcher includes='(?:|.*/)f1(?:/|$)'>
54 <includematcher includes='(?:|.*/)f1(?:/|$)'>
55 f inside/f1 inside/f1
55 f inside/f1 inside/f1
56 $ hg add .
56 $ hg add .
57 $ hg add outside/f1
57 $ hg add outside/f1
58 abort: cannot track 'outside/f1' - it is outside the narrow clone
58 abort: cannot track 'outside/f1' - it is outside the narrow clone
59 [255]
59 [255]
60 $ touch outside/f3
60 $ touch outside/f3
61 $ hg add outside/f3
61 $ hg add outside/f3
62 abort: cannot track 'outside/f3' - it is outside the narrow clone
62 abort: cannot track 'outside/f3' - it is outside the narrow clone
63 [255]
63 [255]
64
64
65 But adding a truly excluded file shouldn't count
65 But adding a truly excluded file shouldn't count
66
66
67 $ hg add outside/f3 -X outside/f3
67 $ hg add outside/f3 -X outside/f3
68
68
69 $ rm -r outside
69 $ rm -r outside
70
70
71 Can modify dirstate inside
71 Can modify dirstate inside
72
72
73 $ echo modified > inside/f1
73 $ echo modified > inside/f1
74 $ touch inside/f3
74 $ touch inside/f3
75 $ hg add inside/f3
75 $ hg add inside/f3
76 $ hg status
76 $ hg status
77 M inside/f1
77 M inside/f1
78 A inside/f3
78 A inside/f3
79 $ hg revert -qC .
79 $ hg revert -qC .
80 $ rm inside/f3
80 $ rm inside/f3
81
81
82 Can commit changes inside. Leaves outside unchanged.
82 Can commit changes inside. Leaves outside unchanged.
83
83
84 $ hg update -q 'desc("initial")'
84 $ hg update -q 'desc("initial")'
85 $ echo modified2 > inside/f1
85 $ echo modified2 > inside/f1
86 $ hg manifest --debug
86 $ hg manifest --debug
87 4d6a634d5ba06331a60c29ee0db8412490a54fcd 644 inside/f1
87 4d6a634d5ba06331a60c29ee0db8412490a54fcd 644 inside/f1
88 7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644 outside/f1 (flat !)
88 7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644 outside/f1 (flat !)
89 d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
89 d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
90 $ hg commit -m 'modify inside/f1'
90 $ hg commit -m 'modify inside/f1'
91 created new head
91 created new head
92 $ hg files -r .
92 $ hg files -r .
93 inside/f1
93 inside/f1
94 $ hg manifest --debug
94 $ hg manifest --debug
95 3f4197b4a11b9016e77ebc47fe566944885fd11b 644 inside/f1
95 3f4197b4a11b9016e77ebc47fe566944885fd11b 644 inside/f1
96 7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644 outside/f1 (flat !)
96 7fb3bb6356d28d4dc352c5ba52d7350a81b6bd46 644 outside/f1 (flat !)
97 d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
97 d0f2f706468ab0e8bec7af87446835fb1b13511b 755 d outside/ (tree !)
98 Some filesystems (notably FAT/exFAT only store timestamps with 2
98 Some filesystems (notably FAT/exFAT only store timestamps with 2
99 seconds of precision, so by sleeping for 3 seconds, we can ensure that
99 seconds of precision, so by sleeping for 3 seconds, we can ensure that
100 the timestamps of files stored by dirstate will appear older than the
100 the timestamps of files stored by dirstate will appear older than the
101 dirstate file, and therefore we'll be able to get stable output from
101 dirstate file, and therefore we'll be able to get stable output from
102 debugdirstate. If we don't do this, the test can be slightly flaky.
102 debugdirstate. If we don't do this, the test can be slightly flaky.
103 $ sleep 3
103 $ sleep 3
104 $ hg status
104 $ hg status
105 $ hg debugdirstate --no-dates
105 $ hg debugdirstate --no-dates
106 n 644 10 set inside/f1
106 n 644 10 set inside/f1
107
108 Can't commit empty files
109
110 $ touch inside/c; hg add inside/c; hg commit -qm _; hg verify -q
111 warning: revlog 'data/inside/c.i' not in fncache!
112 4: empty or missing inside/c
113 inside/c@4: manifest refers to unknown revision 000000000000
114 1 warnings encountered!
115 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
116 2 integrity errors encountered!
117 (first damaged changeset appears to be 4)
118 [1]
General Comments 0
You need to be logged in to leave comments. Login now