##// END OF EJS Templates
branching: merge stable into default
Raphaël Gomès -
r48007:bcafcd77 merge default
parent child Browse files
Show More
@@ -125,3 +125,17 b' test-py3-chg:'
125 PYTHON: python3
125 PYTHON: python3
126 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
126 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
127 TEST_HGMODULEPOLICY: "c"
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 views[sview] = cview
151 views[sview] = cview
152
152
153 # list of changes that affect our source files
153 # list of changes that affect our source files
154 p4changes = p4changes.keys()
154 p4changes = sorted(p4changes.keys(), key=int)
155 p4changes.sort(key=int)
156
155
157 # list with depot pathnames, longest first
156 # list with depot pathnames, longest first
158 vieworder = views.keys()
157 vieworder = sorted(views.keys(), key=len, reverse=True)
159 vieworder.sort(key=len, reverse=True)
160
158
161 # handle revision limiting
159 # handle revision limiting
162 startrev = self.ui.config(b'convert', b'p4.startrev')
160 startrev = self.ui.config(b'convert', b'p4.startrev')
@@ -188,7 +186,7 b' class p4_source(common.converter_source)'
188 else:
186 else:
189 shortdesc = b'**empty changelist description**'
187 shortdesc = b'**empty changelist description**'
190
188
191 t = b'%s %s' % (c.rev, repr(shortdesc)[1:-1])
189 t = b'%s %s' % (c.rev, shortdesc)
192 ui.status(stringutil.ellipsis(t, 80) + b'\n')
190 ui.status(stringutil.ellipsis(t, 80) + b'\n')
193
191
194 files = []
192 files = []
@@ -1054,7 +1054,7 b' def clone('
1054 # as the only "bad" outcome would be some slowness. That potential
1054 # as the only "bad" outcome would be some slowness. That potential
1055 # slowness already affect reader.
1055 # slowness already affect reader.
1056 with destrepo.lock():
1056 with destrepo.lock():
1057 destrepo.updatecaches(full=True)
1057 destrepo.updatecaches(full=b"post-clone")
1058 finally:
1058 finally:
1059 release(srclock, destlock)
1059 release(srclock, destlock)
1060 if cleandir is not None:
1060 if cleandir is not None:
@@ -2727,6 +2727,11 b' class localrepository(object):'
2727
2727
2728 If 'full' is set, make sure all caches the function knows about have
2728 If 'full' is set, make sure all caches the function knows about have
2729 up-to-date data. Even the ones usually loaded more lazily.
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 if tr is not None and tr.hookargs.get(b'source') == b'strip':
2736 if tr is not None and tr.hookargs.get(b'source') == b'strip':
2732 # During strip, many caches are invalid but
2737 # During strip, many caches are invalid but
@@ -2754,8 +2759,9 b' class localrepository(object):'
2754 for ctx in self[b'.'].parents():
2759 for ctx in self[b'.'].parents():
2755 ctx.manifest() # accessing the manifest is enough
2760 ctx.manifest() # accessing the manifest is enough
2756
2761
2757 # accessing fnode cache warms the cache
2762 if not full == b"post-clone":
2758 tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs())
2763 # accessing fnode cache warms the cache
2764 tagsmod.fnoderevs(self.ui, unfi, unfi.changelog.revs())
2759 # accessing tags warm the cache
2765 # accessing tags warm the cache
2760 self.tags()
2766 self.tags()
2761 self.filtered(b'served').tags()
2767 self.filtered(b'served').tags()
@@ -381,6 +381,10 b' def getfstype(dirpath):'
381 return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
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 def setbinary(fd):
388 def setbinary(fd):
385 pass
389 pass
386
390
@@ -11,7 +11,6 b' import collections'
11 import contextlib
11 import contextlib
12 import datetime
12 import datetime
13 import errno
13 import errno
14 import getpass
15 import inspect
14 import inspect
16 import os
15 import os
17 import re
16 import re
@@ -1781,7 +1780,7 b' class ui(object):'
1781 raise EOFError
1780 raise EOFError
1782 return l.rstrip(b'\n')
1781 return l.rstrip(b'\n')
1783 else:
1782 else:
1784 return encoding.strtolocal(getpass.getpass(''))
1783 return util.get_password()
1785 except EOFError:
1784 except EOFError:
1786 raise error.ResponseExpected()
1785 raise error.ResponseExpected()
1787
1786
@@ -107,6 +107,7 b' copymode = platform.copymode'
107 expandglobs = platform.expandglobs
107 expandglobs = platform.expandglobs
108 getfsmountpoint = platform.getfsmountpoint
108 getfsmountpoint = platform.getfsmountpoint
109 getfstype = platform.getfstype
109 getfstype = platform.getfstype
110 get_password = platform.get_password
110 groupmembers = platform.groupmembers
111 groupmembers = platform.groupmembers
111 groupname = platform.groupname
112 groupname = platform.groupname
112 isexec = platform.isexec
113 isexec = platform.isexec
@@ -194,6 +194,28 b' def _isatty(fp):'
194 return False
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 class winstdout(object):
219 class winstdout(object):
198 """Some files on Windows misbehave.
220 """Some files on Windows misbehave.
199
221
@@ -863,7 +863,10 b' def has_py3():'
863
863
864 @check("py3exe", "a Python 3.x interpreter is available")
864 @check("py3exe", "a Python 3.x interpreter is available")
865 def has_python3exe():
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 @check("pure", "running with pure Python code")
872 @check("pure", "running with pure Python code")
@@ -262,7 +262,13 b' def checkportisavailable(port):'
262 except socket.error as exc:
262 except socket.error as exc:
263 if os.name == 'nt' and exc.errno == errno.WSAEACCES:
263 if os.name == 'nt' and exc.errno == errno.WSAEACCES:
264 return False
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 errno.EADDRINUSE,
272 errno.EADDRINUSE,
267 errno.EADDRNOTAVAIL,
273 errno.EADDRNOTAVAIL,
268 errno.EPROTONOSUPPORT,
274 errno.EPROTONOSUPPORT,
@@ -355,7 +361,8 b' def parselistfiles(files, listtype, warn'
355 for line in f.readlines():
361 for line in f.readlines():
356 line = line.split(b'#', 1)[0].strip()
362 line = line.split(b'#', 1)[0].strip()
357 if line:
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 f.close()
367 f.close()
361 return entries
368 return entries
@@ -23,4 +23,5 b' run pyflakes on all tracked files ending'
23 mercurial/hgweb/server.py:*:* undefined name 'reload' (glob) (?)
23 mercurial/hgweb/server.py:*:* undefined name 'reload' (glob) (?)
24 mercurial/util.py:*:* undefined name 'file' (glob) (?)
24 mercurial/util.py:*:* undefined name 'file' (glob) (?)
25 mercurial/encoding.py:*:* undefined name 'localstr' (glob) (?)
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 branch2-served.hidden
201 branch2-served.hidden
202 branch2-visible
202 branch2-visible
203 branch2-visible-hidden
203 branch2-visible-hidden
204 hgtagsfnodes1
205 rbc-names-v1
204 rbc-names-v1
206 rbc-revs-v1
205 rbc-revs-v1
207 tags2
206 tags2
@@ -62,7 +62,6 b' Ensure branchcache got copied over:'
62 branch2-served.hidden
62 branch2-served.hidden
63 branch2-visible
63 branch2-visible
64 branch2-visible-hidden
64 branch2-visible-hidden
65 hgtagsfnodes1
66 rbc-names-v1
65 rbc-names-v1
67 rbc-revs-v1
66 rbc-revs-v1
68 tags2
67 tags2
@@ -142,7 +141,6 b' Ensure branchcache got copied over:'
142 branch2-served.hidden
141 branch2-served.hidden
143 branch2-visible
142 branch2-visible
144 branch2-visible-hidden
143 branch2-visible-hidden
145 hgtagsfnodes1
146 rbc-names-v1
144 rbc-names-v1
147 rbc-revs-v1
145 rbc-revs-v1
148 tags2
146 tags2
@@ -244,7 +244,6 b' r4 has hardlinks in the working dir (not'
244 2 r4/.hg/cache/branch2-served.hidden
244 2 r4/.hg/cache/branch2-served.hidden
245 2 r4/.hg/cache/branch2-visible
245 2 r4/.hg/cache/branch2-visible
246 2 r4/.hg/cache/branch2-visible-hidden
246 2 r4/.hg/cache/branch2-visible-hidden
247 2 r4/.hg/cache/hgtagsfnodes1
248 2 r4/.hg/cache/rbc-names-v1
247 2 r4/.hg/cache/rbc-names-v1
249 2 r4/.hg/cache/rbc-revs-v1
248 2 r4/.hg/cache/rbc-revs-v1
250 2 r4/.hg/cache/tags2
249 2 r4/.hg/cache/tags2
@@ -302,7 +301,6 b' Update back to revision 12 in r4 should '
302 2 r4/.hg/cache/branch2-served.hidden
301 2 r4/.hg/cache/branch2-served.hidden
303 2 r4/.hg/cache/branch2-visible
302 2 r4/.hg/cache/branch2-visible
304 2 r4/.hg/cache/branch2-visible-hidden
303 2 r4/.hg/cache/branch2-visible-hidden
305 2 r4/.hg/cache/hgtagsfnodes1
306 2 r4/.hg/cache/rbc-names-v1
304 2 r4/.hg/cache/rbc-names-v1
307 2 r4/.hg/cache/rbc-revs-v1
305 2 r4/.hg/cache/rbc-revs-v1
308 2 r4/.hg/cache/tags2
306 2 r4/.hg/cache/tags2
@@ -1116,15 +1116,17 b' Skips with xml'
1116 </testsuite>
1116 </testsuite>
1117
1117
1118 Missing skips or blacklisted skips don't count as executed:
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 $ rt --blacklist=blacklist --json\
1122 $ rt --blacklist=blacklist --json\
1121 > test-failure.t test-bogus.t
1123 > tests/test-failure.t tests/test-bogus.t
1122 running 2 tests using 1 parallel processes
1124 running 2 tests using 1 parallel processes
1123 ss
1125 ss
1124 Skipped test-bogus.t: Doesn't exist
1126 Skipped test-bogus.t: Doesn't exist
1125 Skipped test-failure.t: blacklisted
1127 Skipped test-failure.t: blacklisted
1126 # Ran 0 tests, 2 skipped, 0 failed.
1128 # Ran 0 tests, 2 skipped, 0 failed.
1127 $ cat report.json
1129 $ cat tests/report.json
1128 testreport ={
1130 testreport ={
1129 "test-bogus.t": {
1131 "test-bogus.t": {
1130 "result": "skip"
1132 "result": "skip"
@@ -1133,6 +1135,8 b" Missing skips or blacklisted skips don't"
1133 "result": "skip"
1135 "result": "skip"
1134 }
1136 }
1135 } (no-eol)
1137 } (no-eol)
1138 $ rm -r tests
1139 $ echo test-failure.t > blacklist
1136
1140
1137 Whitelist trumps blacklist
1141 Whitelist trumps blacklist
1138 $ echo test-failure.t > whitelist
1142 $ echo test-failure.t > whitelist
@@ -68,7 +68,6 b' Cloning a shared repo should pick up the'
68 branch2-served.hidden
68 branch2-served.hidden
69 branch2-visible
69 branch2-visible
70 branch2-visible-hidden
70 branch2-visible-hidden
71 hgtagsfnodes1
72 rbc-names-v1
71 rbc-names-v1
73 rbc-revs-v1
72 rbc-revs-v1
74 tags2
73 tags2
@@ -86,7 +86,7 b' clone bookmarks via stream'
86 $ hg -R local-stream book mybook
86 $ hg -R local-stream book mybook
87 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/local-stream stream2
87 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/local-stream stream2
88 streaming all changes
88 streaming all changes
89 16 files to transfer, * of data (glob)
89 15 files to transfer, * of data (glob)
90 transferred * in * seconds (*) (glob)
90 transferred * in * seconds (*) (glob)
91 updating to branch default
91 updating to branch default
92 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
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 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
808 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
809 tagsclient/.hg/cache/hgtagsfnodes1: size=96
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............|
810 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
811 0010: 00 00 00 00 00 00 00 00 c4 da b0 c2 94 65 e1 c6 |.............e..|
811 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
812 0020: 0d f7 f0 dd 32 04 ea 57 78 c8 97 97 79 fc d5 95 |....2..Wx...y...|
812 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
813 0030: f6 3c c8 fe 94 65 e1 c6 0d f7 f0 dd 32 04 ea 57 |.<...e......2..W|
813 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
814 0040: 78 c8 97 97 79 fc d5 95 40 f0 35 8c 19 e0 a7 d3 |x...y...@.5.....|
814 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
815 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
815 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
816
816
817 Running hg tags should produce tags2* file and not change cache
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 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
838 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
839 tagsclient/.hg/cache/hgtagsfnodes1: size=96
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............|
840 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
841 0010: 00 00 00 00 00 00 00 00 c4 da b0 c2 94 65 e1 c6 |.............e..|
841 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
842 0020: 0d f7 f0 dd 32 04 ea 57 78 c8 97 97 79 fc d5 95 |....2..Wx...y...|
842 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
843 0030: f6 3c c8 fe 94 65 e1 c6 0d f7 f0 dd 32 04 ea 57 |.<...e......2..W|
843 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
844 0040: 78 c8 97 97 79 fc d5 95 40 f0 35 8c 19 e0 a7 d3 |x...y...@.5.....|
844 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
845 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
845 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
846
846
847 Check that the bundle includes cache data
847 Check that the bundle includes cache data
@@ -792,7 +792,7 b' Stream clone with basicstore'
792 $ hg clone --config experimental.changegroup3=True --stream -U \
792 $ hg clone --config experimental.changegroup3=True --stream -U \
793 > http://localhost:$HGPORT1 stream-clone-basicstore
793 > http://localhost:$HGPORT1 stream-clone-basicstore
794 streaming all changes
794 streaming all changes
795 29 files to transfer, * of data (glob)
795 28 files to transfer, * of data (glob)
796 transferred * in * seconds (*) (glob)
796 transferred * in * seconds (*) (glob)
797 $ hg -R stream-clone-basicstore verify
797 $ hg -R stream-clone-basicstore verify
798 checking changesets
798 checking changesets
@@ -806,7 +806,7 b' Stream clone with encodedstore'
806 $ hg clone --config experimental.changegroup3=True --stream -U \
806 $ hg clone --config experimental.changegroup3=True --stream -U \
807 > http://localhost:$HGPORT2 stream-clone-encodedstore
807 > http://localhost:$HGPORT2 stream-clone-encodedstore
808 streaming all changes
808 streaming all changes
809 29 files to transfer, * of data (glob)
809 28 files to transfer, * of data (glob)
810 transferred * in * seconds (*) (glob)
810 transferred * in * seconds (*) (glob)
811 $ hg -R stream-clone-encodedstore verify
811 $ hg -R stream-clone-encodedstore verify
812 checking changesets
812 checking changesets
General Comments 0
You need to be logged in to leave comments. Login now