Show More
@@ -125,3 +125,17 b' test-py3-chg:' | |||
|
125 | 125 | PYTHON: python3 |
|
126 | 126 | RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg" |
|
127 | 127 | TEST_HGMODULEPOLICY: "c" |
|
128 | ||
|
129 | check-pytype-py3: | |
|
130 | extends: .runtests_template | |
|
131 | when: manual | |
|
132 | before_script: | |
|
133 | - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no | |
|
134 | - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'` | |
|
135 | - cd /tmp/mercurial-ci/ | |
|
136 | - make local PYTHON=$PYTHON | |
|
137 | - $PYTHON -m pip install --user -U pytype==2021.04.15 | |
|
138 | variables: | |
|
139 | RUNTEST_ARGS: " --allow-slow-tests tests/test-check-pytype.t" | |
|
140 | PYTHON: python3 | |
|
141 | TEST_HGMODULEPOLICY: "c" |
@@ -151,12 +151,10 b' class p4_source(common.converter_source)' | |||
|
151 | 151 | views[sview] = cview |
|
152 | 152 | |
|
153 | 153 | # list of changes that affect our source files |
|
154 | p4changes = p4changes.keys() | |
|
155 | p4changes.sort(key=int) | |
|
154 | p4changes = sorted(p4changes.keys(), key=int) | |
|
156 | 155 | |
|
157 | 156 | # list with depot pathnames, longest first |
|
158 | vieworder = views.keys() | |
|
159 | vieworder.sort(key=len, reverse=True) | |
|
157 | vieworder = sorted(views.keys(), key=len, reverse=True) | |
|
160 | 158 | |
|
161 | 159 | # handle revision limiting |
|
162 | 160 | startrev = self.ui.config(b'convert', b'p4.startrev') |
@@ -188,7 +186,7 b' class p4_source(common.converter_source)' | |||
|
188 | 186 | else: |
|
189 | 187 | shortdesc = b'**empty changelist description**' |
|
190 | 188 | |
|
191 |
t = b'%s %s' % (c.rev, |
|
|
189 | t = b'%s %s' % (c.rev, shortdesc) | |
|
192 | 190 | ui.status(stringutil.ellipsis(t, 80) + b'\n') |
|
193 | 191 | |
|
194 | 192 | files = [] |
@@ -1054,7 +1054,7 b' def clone(' | |||
|
1054 | 1054 | # as the only "bad" outcome would be some slowness. That potential |
|
1055 | 1055 | # slowness already affect reader. |
|
1056 | 1056 | with destrepo.lock(): |
|
1057 |
destrepo.updatecaches(full= |
|
|
1057 | destrepo.updatecaches(full=b"post-clone") | |
|
1058 | 1058 | finally: |
|
1059 | 1059 | release(srclock, destlock) |
|
1060 | 1060 | if cleandir is not None: |
@@ -2727,6 +2727,11 b' class localrepository(object):' | |||
|
2727 | 2727 | |
|
2728 | 2728 | If 'full' is set, make sure all caches the function knows about have |
|
2729 | 2729 | up-to-date data. Even the ones usually loaded more lazily. |
|
2730 | ||
|
2731 | The `full` argument can take a special "post-clone" value. In this case | |
|
2732 | the cache warming is made after a clone and of the slower cache might | |
|
2733 | be skipped, namely the `.fnodetags` one. This argument is 5.8 specific | |
|
2734 | as we plan for a cleaner way to deal with this for 5.9. | |
|
2730 | 2735 | """ |
|
2731 | 2736 | if tr is not None and tr.hookargs.get(b'source') == b'strip': |
|
2732 | 2737 | # During strip, many caches are invalid but |
@@ -2754,8 +2759,9 b' class localrepository(object):' | |||
|
2754 | 2759 | for ctx in self[b'.'].parents(): |
|
2755 | 2760 | ctx.manifest() # accessing the manifest is enough |
|
2756 | 2761 | |
|
2757 | # accessing fnode cache warms the cache | |
|
2758 | tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs()) | |
|
2762 | if not full == b"post-clone": | |
|
2763 | # accessing fnode cache warms the cache | |
|
2764 | tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs()) | |
|
2759 | 2765 | # accessing tags warm the cache |
|
2760 | 2766 | self.tags() |
|
2761 | 2767 | self.filtered(b'served').tags() |
@@ -381,6 +381,10 b' def getfstype(dirpath):' | |||
|
381 | 381 | return getattr(osutil, 'getfstype', lambda x: None)(dirpath) |
|
382 | 382 | |
|
383 | 383 | |
|
384 | def get_password(): | |
|
385 | return encoding.strtolocal(getpass.getpass('')) | |
|
386 | ||
|
387 | ||
|
384 | 388 | def setbinary(fd): |
|
385 | 389 | pass |
|
386 | 390 |
@@ -11,7 +11,6 b' import collections' | |||
|
11 | 11 | import contextlib |
|
12 | 12 | import datetime |
|
13 | 13 | import errno |
|
14 | import getpass | |
|
15 | 14 | import inspect |
|
16 | 15 | import os |
|
17 | 16 | import re |
@@ -1781,7 +1780,7 b' class ui(object):' | |||
|
1781 | 1780 | raise EOFError |
|
1782 | 1781 | return l.rstrip(b'\n') |
|
1783 | 1782 | else: |
|
1784 |
return |
|
|
1783 | return util.get_password() | |
|
1785 | 1784 | except EOFError: |
|
1786 | 1785 | raise error.ResponseExpected() |
|
1787 | 1786 |
@@ -107,6 +107,7 b' copymode = platform.copymode' | |||
|
107 | 107 | expandglobs = platform.expandglobs |
|
108 | 108 | getfsmountpoint = platform.getfsmountpoint |
|
109 | 109 | getfstype = platform.getfstype |
|
110 | get_password = platform.get_password | |
|
110 | 111 | groupmembers = platform.groupmembers |
|
111 | 112 | groupname = platform.groupname |
|
112 | 113 | isexec = platform.isexec |
@@ -194,6 +194,28 b' def _isatty(fp):' | |||
|
194 | 194 | return False |
|
195 | 195 | |
|
196 | 196 | |
|
197 | def get_password(): | |
|
198 | """Prompt for password with echo off, using Windows getch(). | |
|
199 | ||
|
200 | This shouldn't be called directly- use ``ui.getpass()`` instead, which | |
|
201 | checks if the session is interactive first. | |
|
202 | """ | |
|
203 | pw = "" | |
|
204 | while True: | |
|
205 | c = msvcrt.getwch() | |
|
206 | if c == '\r' or c == '\n': | |
|
207 | break | |
|
208 | if c == '\003': | |
|
209 | raise KeyboardInterrupt | |
|
210 | if c == '\b': | |
|
211 | pw = pw[:-1] | |
|
212 | else: | |
|
213 | pw = pw + c | |
|
214 | msvcrt.putwch('\r') | |
|
215 | msvcrt.putwch('\n') | |
|
216 | return encoding.strtolocal(pw) | |
|
217 | ||
|
218 | ||
|
197 | 219 | class winstdout(object): |
|
198 | 220 | """Some files on Windows misbehave. |
|
199 | 221 |
@@ -863,7 +863,10 b' def has_py3():' | |||
|
863 | 863 | |
|
864 | 864 | @check("py3exe", "a Python 3.x interpreter is available") |
|
865 | 865 | def has_python3exe(): |
|
866 | return matchoutput('python3 -V', br'^Python 3.(5|6|7|8|9)') | |
|
866 | py = 'python3' | |
|
867 | if os.name == 'nt': | |
|
868 | py = 'py -3' | |
|
869 | return matchoutput('%s -V' % py, br'^Python 3.(5|6|7|8|9)') | |
|
867 | 870 | |
|
868 | 871 | |
|
869 | 872 | @check("pure", "running with pure Python code") |
@@ -262,7 +262,13 b' def checkportisavailable(port):' | |||
|
262 | 262 | except socket.error as exc: |
|
263 | 263 | if os.name == 'nt' and exc.errno == errno.WSAEACCES: |
|
264 | 264 | return False |
|
265 | elif exc.errno not in ( | |
|
265 | elif PYTHON3: | |
|
266 | # TODO: make a proper exception handler after dropping py2. This | |
|
267 | # works because socket.error is an alias for OSError on py3, | |
|
268 | # which is also the baseclass of PermissionError. | |
|
269 | if isinstance(exc, PermissionError): | |
|
270 | return False | |
|
271 | if exc.errno not in ( | |
|
266 | 272 | errno.EADDRINUSE, |
|
267 | 273 | errno.EADDRNOTAVAIL, |
|
268 | 274 | errno.EPROTONOSUPPORT, |
@@ -355,7 +361,8 b' def parselistfiles(files, listtype, warn' | |||
|
355 | 361 | for line in f.readlines(): |
|
356 | 362 | line = line.split(b'#', 1)[0].strip() |
|
357 | 363 | if line: |
|
358 | entries[line] = filename | |
|
364 | # Ensure path entries are compatible with os.path.relpath() | |
|
365 | entries[os.path.normpath(line)] = filename | |
|
359 | 366 | |
|
360 | 367 | f.close() |
|
361 | 368 | return entries |
@@ -23,4 +23,5 b' run pyflakes on all tracked files ending' | |||
|
23 | 23 | mercurial/hgweb/server.py:*:* undefined name 'reload' (glob) (?) |
|
24 | 24 | mercurial/util.py:*:* undefined name 'file' (glob) (?) |
|
25 | 25 | mercurial/encoding.py:*:* undefined name 'localstr' (glob) (?) |
|
26 | tests/run-tests.py:*:* undefined name 'PermissionError' (glob) (?) | |
|
26 | 27 |
@@ -201,7 +201,6 b' Basic clone' | |||
|
201 | 201 | branch2-served.hidden |
|
202 | 202 | branch2-visible |
|
203 | 203 | branch2-visible-hidden |
|
204 | hgtagsfnodes1 | |
|
205 | 204 | rbc-names-v1 |
|
206 | 205 | rbc-revs-v1 |
|
207 | 206 | tags2 |
@@ -62,7 +62,6 b' Ensure branchcache got copied over:' | |||
|
62 | 62 | branch2-served.hidden |
|
63 | 63 | branch2-visible |
|
64 | 64 | branch2-visible-hidden |
|
65 | hgtagsfnodes1 | |
|
66 | 65 | rbc-names-v1 |
|
67 | 66 | rbc-revs-v1 |
|
68 | 67 | tags2 |
@@ -142,7 +141,6 b' Ensure branchcache got copied over:' | |||
|
142 | 141 | branch2-served.hidden |
|
143 | 142 | branch2-visible |
|
144 | 143 | branch2-visible-hidden |
|
145 | hgtagsfnodes1 | |
|
146 | 144 | rbc-names-v1 |
|
147 | 145 | rbc-revs-v1 |
|
148 | 146 | tags2 |
@@ -244,7 +244,6 b' r4 has hardlinks in the working dir (not' | |||
|
244 | 244 | 2 r4/.hg/cache/branch2-served.hidden |
|
245 | 245 | 2 r4/.hg/cache/branch2-visible |
|
246 | 246 | 2 r4/.hg/cache/branch2-visible-hidden |
|
247 | 2 r4/.hg/cache/hgtagsfnodes1 | |
|
248 | 247 | 2 r4/.hg/cache/rbc-names-v1 |
|
249 | 248 | 2 r4/.hg/cache/rbc-revs-v1 |
|
250 | 249 | 2 r4/.hg/cache/tags2 |
@@ -302,7 +301,6 b' Update back to revision 12 in r4 should ' | |||
|
302 | 301 | 2 r4/.hg/cache/branch2-served.hidden |
|
303 | 302 | 2 r4/.hg/cache/branch2-visible |
|
304 | 303 | 2 r4/.hg/cache/branch2-visible-hidden |
|
305 | 2 r4/.hg/cache/hgtagsfnodes1 | |
|
306 | 304 | 2 r4/.hg/cache/rbc-names-v1 |
|
307 | 305 | 2 r4/.hg/cache/rbc-revs-v1 |
|
308 | 306 | 2 r4/.hg/cache/tags2 |
@@ -1116,15 +1116,17 b' Skips with xml' | |||
|
1116 | 1116 | </testsuite> |
|
1117 | 1117 | |
|
1118 | 1118 | Missing skips or blacklisted skips don't count as executed: |
|
1119 | $ echo test-failure.t > blacklist | |
|
1119 | $ mkdir tests | |
|
1120 | $ echo tests/test-failure.t > blacklist | |
|
1121 | $ cp test-failure.t tests | |
|
1120 | 1122 | $ rt --blacklist=blacklist --json\ |
|
1121 | > test-failure.t test-bogus.t | |
|
1123 | > tests/test-failure.t tests/test-bogus.t | |
|
1122 | 1124 | running 2 tests using 1 parallel processes |
|
1123 | 1125 | ss |
|
1124 | 1126 | Skipped test-bogus.t: Doesn't exist |
|
1125 | 1127 | Skipped test-failure.t: blacklisted |
|
1126 | 1128 | # Ran 0 tests, 2 skipped, 0 failed. |
|
1127 | $ cat report.json | |
|
1129 | $ cat tests/report.json | |
|
1128 | 1130 | testreport ={ |
|
1129 | 1131 | "test-bogus.t": { |
|
1130 | 1132 | "result": "skip" |
@@ -1133,6 +1135,8 b" Missing skips or blacklisted skips don't" | |||
|
1133 | 1135 | "result": "skip" |
|
1134 | 1136 | } |
|
1135 | 1137 | } (no-eol) |
|
1138 | $ rm -r tests | |
|
1139 | $ echo test-failure.t > blacklist | |
|
1136 | 1140 | |
|
1137 | 1141 | Whitelist trumps blacklist |
|
1138 | 1142 | $ echo test-failure.t > whitelist |
@@ -68,7 +68,6 b' Cloning a shared repo should pick up the' | |||
|
68 | 68 | branch2-served.hidden |
|
69 | 69 | branch2-visible |
|
70 | 70 | branch2-visible-hidden |
|
71 | hgtagsfnodes1 | |
|
72 | 71 | rbc-names-v1 |
|
73 | 72 | rbc-revs-v1 |
|
74 | 73 | tags2 |
@@ -86,7 +86,7 b' clone bookmarks via stream' | |||
|
86 | 86 | $ hg -R local-stream book mybook |
|
87 | 87 | $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/local-stream stream2 |
|
88 | 88 | streaming all changes |
|
89 |
1 |
|
|
89 | 15 files to transfer, * of data (glob) | |
|
90 | 90 | transferred * in * seconds (*) (glob) |
|
91 | 91 | updating to branch default |
|
92 | 92 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -807,11 +807,11 b' Cache should contain the head only, even' | |||
|
807 | 807 | |
|
808 | 808 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 |
|
809 | 809 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 |
|
810 | 0000: 96 ee 1d 73 00 00 00 00 00 00 00 00 00 00 00 00 |...s............| | |
|
811 | 0010: 00 00 00 00 00 00 00 00 c4 da b0 c2 94 65 e1 c6 |.............e..| | |
|
812 | 0020: 0d f7 f0 dd 32 04 ea 57 78 c8 97 97 79 fc d5 95 |....2..Wx...y...| | |
|
813 | 0030: f6 3c c8 fe 94 65 e1 c6 0d f7 f0 dd 32 04 ea 57 |.<...e......2..W| | |
|
814 |
0040: |
|
|
810 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
811 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
812 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
813 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
814 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| | |
|
815 | 815 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| |
|
816 | 816 | |
|
817 | 817 | Running hg tags should produce tags2* file and not change cache |
@@ -837,11 +837,11 b' Running hg tags should produce tags2* fi' | |||
|
837 | 837 | |
|
838 | 838 | $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1 |
|
839 | 839 | tagsclient/.hg/cache/hgtagsfnodes1: size=96 |
|
840 | 0000: 96 ee 1d 73 00 00 00 00 00 00 00 00 00 00 00 00 |...s............| | |
|
841 | 0010: 00 00 00 00 00 00 00 00 c4 da b0 c2 94 65 e1 c6 |.............e..| | |
|
842 | 0020: 0d f7 f0 dd 32 04 ea 57 78 c8 97 97 79 fc d5 95 |....2..Wx...y...| | |
|
843 | 0030: f6 3c c8 fe 94 65 e1 c6 0d f7 f0 dd 32 04 ea 57 |.<...e......2..W| | |
|
844 |
0040: |
|
|
840 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
841 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
842 | 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
843 | 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
|
844 | 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....| | |
|
845 | 845 | 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.| |
|
846 | 846 | |
|
847 | 847 | Check that the bundle includes cache data |
@@ -792,7 +792,7 b' Stream clone with basicstore' | |||
|
792 | 792 | $ hg clone --config experimental.changegroup3=True --stream -U \ |
|
793 | 793 | > http://localhost:$HGPORT1 stream-clone-basicstore |
|
794 | 794 | streaming all changes |
|
795 |
2 |
|
|
795 | 28 files to transfer, * of data (glob) | |
|
796 | 796 | transferred * in * seconds (*) (glob) |
|
797 | 797 | $ hg -R stream-clone-basicstore verify |
|
798 | 798 | checking changesets |
@@ -806,7 +806,7 b' Stream clone with encodedstore' | |||
|
806 | 806 | $ hg clone --config experimental.changegroup3=True --stream -U \ |
|
807 | 807 | > http://localhost:$HGPORT2 stream-clone-encodedstore |
|
808 | 808 | streaming all changes |
|
809 |
2 |
|
|
809 | 28 files to transfer, * of data (glob) | |
|
810 | 810 | transferred * in * seconds (*) (glob) |
|
811 | 811 | $ hg -R stream-clone-encodedstore verify |
|
812 | 812 | checking changesets |
General Comments 0
You need to be logged in to leave comments.
Login now