Show More
@@ -967,7 +967,6 b' class Test(unittest.TestCase):' | |||
|
967 | 967 | slowtimeout=None, |
|
968 | 968 | usechg=False, |
|
969 | 969 | chgdebug=False, |
|
970 | rhg_fallback_exe=None, | |
|
971 | 970 | useipv6=False, |
|
972 | 971 | ): |
|
973 | 972 | """Create a test from parameters. |
@@ -1025,7 +1024,6 b' class Test(unittest.TestCase):' | |||
|
1025 | 1024 | self._hgcommand = hgcommand or b'hg' |
|
1026 | 1025 | self._usechg = usechg |
|
1027 | 1026 | self._chgdebug = chgdebug |
|
1028 | self._rhg_fallback_exe = rhg_fallback_exe | |
|
1029 | 1027 | self._useipv6 = useipv6 |
|
1030 | 1028 | |
|
1031 | 1029 | self._aborted = False |
@@ -1508,12 +1506,6 b' class Test(unittest.TestCase):' | |||
|
1508 | 1506 | hgrc.write(b'ipv6 = %r\n' % self._useipv6) |
|
1509 | 1507 | hgrc.write(b'server-header = testing stub value\n') |
|
1510 | 1508 | |
|
1511 | if self._rhg_fallback_exe: | |
|
1512 | hgrc.write(b'[rhg]\n') | |
|
1513 | hgrc.write( | |
|
1514 | b'fallback-executable = %s\n' % self._rhg_fallback_exe | |
|
1515 | ) | |
|
1516 | ||
|
1517 | 1509 | for opt in self._extraconfigopts: |
|
1518 | 1510 | section, key = _sys2bytes(opt).split(b'.', 1) |
|
1519 | 1511 | assert b'=' in key, ( |
@@ -2999,7 +2991,6 b' class TestRunner(object):' | |||
|
2999 | 2991 | self._coveragefile = None |
|
3000 | 2992 | self._createdfiles = [] |
|
3001 | 2993 | self._hgcommand = None |
|
3002 | self._rhg_fallback_exe = None | |
|
3003 | 2994 | self._hgpath = None |
|
3004 | 2995 | self._portoffset = 0 |
|
3005 | 2996 | self._ports = {} |
@@ -3140,10 +3131,17 b' class TestRunner(object):' | |||
|
3140 | 3131 | chgbindir = os.path.dirname(os.path.realpath(self.options.with_chg)) |
|
3141 | 3132 | self._hgcommand = os.path.basename(self.options.with_chg) |
|
3142 | 3133 | |
|
3143 |
# |
|
|
3134 | # configure fallback and replace "hg" command by "rhg" | |
|
3144 | 3135 | rhgbindir = self._bindir |
|
3145 | 3136 | if self.options.rhg or self.options.with_rhg: |
|
3146 | self._rhg_fallback_exe = os.path.join(self._bindir, self._hgcommand) | |
|
3137 | # Affects configuration. Alternatives would be setting configuration through | |
|
3138 | # `$HGRCPATH` but some tests override that, or changing `_hgcommand` to include | |
|
3139 | # `--config` but that disrupts tests that print command lines and check expected | |
|
3140 | # output. | |
|
3141 | osenvironb[b'RHG_ON_UNSUPPORTED'] = b'fallback' | |
|
3142 | osenvironb[b'RHG_FALLBACK_EXECUTABLE'] = os.path.join( | |
|
3143 | self._bindir, self._hgcommand | |
|
3144 | ) | |
|
3147 | 3145 | if self.options.rhg: |
|
3148 | 3146 | self._hgcommand = b'rhg' |
|
3149 | 3147 | elif self.options.with_rhg: |
@@ -3477,7 +3475,6 b' class TestRunner(object):' | |||
|
3477 | 3475 | hgcommand=self._hgcommand, |
|
3478 | 3476 | usechg=bool(self.options.with_chg or self.options.chg), |
|
3479 | 3477 | chgdebug=self.options.chg_debug, |
|
3480 | rhg_fallback_exe=self._rhg_fallback_exe, | |
|
3481 | 3478 | useipv6=useipv6, |
|
3482 | 3479 | **kwds |
|
3483 | 3480 | ) |
@@ -11,8 +11,10 b' Define an rhg function that will only ru' | |||
|
11 | 11 | > fi |
|
12 | 12 | > } |
|
13 | 13 | |
|
14 | $ NO_FALLBACK="env RHG_ON_UNSUPPORTED=abort" | |
|
15 | ||
|
14 | 16 | Unimplemented command |
|
15 | $ rhg unimplemented-command | |
|
17 | $ $NO_FALLBACK rhg unimplemented-command | |
|
16 | 18 | unsupported feature: error: Found argument 'unimplemented-command' which wasn't expected, or isn't valid in this context |
|
17 | 19 | |
|
18 | 20 | USAGE: |
@@ -25,35 +27,35 b' Unimplemented command' | |||
|
25 | 27 | [252] |
|
26 | 28 | |
|
27 | 29 | Finding root |
|
28 | $ rhg root | |
|
30 | $ $NO_FALLBACK rhg root | |
|
29 | 31 | abort: no repository found in '$TESTTMP' (.hg not found)! |
|
30 | 32 | [255] |
|
31 | 33 | |
|
32 | 34 | $ hg init repository |
|
33 | 35 | $ cd repository |
|
34 | $ rhg root | |
|
36 | $ $NO_FALLBACK rhg root | |
|
35 | 37 | $TESTTMP/repository |
|
36 | 38 | |
|
37 | 39 | Reading and setting configuration |
|
38 | 40 | $ echo "[ui]" >> $HGRCPATH |
|
39 | 41 | $ echo "username = user1" >> $HGRCPATH |
|
40 | $ rhg config ui.username | |
|
42 | $ $NO_FALLBACK rhg config ui.username | |
|
41 | 43 | user1 |
|
42 | 44 | $ echo "[ui]" >> .hg/hgrc |
|
43 | 45 | $ echo "username = user2" >> .hg/hgrc |
|
44 | $ rhg config ui.username | |
|
46 | $ $NO_FALLBACK rhg config ui.username | |
|
45 | 47 | user2 |
|
46 | $ rhg --config ui.username=user3 config ui.username | |
|
48 | $ $NO_FALLBACK rhg --config ui.username=user3 config ui.username | |
|
47 | 49 | user3 |
|
48 | 50 | |
|
49 | 51 | Unwritable file descriptor |
|
50 | $ rhg root > /dev/full | |
|
52 | $ $NO_FALLBACK rhg root > /dev/full | |
|
51 | 53 | abort: No space left on device (os error 28) |
|
52 | 54 | [255] |
|
53 | 55 | |
|
54 | 56 | Deleted repository |
|
55 | 57 | $ rm -rf `pwd` |
|
56 | $ rhg root | |
|
58 | $ $NO_FALLBACK rhg root | |
|
57 | 59 | abort: $ENOENT$: current directory |
|
58 | 60 | [255] |
|
59 | 61 | |
@@ -68,7 +70,7 b' Listing tracked files' | |||
|
68 | 70 | > hg commit -m "commit $i" -q |
|
69 | 71 | |
|
70 | 72 | Listing tracked files from root |
|
71 | $ rhg files | |
|
73 | $ $NO_FALLBACK rhg files | |
|
72 | 74 | file1 |
|
73 | 75 | file2 |
|
74 | 76 | file3 |
@@ -76,13 +78,13 b' Listing tracked files from root' | |||
|
76 | 78 | Listing tracked files from subdirectory |
|
77 | 79 | $ mkdir -p path/to/directory |
|
78 | 80 | $ cd path/to/directory |
|
79 | $ rhg files | |
|
81 | $ $NO_FALLBACK rhg files | |
|
80 | 82 | ../../../file1 |
|
81 | 83 | ../../../file2 |
|
82 | 84 | ../../../file3 |
|
83 | 85 | |
|
84 | 86 | Listing tracked files through broken pipe |
|
85 | $ rhg files | head -n 1 | |
|
87 | $ $NO_FALLBACK rhg files | head -n 1 | |
|
86 | 88 | ../../../file1 |
|
87 | 89 | |
|
88 | 90 | Debuging data in inline index |
@@ -95,20 +97,20 b' Debuging data in inline index' | |||
|
95 | 97 | > hg add file-$i |
|
96 | 98 | > hg commit -m "Commit $i" -q |
|
97 | 99 | > done |
|
98 | $ rhg debugdata -c 2 | |
|
100 | $ $NO_FALLBACK rhg debugdata -c 2 | |
|
99 | 101 | 8d0267cb034247ebfa5ee58ce59e22e57a492297 |
|
100 | 102 | test |
|
101 | 103 | 0 0 |
|
102 | 104 | file-3 |
|
103 | 105 | |
|
104 | 106 | Commit 3 (no-eol) |
|
105 | $ rhg debugdata -m 2 | |
|
107 | $ $NO_FALLBACK rhg debugdata -m 2 | |
|
106 | 108 | file-1\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
107 | 109 | file-2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc) |
|
108 | 110 | file-3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc) |
|
109 | 111 | |
|
110 | 112 | Debuging with full node id |
|
111 | $ rhg debugdata -c `hg log -r 0 -T '{node}'` | |
|
113 | $ $NO_FALLBACK rhg debugdata -c `hg log -r 0 -T '{node}'` | |
|
112 | 114 | d1d1c679d3053e8926061b6f45ca52009f011e3f |
|
113 | 115 | test |
|
114 | 116 | 0 0 |
@@ -124,16 +126,16 b' Specifying revisions by changeset ID' | |||
|
124 | 126 | cf8b83f14ead62b374b6e91a0e9303b85dfd9ed7 |
|
125 | 127 | 91c6f6e73e39318534dc415ea4e8a09c99cd74d6 |
|
126 | 128 | 6ae9681c6d30389694d8701faf24b583cf3ccafe |
|
127 | $ rhg files -r cf8b83 | |
|
129 | $ $NO_FALLBACK rhg files -r cf8b83 | |
|
128 | 130 | file-1 |
|
129 | 131 | file-2 |
|
130 | 132 | file-3 |
|
131 | $ rhg cat -r cf8b83 file-2 | |
|
133 | $ $NO_FALLBACK rhg cat -r cf8b83 file-2 | |
|
132 | 134 | 2 |
|
133 | $ rhg cat -r c file-2 | |
|
135 | $ $NO_FALLBACK rhg cat -r c file-2 | |
|
134 | 136 | abort: ambiguous revision identifier c |
|
135 | 137 | [255] |
|
136 | $ rhg cat -r d file-2 | |
|
138 | $ $NO_FALLBACK rhg cat -r d file-2 | |
|
137 | 139 | 2 |
|
138 | 140 | |
|
139 | 141 | Cat files |
@@ -144,37 +146,36 b' Cat files' | |||
|
144 | 146 | $ echo "original content" > original |
|
145 | 147 | $ hg add original |
|
146 | 148 | $ hg commit -m "add original" original |
|
147 | $ rhg cat -r 0 original | |
|
149 | $ $NO_FALLBACK rhg cat -r 0 original | |
|
148 | 150 | original content |
|
149 | 151 | Cat copied file should not display copy metadata |
|
150 | 152 | $ hg copy original copy_of_original |
|
151 | 153 | $ hg commit -m "add copy of original" |
|
152 | $ rhg cat -r 1 copy_of_original | |
|
154 | $ $NO_FALLBACK rhg cat -r 1 copy_of_original | |
|
153 | 155 | original content |
|
154 | 156 | |
|
155 | 157 | Fallback to Python |
|
156 | $ rhg cat original | |
|
158 | $ $NO_FALLBACK rhg cat original | |
|
157 | 159 | unsupported feature: `rhg cat` without `--rev` / `-r` |
|
158 | 160 | [252] |
|
159 | $ FALLBACK="--config rhg.on-unsupported=fallback" | |
|
160 | $ rhg cat original $FALLBACK | |
|
161 | $ rhg cat original | |
|
161 | 162 | original content |
|
162 | 163 | |
|
163 |
$ rhg cat original |
|
|
164 | $ rhg cat original --config rhg.fallback-executable=false | |
|
164 | 165 | [1] |
|
165 | 166 | |
|
166 |
$ rhg cat original |
|
|
167 | $ rhg cat original --config rhg.fallback-executable=hg-non-existent | |
|
167 | 168 | tried to fall back to a 'hg-non-existent' sub-process but got error $ENOENT$ |
|
168 | 169 | unsupported feature: `rhg cat` without `--rev` / `-r` |
|
169 | 170 | [252] |
|
170 | 171 | |
|
171 |
$ rhg cat original |
|
|
172 | $ rhg cat original --config rhg.fallback-executable="$RHG" | |
|
172 | 173 | Blocking recursive fallback. The 'rhg.fallback-executable = */rust/target/release/rhg' config points to `rhg` itself. (glob) |
|
173 | 174 | unsupported feature: `rhg cat` without `--rev` / `-r` |
|
174 | 175 | [252] |
|
175 | 176 | |
|
176 | 177 | Requirements |
|
177 | $ rhg debugrequirements | |
|
178 | $ $NO_FALLBACK rhg debugrequirements | |
|
178 | 179 | dotencode |
|
179 | 180 | fncache |
|
180 | 181 | generaldelta |
@@ -183,20 +184,20 b' Requirements' | |||
|
183 | 184 | store |
|
184 | 185 | |
|
185 | 186 | $ echo indoor-pool >> .hg/requires |
|
186 | $ rhg files | |
|
187 | $ $NO_FALLBACK rhg files | |
|
187 | 188 | unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool |
|
188 | 189 | [252] |
|
189 | 190 | |
|
190 | $ rhg cat -r 1 copy_of_original | |
|
191 | $ $NO_FALLBACK rhg cat -r 1 copy_of_original | |
|
191 | 192 | unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool |
|
192 | 193 | [252] |
|
193 | 194 | |
|
194 | $ rhg debugrequirements | |
|
195 | $ $NO_FALLBACK rhg debugrequirements | |
|
195 | 196 | unsupported feature: repository requires feature unknown to this Mercurial: indoor-pool |
|
196 | 197 | [252] |
|
197 | 198 | |
|
198 | 199 | $ echo -e '\xFF' >> .hg/requires |
|
199 | $ rhg debugrequirements | |
|
200 | $ $NO_FALLBACK rhg debugrequirements | |
|
200 | 201 | abort: corrupted repository: parse error in 'requires' file |
|
201 | 202 | [255] |
|
202 | 203 | |
@@ -205,7 +206,7 b' Persistent nodemap' | |||
|
205 | 206 | $ rm -rf repository |
|
206 | 207 | $ hg init repository |
|
207 | 208 | $ cd repository |
|
208 | $ rhg debugrequirements | grep nodemap | |
|
209 | $ $NO_FALLBACK rhg debugrequirements | grep nodemap | |
|
209 | 210 | [1] |
|
210 | 211 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" |
|
211 | 212 | $ hg id -r tip |
@@ -213,14 +214,14 b' Persistent nodemap' | |||
|
213 | 214 | $ ls .hg/store/00changelog* |
|
214 | 215 | .hg/store/00changelog.d |
|
215 | 216 | .hg/store/00changelog.i |
|
216 | $ rhg files -r c3ae8dec9fad | |
|
217 | $ $NO_FALLBACK rhg files -r c3ae8dec9fad | |
|
217 | 218 | of |
|
218 | 219 | |
|
219 | 220 | $ cd $TESTTMP |
|
220 | 221 | $ rm -rf repository |
|
221 | 222 | $ hg --config format.use-persistent-nodemap=True init repository |
|
222 | 223 | $ cd repository |
|
223 | $ rhg debugrequirements | grep nodemap | |
|
224 | $ $NO_FALLBACK rhg debugrequirements | grep nodemap | |
|
224 | 225 | persistent-nodemap |
|
225 | 226 | $ hg debugbuilddag .+5000 --overwritten-file --config "storage.revlog.nodemap.mode=warn" |
|
226 | 227 | $ hg id -r tip |
@@ -232,9 +233,9 b' Persistent nodemap' | |||
|
232 | 233 | .hg/store/00changelog.n |
|
233 | 234 | |
|
234 | 235 | Specifying revisions by changeset ID |
|
235 | $ rhg files -r c3ae8dec9fad | |
|
236 | $ $NO_FALLBACK rhg files -r c3ae8dec9fad | |
|
236 | 237 | of |
|
237 | $ rhg cat -r c3ae8dec9fad of | |
|
238 | $ $NO_FALLBACK rhg cat -r c3ae8dec9fad of | |
|
238 | 239 | r5000 |
|
239 | 240 | |
|
240 | 241 | Crate a shared repository |
@@ -254,9 +255,9 b' Crate a shared repository' | |||
|
254 | 255 | |
|
255 | 256 | And check that basic rhg commands work with sharing |
|
256 | 257 | |
|
257 | $ rhg files -R repo2 | |
|
258 | $ $NO_FALLBACK rhg files -R repo2 | |
|
258 | 259 | repo2/a |
|
259 | $ rhg -R repo2 cat -r 0 repo2/a | |
|
260 | $ $NO_FALLBACK rhg -R repo2 cat -r 0 repo2/a | |
|
260 | 261 | a |
|
261 | 262 | |
|
262 | 263 | Same with relative sharing |
@@ -265,9 +266,9 b' Same with relative sharing' | |||
|
265 | 266 | updating working directory |
|
266 | 267 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 268 | |
|
268 | $ rhg files -R repo3 | |
|
269 | $ $NO_FALLBACK rhg files -R repo3 | |
|
269 | 270 | repo3/a |
|
270 | $ rhg -R repo3 cat -r 0 repo3/a | |
|
271 | $ $NO_FALLBACK rhg -R repo3 cat -r 0 repo3/a | |
|
271 | 272 | a |
|
272 | 273 | |
|
273 | 274 | Same with share-safe |
@@ -290,9 +291,9 b' Same with share-safe' | |||
|
290 | 291 | And check that basic rhg commands work with sharing |
|
291 | 292 | |
|
292 | 293 | $ cd repo5 |
|
293 | $ rhg files | |
|
294 | $ $NO_FALLBACK rhg files | |
|
294 | 295 | a |
|
295 | $ rhg cat -r 0 a | |
|
296 | $ $NO_FALLBACK rhg cat -r 0 a | |
|
296 | 297 | a |
|
297 | 298 | |
|
298 | 299 | The blackbox extension is supported |
@@ -301,7 +302,7 b' The blackbox extension is supported' | |||
|
301 | 302 | $ echo "blackbox =" >> $HGRCPATH |
|
302 | 303 | $ echo "[blackbox]" >> $HGRCPATH |
|
303 | 304 | $ echo "maxsize = 1" >> $HGRCPATH |
|
304 | $ rhg files > /dev/null | |
|
305 | $ $NO_FALLBACK rhg files > /dev/null | |
|
305 | 306 | $ cat .hg/blackbox.log |
|
306 | 307 | ????/??/?? ??:??:??.??? * @d3873e73d99ef67873dac33fbcc66268d5d2b6f4 (*)> (rust) files exited 0 after 0.??? seconds (glob) |
|
307 | 308 | $ cat .hg/blackbox.log.1 |
General Comments 0
You need to be logged in to leave comments.
Login now