diff --git a/hgext/gpg.py b/hgext/gpg.py --- a/hgext/gpg.py +++ b/hgext/gpg.py @@ -339,8 +339,9 @@ def _dosign(ui, repo, *revs, **opts): 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 --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py +++ b/mercurial/hgweb/request.py @@ -11,7 +11,6 @@ from ..thirdparty import attr from .. import ( - encoding, error, pycompat, util, @@ -167,13 +166,7 @@ def parserequestfromenv(env, reponame=No 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 --git a/rust/hg-core/src/sparse.rs b/rust/hg-core/src/sparse.rs --- a/rust/hg-core/src/sparse.rs +++ b/rust/hg-core/src/sparse.rs @@ -282,7 +282,7 @@ pub fn matcher( 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 @@ pub fn matcher( 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 --git a/tests/test-gpg.t b/tests/test-gpg.t --- a/tests/test-gpg.t +++ b/tests/test-gpg.t @@ -54,4 +54,21 @@ and migrate secret keys 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 --git a/tests/test-sparse.t b/tests/test-sparse.t --- a/tests/test-sparse.t +++ b/tests/test-sparse.t @@ -21,6 +21,29 @@ test sparse 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 --git a/tests/test-wsgirequest.py b/tests/test-wsgirequest.py --- a/tests/test-wsgirequest.py +++ b/tests/test-wsgirequest.py @@ -500,16 +500,9 @@ class ParseRequestTests(unittest.TestCas 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__':