Show More
@@ -1,141 +1,141 | |||
|
1 | 1 | $ hg init repo |
|
2 | 2 | $ cd repo |
|
3 | 3 | $ hg init subrepo |
|
4 | 4 | $ echo a > subrepo/a |
|
5 | 5 | $ hg -R subrepo ci -Am adda |
|
6 | 6 | adding a |
|
7 | 7 | $ echo 'subrepo = subrepo' > .hgsub |
|
8 | 8 | $ hg ci -Am addsubrepo |
|
9 | 9 | adding .hgsub |
|
10 | 10 | $ echo b > subrepo/b |
|
11 | 11 | $ hg -R subrepo ci -Am addb |
|
12 | 12 | adding b |
|
13 | 13 | $ hg ci -m updatedsub |
|
14 | 14 | |
|
15 | 15 | ignore blanklines in .hgsubstate |
|
16 | 16 | |
|
17 | >>> open('.hgsubstate', 'wb').write(b'\n\n \t \n \n') | |
|
17 | >>> open('.hgsubstate', 'wb').write(b'\n\n \t \n \n') and None | |
|
18 | 18 |
$ |
|
19 | 19 | M .hgsubstate |
|
20 | 20 | $ hg revert -qC .hgsubstate |
|
21 | 21 | |
|
22 | 22 | abort more gracefully on .hgsubstate parsing error |
|
23 | 23 | |
|
24 | 24 | $ cp .hgsubstate .hgsubstate.old |
|
25 | >>> open('.hgsubstate', 'wb').write(b'\ninvalid') | |
|
25 | >>> open('.hgsubstate', 'wb').write(b'\ninvalid') and None | |
|
26 | 26 |
$ |
|
27 | 27 | abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2 |
|
28 | 28 | [255] |
|
29 | 29 | $ mv .hgsubstate.old .hgsubstate |
|
30 | 30 | |
|
31 | 31 | delete .hgsub and revert it |
|
32 | 32 | |
|
33 | 33 | $ rm .hgsub |
|
34 | 34 | $ hg revert .hgsub |
|
35 | 35 | warning: subrepo spec file '.hgsub' not found |
|
36 | 36 | warning: subrepo spec file '.hgsub' not found |
|
37 | 37 | |
|
38 | 38 | delete .hgsubstate and revert it |
|
39 | 39 | |
|
40 | 40 | $ rm .hgsubstate |
|
41 | 41 | $ hg revert .hgsubstate |
|
42 | 42 | |
|
43 | 43 | delete .hgsub and update |
|
44 | 44 | |
|
45 | 45 | $ rm .hgsub |
|
46 | 46 | $ hg up 0 --cwd $TESTTMP -R $TESTTMP/repo |
|
47 | 47 | warning: subrepo spec file 'repo/.hgsub' not found |
|
48 | 48 | warning: subrepo spec file 'repo/.hgsub' not found |
|
49 | 49 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
50 | 50 | $ hg st |
|
51 | 51 | warning: subrepo spec file '.hgsub' not found |
|
52 | 52 | ! .hgsub |
|
53 | 53 | $ ls subrepo |
|
54 | 54 | a |
|
55 | 55 | |
|
56 | 56 | delete .hgsubstate and update |
|
57 | 57 | |
|
58 | 58 | $ hg up -C |
|
59 | 59 | warning: subrepo spec file '.hgsub' not found |
|
60 | 60 | warning: subrepo spec file '.hgsub' not found |
|
61 | 61 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
62 | 62 | $ rm .hgsubstate |
|
63 | 63 | $ hg up 0 |
|
64 | 64 | other [destination] changed .hgsubstate which local [working copy] deleted |
|
65 | 65 | use (c)hanged version or leave (d)eleted? c |
|
66 | 66 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 67 | $ hg st |
|
68 | 68 | $ ls subrepo |
|
69 | 69 | a |
|
70 | 70 | |
|
71 | 71 | Enable obsolete |
|
72 | 72 | |
|
73 | 73 | $ cat >> $HGRCPATH << EOF |
|
74 | 74 | > [ui] |
|
75 | 75 | > logtemplate= {rev}:{node|short} {desc|firstline} |
|
76 | 76 | > [phases] |
|
77 | 77 | > publish=False |
|
78 | 78 | > [experimental] |
|
79 | 79 | > evolution.createmarkers=True |
|
80 | 80 | > EOF |
|
81 | 81 | |
|
82 | 82 | check that we can update parent repo with missing (amended) subrepo revision |
|
83 | 83 | |
|
84 | 84 | $ hg up --repository subrepo -r tip |
|
85 | 85 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
86 | 86 | $ hg ci -m "updated subrepo to tip" |
|
87 | 87 | created new head |
|
88 | 88 | $ cd subrepo |
|
89 | 89 | $ hg update -r tip |
|
90 | 90 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 91 | $ echo foo > a |
|
92 | 92 | $ hg commit --amend -m "addb (amended)" |
|
93 | 93 | $ cd .. |
|
94 | 94 | $ hg update --clean . |
|
95 | 95 | revision 102a90ea7b4a in subrepository "subrepo" is hidden |
|
96 | 96 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 97 | |
|
98 | 98 | check that --hidden is propagated to the subrepo |
|
99 | 99 | |
|
100 | 100 | $ hg -R subrepo up tip |
|
101 | 101 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | 102 | $ hg ci -m 'commit with amended subrepo' |
|
103 | 103 | $ echo bar > subrepo/a |
|
104 | 104 | $ hg -R subrepo ci --amend -m "amend a (again)" |
|
105 | 105 | $ hg --hidden cat subrepo/a |
|
106 | 106 | foo |
|
107 | 107 | |
|
108 | 108 | verify will warn if locked-in subrepo revisions are hidden or missing |
|
109 | 109 | |
|
110 | 110 | $ hg ci -m "amended subrepo (again)" |
|
111 | 111 | $ hg --config extensions.strip= --hidden strip -R subrepo -qr 'tip' --config devel.strip-obsmarkers=no |
|
112 | 112 | $ hg verify |
|
113 | 113 | checking changesets |
|
114 | 114 | checking manifests |
|
115 | 115 | crosschecking files in changesets and manifests |
|
116 | 116 | checking files |
|
117 | 117 | 2 files, 5 changesets, 5 total revisions |
|
118 | 118 | checking subrepo links |
|
119 | 119 | subrepo 'subrepo' is hidden in revision a66de08943b6 |
|
120 | 120 | subrepo 'subrepo' is hidden in revision 674d05939c1e |
|
121 | 121 | subrepo 'subrepo' not found in revision a7d05d9055a4 |
|
122 | 122 | |
|
123 | 123 | verifying shouldn't init a new subrepo if the reference doesn't exist |
|
124 | 124 | |
|
125 | 125 | $ mv subrepo b |
|
126 | 126 | $ hg verify |
|
127 | 127 | checking changesets |
|
128 | 128 | checking manifests |
|
129 | 129 | crosschecking files in changesets and manifests |
|
130 | 130 | checking files |
|
131 | 131 | 2 files, 5 changesets, 5 total revisions |
|
132 | 132 | checking subrepo links |
|
133 | 133 | 0: repository $TESTTMP/repo/subrepo not found |
|
134 | 134 | 1: repository $TESTTMP/repo/subrepo not found |
|
135 | 135 | 3: repository $TESTTMP/repo/subrepo not found |
|
136 | 136 | 4: repository $TESTTMP/repo/subrepo not found |
|
137 | 137 | $ ls |
|
138 | 138 | b |
|
139 | 139 | $ mv b subrepo |
|
140 | 140 | |
|
141 | 141 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now