Show More
@@ -1,198 +1,262 b'' | |||||
1 | #require rust |
|
1 | #require rust | |
2 |
|
2 | |||
3 | Define an rhg function that will only run if rhg exists |
|
3 | Define an rhg function that will only run if rhg exists | |
4 | $ rhg() { |
|
4 | $ rhg() { | |
5 | > if [ -f "$RUNTESTDIR/../rust/target/release/rhg" ]; then |
|
5 | > if [ -f "$RUNTESTDIR/../rust/target/release/rhg" ]; then | |
6 | > "$RUNTESTDIR/../rust/target/release/rhg" "$@" |
|
6 | > "$RUNTESTDIR/../rust/target/release/rhg" "$@" | |
7 | > else |
|
7 | > else | |
8 | > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." |
|
8 | > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg." | |
9 | > exit 80 |
|
9 | > exit 80 | |
10 | > fi |
|
10 | > fi | |
11 | > } |
|
11 | > } | |
12 |
|
12 | |||
13 | Unimplemented command |
|
13 | Unimplemented command | |
14 | $ rhg unimplemented-command |
|
14 | $ rhg unimplemented-command | |
15 | error: Found argument 'unimplemented-command' which wasn't expected, or isn't valid in this context |
|
15 | error: Found argument 'unimplemented-command' which wasn't expected, or isn't valid in this context | |
16 |
|
16 | |||
17 | USAGE: |
|
17 | USAGE: | |
18 | rhg <SUBCOMMAND> |
|
18 | rhg <SUBCOMMAND> | |
19 |
|
19 | |||
20 | For more information try --help |
|
20 | For more information try --help | |
21 | [252] |
|
21 | [252] | |
22 |
|
22 | |||
23 | Finding root |
|
23 | Finding root | |
24 | $ rhg root |
|
24 | $ rhg root | |
25 | abort: no repository found in '$TESTTMP' (.hg not found)! |
|
25 | abort: no repository found in '$TESTTMP' (.hg not found)! | |
26 | [255] |
|
26 | [255] | |
27 |
|
27 | |||
28 | $ hg init repository |
|
28 | $ hg init repository | |
29 | $ cd repository |
|
29 | $ cd repository | |
30 | $ rhg root |
|
30 | $ rhg root | |
31 | $TESTTMP/repository |
|
31 | $TESTTMP/repository | |
32 |
|
32 | |||
33 | Unwritable file descriptor |
|
33 | Unwritable file descriptor | |
34 | $ rhg root > /dev/full |
|
34 | $ rhg root > /dev/full | |
35 | abort: No space left on device (os error 28) |
|
35 | abort: No space left on device (os error 28) | |
36 | [255] |
|
36 | [255] | |
37 |
|
37 | |||
38 | Deleted repository |
|
38 | Deleted repository | |
39 | $ rm -rf `pwd` |
|
39 | $ rm -rf `pwd` | |
40 | $ rhg root |
|
40 | $ rhg root | |
41 | abort: $ENOENT$: current directory |
|
41 | abort: $ENOENT$: current directory | |
42 | [255] |
|
42 | [255] | |
43 |
|
43 | |||
44 | Listing tracked files |
|
44 | Listing tracked files | |
45 | $ cd $TESTTMP |
|
45 | $ cd $TESTTMP | |
46 | $ hg init repository |
|
46 | $ hg init repository | |
47 | $ cd repository |
|
47 | $ cd repository | |
48 | $ for i in 1 2 3; do |
|
48 | $ for i in 1 2 3; do | |
49 | > echo $i >> file$i |
|
49 | > echo $i >> file$i | |
50 | > hg add file$i |
|
50 | > hg add file$i | |
51 | > done |
|
51 | > done | |
52 | > hg commit -m "commit $i" -q |
|
52 | > hg commit -m "commit $i" -q | |
53 |
|
53 | |||
54 | Listing tracked files from root |
|
54 | Listing tracked files from root | |
55 | $ rhg files |
|
55 | $ rhg files | |
56 | file1 |
|
56 | file1 | |
57 | file2 |
|
57 | file2 | |
58 | file3 |
|
58 | file3 | |
59 |
|
59 | |||
60 | Listing tracked files from subdirectory |
|
60 | Listing tracked files from subdirectory | |
61 | $ mkdir -p path/to/directory |
|
61 | $ mkdir -p path/to/directory | |
62 | $ cd path/to/directory |
|
62 | $ cd path/to/directory | |
63 | $ rhg files |
|
63 | $ rhg files | |
64 | ../../../file1 |
|
64 | ../../../file1 | |
65 | ../../../file2 |
|
65 | ../../../file2 | |
66 | ../../../file3 |
|
66 | ../../../file3 | |
67 |
|
67 | |||
68 | Listing tracked files through broken pipe |
|
68 | Listing tracked files through broken pipe | |
69 | $ rhg files | head -n 1 |
|
69 | $ rhg files | head -n 1 | |
70 | ../../../file1 |
|
70 | ../../../file1 | |
71 |
|
71 | |||
72 | Debuging data in inline index |
|
72 | Debuging data in inline index | |
73 | $ cd $TESTTMP |
|
73 | $ cd $TESTTMP | |
74 | $ rm -rf repository |
|
74 | $ rm -rf repository | |
75 | $ hg init repository |
|
75 | $ hg init repository | |
76 | $ cd repository |
|
76 | $ cd repository | |
77 | $ for i in 1 2 3 4 5 6; do |
|
77 | $ for i in 1 2 3 4 5 6; do | |
78 | > echo $i >> file-$i |
|
78 | > echo $i >> file-$i | |
79 | > hg add file-$i |
|
79 | > hg add file-$i | |
80 | > hg commit -m "Commit $i" -q |
|
80 | > hg commit -m "Commit $i" -q | |
81 | > done |
|
81 | > done | |
82 | $ rhg debugdata -c 2 |
|
82 | $ rhg debugdata -c 2 | |
83 | 8d0267cb034247ebfa5ee58ce59e22e57a492297 |
|
83 | 8d0267cb034247ebfa5ee58ce59e22e57a492297 | |
84 | test |
|
84 | test | |
85 | 0 0 |
|
85 | 0 0 | |
86 | file-3 |
|
86 | file-3 | |
87 |
|
87 | |||
88 | Commit 3 (no-eol) |
|
88 | Commit 3 (no-eol) | |
89 | $ rhg debugdata -m 2 |
|
89 | $ rhg debugdata -m 2 | |
90 | file-1\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
90 | file-1\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) | |
91 | file-2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc) |
|
91 | file-2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc) | |
92 | file-3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc) |
|
92 | file-3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc) | |
93 |
|
93 | |||
94 | Debuging with full node id |
|
94 | Debuging with full node id | |
95 | $ rhg debugdata -c `hg log -r 0 -T '{node}'` |
|
95 | $ rhg debugdata -c `hg log -r 0 -T '{node}'` | |
96 | d1d1c679d3053e8926061b6f45ca52009f011e3f |
|
96 | d1d1c679d3053e8926061b6f45ca52009f011e3f | |
97 | test |
|
97 | test | |
98 | 0 0 |
|
98 | 0 0 | |
99 | file-1 |
|
99 | file-1 | |
100 |
|
100 | |||
101 | Commit 1 (no-eol) |
|
101 | Commit 1 (no-eol) | |
102 |
|
102 | |||
103 | Specifying revisions by changeset ID |
|
103 | Specifying revisions by changeset ID | |
104 | $ hg log -T '{node}\n' |
|
104 | $ hg log -T '{node}\n' | |
105 | c6ad58c44207b6ff8a4fbbca7045a5edaa7e908b |
|
105 | c6ad58c44207b6ff8a4fbbca7045a5edaa7e908b | |
106 | d654274993d0149eecc3cc03214f598320211900 |
|
106 | d654274993d0149eecc3cc03214f598320211900 | |
107 | f646af7e96481d3a5470b695cf30ad8e3ab6c575 |
|
107 | f646af7e96481d3a5470b695cf30ad8e3ab6c575 | |
108 | cf8b83f14ead62b374b6e91a0e9303b85dfd9ed7 |
|
108 | cf8b83f14ead62b374b6e91a0e9303b85dfd9ed7 | |
109 | 91c6f6e73e39318534dc415ea4e8a09c99cd74d6 |
|
109 | 91c6f6e73e39318534dc415ea4e8a09c99cd74d6 | |
110 | 6ae9681c6d30389694d8701faf24b583cf3ccafe |
|
110 | 6ae9681c6d30389694d8701faf24b583cf3ccafe | |
111 | $ rhg files -r cf8b83 |
|
111 | $ rhg files -r cf8b83 | |
112 | file-1 |
|
112 | file-1 | |
113 | file-2 |
|
113 | file-2 | |
114 | file-3 |
|
114 | file-3 | |
115 | $ rhg cat -r cf8b83 file-2 |
|
115 | $ rhg cat -r cf8b83 file-2 | |
116 | 2 |
|
116 | 2 | |
117 | $ rhg cat -r c file-2 |
|
117 | $ rhg cat -r c file-2 | |
118 | abort: ambiguous revision identifier c |
|
118 | abort: ambiguous revision identifier c | |
119 | [255] |
|
119 | [255] | |
120 | $ rhg cat -r d file-2 |
|
120 | $ rhg cat -r d file-2 | |
121 | 2 |
|
121 | 2 | |
122 |
|
122 | |||
123 | Cat files |
|
123 | Cat files | |
124 | $ cd $TESTTMP |
|
124 | $ cd $TESTTMP | |
125 | $ rm -rf repository |
|
125 | $ rm -rf repository | |
126 | $ hg init repository |
|
126 | $ hg init repository | |
127 | $ cd repository |
|
127 | $ cd repository | |
128 | $ echo "original content" > original |
|
128 | $ echo "original content" > original | |
129 | $ hg add original |
|
129 | $ hg add original | |
130 | $ hg commit -m "add original" original |
|
130 | $ hg commit -m "add original" original | |
131 | $ rhg cat -r 0 original |
|
131 | $ rhg cat -r 0 original | |
132 | original content |
|
132 | original content | |
133 | Cat copied file should not display copy metadata |
|
133 | Cat copied file should not display copy metadata | |
134 | $ hg copy original copy_of_original |
|
134 | $ hg copy original copy_of_original | |
135 | $ hg commit -m "add copy of original" |
|
135 | $ hg commit -m "add copy of original" | |
136 | $ rhg cat -r 1 copy_of_original |
|
136 | $ rhg cat -r 1 copy_of_original | |
137 | original content |
|
137 | original content | |
138 |
|
138 | |||
139 | Requirements |
|
139 | Requirements | |
140 | $ rhg debugrequirements |
|
140 | $ rhg debugrequirements | |
141 | dotencode |
|
141 | dotencode | |
142 | fncache |
|
142 | fncache | |
143 | generaldelta |
|
143 | generaldelta | |
144 | revlogv1 |
|
144 | revlogv1 | |
145 | sparserevlog |
|
145 | sparserevlog | |
146 | store |
|
146 | store | |
147 |
|
147 | |||
148 | $ echo indoor-pool >> .hg/requires |
|
148 | $ echo indoor-pool >> .hg/requires | |
149 | $ rhg files |
|
149 | $ rhg files | |
150 | [252] |
|
150 | [252] | |
151 |
|
151 | |||
152 | $ rhg cat -r 1 copy_of_original |
|
152 | $ rhg cat -r 1 copy_of_original | |
153 | [252] |
|
153 | [252] | |
154 |
|
154 | |||
155 | $ rhg debugrequirements |
|
155 | $ rhg debugrequirements | |
156 | [252] |
|
156 | [252] | |
157 |
|
157 | |||
158 | $ echo -e '\xFF' >> .hg/requires |
|
158 | $ echo -e '\xFF' >> .hg/requires | |
159 | $ rhg debugrequirements |
|
159 | $ rhg debugrequirements | |
160 | abort: corrupted repository: parse error in 'requires' file |
|
160 | abort: corrupted repository: parse error in 'requires' file | |
161 | [255] |
|
161 | [255] | |
162 |
|
162 | |||
163 | Persistent nodemap |
|
163 | Persistent nodemap | |
164 | $ cd $TESTTMP |
|
164 | $ cd $TESTTMP | |
165 | $ rm -rf repository |
|
165 | $ rm -rf repository | |
166 | $ hg init repository |
|
166 | $ hg init repository | |
167 | $ cd repository |
|
167 | $ cd repository | |
168 | $ rhg debugrequirements | grep nodemap |
|
168 | $ rhg debugrequirements | grep nodemap | |
169 | [1] |
|
169 | [1] | |
170 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" |
|
170 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" | |
171 | $ hg id -r tip |
|
171 | $ hg id -r tip | |
172 | c3ae8dec9fad tip |
|
172 | c3ae8dec9fad tip | |
173 | $ ls .hg/store/00changelog* |
|
173 | $ ls .hg/store/00changelog* | |
174 | .hg/store/00changelog.d |
|
174 | .hg/store/00changelog.d | |
175 | .hg/store/00changelog.i |
|
175 | .hg/store/00changelog.i | |
176 | $ rhg files -r c3ae8dec9fad |
|
176 | $ rhg files -r c3ae8dec9fad | |
177 | of |
|
177 | of | |
178 |
|
178 | |||
179 | $ cd $TESTTMP |
|
179 | $ cd $TESTTMP | |
180 | $ rm -rf repository |
|
180 | $ rm -rf repository | |
181 | $ hg --config format.use-persistent-nodemap=True init repository |
|
181 | $ hg --config format.use-persistent-nodemap=True init repository | |
182 | $ cd repository |
|
182 | $ cd repository | |
183 | $ rhg debugrequirements | grep nodemap |
|
183 | $ rhg debugrequirements | grep nodemap | |
184 | persistent-nodemap |
|
184 | persistent-nodemap | |
185 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" |
|
185 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" | |
186 | $ hg id -r tip |
|
186 | $ hg id -r tip | |
187 | c3ae8dec9fad tip |
|
187 | c3ae8dec9fad tip | |
188 | $ ls .hg/store/00changelog* |
|
188 | $ ls .hg/store/00changelog* | |
189 | .hg/store/00changelog-*.nd (glob) |
|
189 | .hg/store/00changelog-*.nd (glob) | |
190 | .hg/store/00changelog.d |
|
190 | .hg/store/00changelog.d | |
191 | .hg/store/00changelog.i |
|
191 | .hg/store/00changelog.i | |
192 | .hg/store/00changelog.n |
|
192 | .hg/store/00changelog.n | |
193 |
|
193 | |||
194 | Specifying revisions by changeset ID |
|
194 | Specifying revisions by changeset ID | |
195 | $ rhg files -r c3ae8dec9fad |
|
195 | $ rhg files -r c3ae8dec9fad | |
196 | of |
|
196 | of | |
197 | $ rhg cat -r c3ae8dec9fad of |
|
197 | $ rhg cat -r c3ae8dec9fad of | |
198 | r5000 |
|
198 | r5000 | |
|
199 | ||||
|
200 | Crate a shared repository | |||
|
201 | ||||
|
202 | $ echo "[extensions]" >> $HGRCPATH | |||
|
203 | $ echo "share = " >> $HGRCPATH | |||
|
204 | ||||
|
205 | $ cd $TESTTMP | |||
|
206 | $ hg init repo1 | |||
|
207 | $ cd repo1 | |||
|
208 | $ echo a > a | |||
|
209 | $ hg commit -A -m'init' | |||
|
210 | adding a | |||
|
211 | ||||
|
212 | $ cd .. | |||
|
213 | $ hg share repo1 repo2 | |||
|
214 | updating working directory | |||
|
215 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
216 | ||||
|
217 | And check that basic rhg commands work with sharing | |||
|
218 | ||||
|
219 | $ cd repo2 | |||
|
220 | $ rhg files | |||
|
221 | [252] | |||
|
222 | $ rhg cat -r 0 a | |||
|
223 | [252] | |||
|
224 | ||||
|
225 | Same with relative sharing | |||
|
226 | ||||
|
227 | $ cd .. | |||
|
228 | $ hg share repo2 repo3 --relative | |||
|
229 | updating working directory | |||
|
230 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
231 | ||||
|
232 | $ cd repo3 | |||
|
233 | $ rhg files | |||
|
234 | [252] | |||
|
235 | $ rhg cat -r 0 a | |||
|
236 | [252] | |||
|
237 | ||||
|
238 | Same with share-safe | |||
|
239 | ||||
|
240 | $ echo "[format]" >> $HGRCPATH | |||
|
241 | $ echo "use-share-safe = True" >> $HGRCPATH | |||
|
242 | ||||
|
243 | $ cd $TESTTMP | |||
|
244 | $ hg init repo4 | |||
|
245 | $ cd repo4 | |||
|
246 | $ echo a > a | |||
|
247 | $ hg commit -A -m'init' | |||
|
248 | adding a | |||
|
249 | ||||
|
250 | $ cd .. | |||
|
251 | $ hg share repo4 repo5 | |||
|
252 | updating working directory | |||
|
253 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
254 | ||||
|
255 | And check that basic rhg commands work with sharing | |||
|
256 | ||||
|
257 | $ cd repo5 | |||
|
258 | $ rhg files | |||
|
259 | [252] | |||
|
260 | $ rhg cat -r 0 a | |||
|
261 | [252] | |||
|
262 |
General Comments 0
You need to be logged in to leave comments.
Login now