D10536: core: don't hard-code node length
joerg.sonnenberger created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10536 AFFECTED FILES mercurial/localrepo.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1433,7 +1433,7 @@ if isinstance(id, int): # rev return self.node(id) -if len(id) == 20: +if len(id) == self.nodeconstants.nodelen: # possibly a binary node # odds of a binary node being all hex in ASCII are 1 in 10**25 try: diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1840,7 +1840,7 @@ # when we know that '.' won't be hidden node = self.dirstate.p1() rev = self.unfiltered().changelog.rev(node) -elif len(changeid) == 20: +elif len(changeid) == self.nodeconstants.nodelen: try: node = changeid rev = self.changelog.rev(changeid) To: joerg.sonnenberger, indygreg, #hg-reviewers Cc: mercurial-patches, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D10535: core: don't hard-code hex node lengths
joerg.sonnenberger created this revision. Herald added a reviewer: indygreg. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10535 AFFECTED FILES mercurial/localrepo.py mercurial/revlog.py mercurial/revset.py mercurial/scmutil.py mercurial/templatefuncs.py CHANGE DETAILS diff --git a/mercurial/templatefuncs.py b/mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py +++ b/mercurial/templatefuncs.py @@ -764,9 +764,10 @@ ) repo = context.resource(mapping, b'repo') -if len(hexnode) > 40: +hexnodelen = 2 * repo.nodeconstants.nodelen +if len(hexnode) > hexnodelen: return hexnode -elif len(hexnode) == 40: +elif len(hexnode) == hexnodelen: try: node = bin(hexnode) except TypeError: diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -643,7 +643,7 @@ except (ValueError, OverflowError, IndexError): pass -if len(symbol) == 40: +if len(symbol) == 2 * repo.nodeconstants.nodelen: try: node = bin(symbol) rev = repo.changelog.rev(node) diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1724,7 +1724,7 @@ def _node(repo, n): """process a node input""" rn = None -if len(n) == 40: +if len(n) == 2 * repo.nodeconstants.nodelen: try: rn = repo.changelog.rev(bin(n)) except error.WdirUnsupported: diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1454,7 +1454,7 @@ return self.node(rev) except (ValueError, OverflowError): pass -if len(id) == 40: +if len(id) == 2 * self.nodeconstants.nodelen: try: # a full hex nodeid? node = bin(id) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1861,7 +1861,7 @@ changeid = hex(changeid) # for the error message raise -elif len(changeid) == 40: +elif len(changeid) == 2 * self.nodeconstants.nodelen: node = bin(changeid) rev = self.changelog.rev(node) else: To: joerg.sonnenberger, indygreg, #hg-reviewers Cc: mercurial-patches, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D10534: tests: bump default timeout to 360s
joerg.sonnenberger created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY A number of tests hit or almost hit the default limit even on modern hardware. While the tests are ideally split into smaller pieces, that's non-trivial work. HyperThreading and similar technologies can trigger this often, even without any other load on the machine. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10534 AFFECTED FILES tests/run-tests.py CHANGE DETAILS diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -326,7 +326,7 @@ default_defaults = { 'jobs': ('HGTEST_JOBS', multiprocessing.cpu_count()), -'timeout': ('HGTEST_TIMEOUT', 180), +'timeout': ('HGTEST_TIMEOUT', 360), 'slowtimeout': ('HGTEST_SLOWTIMEOUT', 1500), 'port': ('HGTEST_PORT', 20059), 'shell': ('HGTEST_SHELL', 'sh'), To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-patches, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D10533: manifests: push down expected node length into the parser
joerg.sonnenberger created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This strictly enforces the node length in the manifest lines according to what the repository expects. One test case moves large hash testing into the non-treemanifest part as treemanifests don't provide an interface for overriding just the node length for now. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10533 AFFECTED FILES mercurial/cext/manifest.c mercurial/cext/parsers.c mercurial/cext/parsers.pyi mercurial/manifest.py mercurial/policy.py tests/test-manifest.py CHANGE DETAILS diff --git a/tests/test-manifest.py b/tests/test-manifest.py --- a/tests/test-manifest.py +++ b/tests/test-manifest.py @@ -81,12 +81,12 @@ raise NotImplementedError('parsemanifest not implemented by test case') def testEmptyManifest(self): -m = self.parsemanifest(EMTPY_MANIFEST) +m = self.parsemanifest(20, EMTPY_MANIFEST) self.assertEqual(0, len(m)) self.assertEqual([], list(m)) def testManifest(self): -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) self.assertEqual([b'bar/baz/qux.py', b'foo'], list(m)) self.assertEqual(BIN_HASH_2, m[b'bar/baz/qux.py']) self.assertEqual(b'l', m.flags(b'bar/baz/qux.py')) @@ -95,20 +95,16 @@ with self.assertRaises(KeyError): m[b'wat'] -def testManifestLongHashes(self): -m = self.parsemanifest(b'a\0' + b'f' * 64 + b'\n') -self.assertEqual(binascii.unhexlify(b'f' * 64), m[b'a']) - def testSetItem(self): want = BIN_HASH_1 -m = self.parsemanifest(EMTPY_MANIFEST) +m = self.parsemanifest(20, EMTPY_MANIFEST) m[b'a'] = want self.assertIn(b'a', m) self.assertEqual(want, m[b'a']) self.assertEqual(b'a\0' + HASH_1 + b'\n', m.text()) -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) m[b'a'] = want self.assertEqual(want, m[b'a']) self.assertEqual(b'a\0' + HASH_1 + b'\n' + A_SHORT_MANIFEST, m.text()) @@ -116,14 +112,14 @@ def testSetFlag(self): want = b'x' -m = self.parsemanifest(EMTPY_MANIFEST) +m = self.parsemanifest(20, EMTPY_MANIFEST) # first add a file; a file-less flag makes no sense m[b'a'] = BIN_HASH_1 m.setflag(b'a', want) self.assertEqual(want, m.flags(b'a')) self.assertEqual(b'a\0' + HASH_1 + want + b'\n', m.text()) -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) # first add a file; a file-less flag makes no sense m[b'a'] = BIN_HASH_1 m.setflag(b'a', want) @@ -133,7 +129,7 @@ ) def testCopy(self): -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) m[b'a'] = BIN_HASH_1 m2 = m.copy() del m @@ -142,7 +138,7 @@ def testCompaction(self): unhex = binascii.unhexlify h1, h2 = unhex(HASH_1), unhex(HASH_2) -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) m[b'alpha'] = h1 m[b'beta'] = h2 del m[b'foo'] @@ -164,7 +160,7 @@ m[b'foo'] def testMatchException(self): -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) match = matchmod.match(util.localpath(b'/repo'), b'', [b're:.*']) def filt(path): @@ -177,7 +173,7 @@ m._matches(match) def testRemoveItem(self): -m = self.parsemanifest(A_SHORT_MANIFEST) +m = self.parsemanifest(20, A_SHORT_MANIFEST) del m[b'foo'] with self.assertRaises(KeyError): m[b'foo'] @@ -193,9 +189,9 @@ addl = b'z-only-in-left\0' + HASH_1 + b'\n' addr = b'z-only-in-right\0' + HASH_2 + b'x\n' left = self.parsemanifest( -A_SHORT_MANIFEST.replace(HASH_1, HASH_3 + b'x') + addl +20, A_SHORT_MANIFEST.replace(HASH_1, HASH_3 + b'x') + addl ) -right = self.parsemanifest(A_SHORT_MANIFEST + addr) +right = self.parsemanifest(20, A_SHORT_MANIFEST + addr) want = { b'foo': ((BIN_HASH_3, b'x'), (BIN_HASH_1, b'')), b'z-only-in-left': ((BIN_HASH_1, b''), MISSING), @@ -208,14 +204,18 @@ b'foo': (MISSING, (BIN_HASH_3, b'x')), b'z-only-in-left': (MISSING, (BIN_HASH_1, b'')), } -self.assertEqual(want, self.parsemanifest(EMTPY_MANIFEST).diff(left)) +self.assertEqual( +want, self.parsemanifest(20, EMTPY_MANIFEST).diff(left) +) want = { b'bar/baz/qux.py': ((BIN_HASH
[Bug 6513] New: Slightly inaccurate description on homepage
https://bz.mercurial-scm.org/show_bug.cgi?id=6513 Bug ID: 6513 Summary: Slightly inaccurate description on homepage Product: Mercurial project Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: bug Priority: wish Component: website Assignee: bugzi...@mercurial-scm.org Reporter: ce@cybercoment.com CC: mercurial-devel@mercurial-scm.org Per https://www.mercurial-scm.org/ "Mercurial efficiently handles projects of any size and kind." Apparently there's a limit; facebook reached it: https://engineering.fb.com/2021/04/29/developer-tools/rust/ "any size and kind" should probably be qualified with "almost". I suppose https://www.mercurial-scm.org/who could be corrected as well. -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Failed pipeline for branch/stable | mercurial-devel | fbbce790
Pipeline #21338 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/stable ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/stable ) Commit: fbbce790 ( https://foss.heptapod.net/octobus/mercurial-devel/-/commit/fbbce790ffee394b405b4f5bd7a139db2ab2a060 ) Commit Message: dirstateguard: use mktemp-like functionality to... Commit Author: Kyle Lippincott ( https://foss.heptapod.net/spectral ) Pipeline #21338 ( https://foss.heptapod.net/octobus/mercurial-devel/-/pipelines/21338 ) triggered by Raphaël Gomès ( https://foss.heptapod.net/raphael.gomes ) had 2 failed builds. Job #191259 ( https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/191259/raw ) Stage: tests Name: checks-py2 Job #191260 ( https://foss.heptapod.net/octobus/mercurial-devel/-/jobs/191260/raw ) Stage: tests Name: checks-py3 -- You're receiving this email because of your account on foss.heptapod.net. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel