# HG changeset patch # User Raphaël Gomès # Date 1692604808 -7200 # Node ID b76a938cc9dd3b38389d2d7f965e2b8e56a3a2dc # Parent 1144c69c7f58644fc18ac68b217f653ba4c2e1c4# Parent 181936ad069a0d958a6605b996158b60a0dc0a5e branching: merge stable into default diff -r 1144c69c7f58 -r b76a938cc9dd hgext/gpg.py --- a/hgext/gpg.py Sun Aug 20 02:17:38 2023 -0400 +++ b/hgext/gpg.py Mon Aug 21 10:00:08 2023 +0200 @@ -339,8 +339,9 @@ repo.vfs.append(b"localsigs", sigmessage) return + msigs = match.exact([b'.hgsigs']) + if not opts[b"force"]: - msigs = match.exact([b'.hgsigs']) if any(repo.status(match=msigs, unknown=True, ignored=True)): raise error.Abort( _(b"working copy of .hgsigs is changed "), diff -r 1144c69c7f58 -r b76a938cc9dd mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py Sun Aug 20 02:17:38 2023 -0400 +++ b/mercurial/hgweb/request.py Mon Aug 21 10:00:08 2023 +0200 @@ -11,7 +11,6 @@ from ..thirdparty import attr from .. import ( - encoding, error, pycompat, util, @@ -167,13 +166,7 @@ def tobytes(s): if not isinstance(s, str): return s - if pycompat.iswindows: - # This is what mercurial.encoding does for os.environ on - # Windows. - return encoding.strtolocal(s) - else: - # This is what is documented to be used for os.environ on Unix. - return pycompat.fsencode(s) + return s.encode('iso8859-1') env = {tobytes(k): tobytes(v) for k, v in env.items()} diff -r 1144c69c7f58 -r b76a938cc9dd rust/hg-core/src/sparse.rs --- a/rust/hg-core/src/sparse.rs Sun Aug 20 02:17:38 2023 -0400 +++ b/rust/hg-core/src/sparse.rs Mon Aug 21 10:00:08 2023 +0200 @@ -282,7 +282,7 @@ let (patterns, subwarnings) = parse_pattern_file_contents( &config.includes, Path::new(""), - Some(b"relglob:".as_ref()), + Some(b"glob:".as_ref()), false, )?; warnings.extend(subwarnings.into_iter().map(From::from)); @@ -292,7 +292,7 @@ let (patterns, subwarnings) = parse_pattern_file_contents( &config.excludes, Path::new(""), - Some(b"relglob:".as_ref()), + Some(b"glob:".as_ref()), false, )?; warnings.extend(subwarnings.into_iter().map(From::from)); diff -r 1144c69c7f58 -r b76a938cc9dd tests/test-gpg.t --- a/tests/test-gpg.t Sun Aug 20 02:17:38 2023 -0400 +++ b/tests/test-gpg.t Mon Aug 21 10:00:08 2023 +0200 @@ -54,4 +54,21 @@ e63c23eaa88a is signed by: hgtest +The signature is different each time, so avoid signing the previous signature so +that the cset hashes are unchanging. + $ hg up -q '.^' + + $ HGEDITOR=cat hg sign -f -e . + gpg: error retrieving key fingerprint from card: Invalid name (?) + signing 0:e63c23eaa88a + Added signature for changeset e63c23eaa88a + + + HG: Enter commit message. Lines beginning with 'HG:' are removed. + HG: Leave message empty to abort commit. + HG: -- + HG: user: test + HG: branch 'default' + HG: added .hgsigs + $ cd .. diff -r 1144c69c7f58 -r b76a938cc9dd tests/test-sparse.t --- a/tests/test-sparse.t Sun Aug 20 02:17:38 2023 -0400 +++ b/tests/test-sparse.t Mon Aug 21 10:00:08 2023 +0200 @@ -21,6 +21,29 @@ Verify basic --include $ hg up -q 0 + +Test that sparse pattern by default is interpreted as "glob:", and is interpreted relative to the root. + + $ hg debugsparse --reset + $ hg debugsparse -X 'foo*bar' + $ cat .hg/sparse + [exclude] + foo*bar + + $ mk() { mkdir -p "$1"; touch "$1"/"$2"; } + $ mk 'foo' bar + $ mk 'foo-bar' x + $ mk 'unanchoredfoo-bar' x + $ mk 'foo*bar' x + $ mk 'dir/foo-bar' x + $ hg status --config rhg.on-unsupported=abort + ? dir/foo-bar/x + ? foo/bar + ? unanchoredfoo-bar/x + $ hg clean -a --no-confirm + $ rm -r foo*bar + $ hg debugsparse --reset + $ hg debugsparse --include 'hide' $ ls -A .hg diff -r 1144c69c7f58 -r b76a938cc9dd tests/test-wsgirequest.py --- a/tests/test-wsgirequest.py Sun Aug 20 02:17:38 2023 -0400 +++ b/tests/test-wsgirequest.py Mon Aug 21 10:00:08 2023 +0200 @@ -500,16 +500,9 @@ self.assertEqual(r.reponame, b'repo') def testenvencoding(self): - if pycompat.iswindows: - # On Windows, we can't generally know which non-ASCII characters - # are supported. - r = parse(DEFAULT_ENV, extra={'foo': 'bar'}) - self.assertEqual(r.rawenv[b'foo'], b'bar') - else: - # Unix is byte-based. Therefore we test all possible bytes. - b = b''.join(pycompat.bytechr(i) for i in range(256)) - r = parse(DEFAULT_ENV, extra={'foo': pycompat.fsdecode(b)}) - self.assertEqual(r.rawenv[b'foo'], b) + b = b''.join(pycompat.bytechr(i) for i in range(256)) + r = parse(DEFAULT_ENV, extra={'foo': b.decode('iso8859-1')}) + self.assertEqual(r.rawenv[b'foo'], b) if __name__ == '__main__':