branching: merge stable into default
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 21 Aug 2023 10:00:08 +0200
changeset 50879 b76a938cc9dd
parent 50878 1144c69c7f58 (current diff)
parent 50769 181936ad069a (diff)
child 50880 e037af7de2ce
branching: merge stable into default
--- 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 "),
--- 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()}
 
--- 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));
--- 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 ..
--- 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
--- 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__':