changeset 50463:771294224bf6

branching: merge stable into default
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 14 Apr 2023 10:41:40 +0200
parents 59fda8516774 (current diff) ae9a15267315 (diff)
children 5ae30ff79c76
files hgext/rebase.py mercurial/commands.py mercurial/configitems.py
diffstat 19 files changed, 194 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsigs	Wed Apr 12 00:57:01 2023 +0200
+++ b/.hgsigs	Fri Apr 14 10:41:40 2023 +0200
@@ -241,3 +241,4 @@
 8830004967ad865ead89c28a410405a6e71e0796 0 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
+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
--- a/.hgtags	Wed Apr 12 00:57:01 2023 +0200
+++ b/.hgtags	Fri Apr 14 10:41:40 2023 +0200
@@ -257,3 +257,4 @@
 8830004967ad865ead89c28a410405a6e71e0796 6.3.3
 05de4896508e8ec387b33eb30d8aab78d1c8e9e4 6.4rc0
 f14864fffdcab725d9eac6d4f4c07be05a35f59a 6.4
+83ea6ce48b4fd09fb79c4e34cc5750c805699a53 6.4.1
--- a/contrib/chg/chg.c	Wed Apr 12 00:57:01 2023 +0200
+++ b/contrib/chg/chg.c	Fri Apr 14 10:41:40 2023 +0200
@@ -232,12 +232,17 @@
 			hgcmd = "hg";
 #endif
 	}
+	/* Set $CHGHG to the path to the seleted hg executable if it wasn't
+	 * already set. This has the effect of ensuring that a new command
+	 * server will be spawned if the existing command server is running from
+	 * an executable at a different path. */
+	if (setenv("CHGHG", hgcmd, 1) != 0)
+		abortmsgerrno("failed to setenv");
 	return hgcmd;
 }
 
-static void execcmdserver(const struct cmdserveropts *opts)
+static void execcmdserver(const char *hgcmd, const struct cmdserveropts *opts)
 {
-	const char *hgcmd = gethgcmd();
 
 	const char *baseargv[] = {
 	    hgcmd,     "serve",     "--no-profile",     "--cmdserver",
@@ -375,11 +380,16 @@
 
 	debugmsg("start cmdserver at %s", opts->initsockname);
 
+	/* Get the path to the hg executable before we fork because this
+	 * function might update the environment, and we want this to be
+	 * reflected in both the parent and child processes. */
+	const char *hgcmd = gethgcmd();
+
 	pid_t pid = fork();
 	if (pid < 0)
 		abortmsg("failed to fork cmdserver process");
 	if (pid == 0) {
-		execcmdserver(opts);
+		execcmdserver(hgcmd, opts);
 	} else {
 		hgc = retryconnectcmdserver(opts, pid);
 	}
@@ -484,7 +494,7 @@
 		abortmsgerrno("failed to exec original hg");
 }
 
-int main(int argc, const char *argv[], const char *envp[])
+int main(int argc, const char *argv[])
 {
 	if (getenv("CHGDEBUG"))
 		enabledebugmsg();
@@ -519,7 +529,10 @@
 		hgc = connectcmdserver(&opts);
 		if (!hgc)
 			abortmsg("cannot open hg client");
-		hgc_setenv(hgc, envp);
+		/* Use `environ(7)` instead of the optional `envp` argument to
+		 * `main` because `envp` does not update when the environment
+		 * changes, but `environ` does. */
+		hgc_setenv(hgc, (const char *const *)environ);
 		const char **insts = hgc_validate(hgc, argv + 1, argc - 1);
 		int needreconnect = runinstructions(&opts, insts);
 		free(insts);
--- a/hgext/rebase.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/hgext/rebase.py	Fri Apr 14 10:41:40 2023 +0200
@@ -844,6 +844,7 @@
                 cleanup = False
 
             if cleanup:
+
                 if rebased:
                     strippoints = [
                         c.node() for c in repo.set(b'roots(%ld)', rebased)
@@ -852,13 +853,17 @@
                 updateifonnodes = set(rebased)
                 updateifonnodes.update(self.destmap.values())
 
-                if not dryrun and not confirm:
+                if not confirm:
+                    # note: when dry run is set the `rebased` and `destmap`
+                    # variables seem to contain "bad" contents, so do not
+                    # rely on them. As dryrun does not need this part of
+                    # the cleanup, this is "fine"
                     updateifonnodes.add(self.originalwd)
 
                 shouldupdate = repo[b'.'].rev() in updateifonnodes
 
                 # Update away from the rebase if necessary
-                if shouldupdate:
+                if not dryrun and shouldupdate:
                     mergemod.clean_update(repo[self.originalwd])
 
                 # Strip from the first rebased revision
--- a/i18n/ja.po	Wed Apr 12 00:57:01 2023 +0200
+++ b/i18n/ja.po	Fri Apr 14 10:41:40 2023 +0200
@@ -37064,8 +37064,8 @@
 msgstr "利用中の Python では TLS 1.2 が未サポートです"
 
 #, python-format
-msgid "invalid value for serverexactprotocol: %s"
-msgstr "不正な serverexactprotocol 指定値: %s"
+msgid "invalid value for server-insecure-exact-protocol: %s"
+msgstr "不正な server-insecure-exact-protocol 指定値: %s"
 
 #, python-format
 msgid "too many wildcards in certificate DNS name: %s"
--- a/i18n/pt_BR.po	Wed Apr 12 00:57:01 2023 +0200
+++ b/i18n/pt_BR.po	Fri Apr 14 10:41:40 2023 +0200
@@ -38342,8 +38342,8 @@
 msgstr "TLS 1.2 não é suportado por esta versão do Python"
 
 #, python-format
-msgid "invalid value for serverexactprotocol: %s"
-msgstr "valor inválido para serverexactprotocol: %s"
+msgid "invalid value for server-insecure-exact-protocol: %s"
+msgstr "valor inválido para server-insecure-exact-protocol: %s"
 
 #, python-format
 msgid "too many wildcards in certificate DNS name: %s"
--- a/mercurial/commands.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/mercurial/commands.py	Fri Apr 14 10:41:40 2023 +0200
@@ -6609,7 +6609,7 @@
         ),
         (b't', b'templates', b'', _(b'web templates to use'), _(b'TEMPLATE')),
         (b'', b'style', b'', _(b'template style to use'), _(b'STYLE')),
-        (b'6', b'ipv6', None, _(b'use IPv6 in addition to IPv4')),
+        (b'6', b'ipv6', None, _(b'use IPv6 instead of IPv4')),
         (b'', b'certificate', b'', _(b'SSL certificate file'), _(b'FILE')),
         (b'', b'print-url', None, _(b'start and print only the URL')),
     ]
--- a/mercurial/configitems.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/mercurial/configitems.py	Fri Apr 14 10:41:40 2023 +0200
@@ -688,9 +688,11 @@
     b'servercafile',
     default=b'',
 )
+# This config option is intended for use in tests only. It is a giant
+# footgun to kill security. Don't define it.
 coreconfigitem(
     b'devel',
-    b'serverexactprotocol',
+    b'server-insecure-exact-protocol',
     default=b'',
 )
 coreconfigitem(
--- a/mercurial/error.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/mercurial/error.py	Fri Apr 14 10:41:40 2023 +0200
@@ -155,7 +155,7 @@
     """Exception raised on errors in parsing the command line."""
 
     def __init__(self, command, message):
-        # type: (bytes, bytes) -> None
+        # type: (Optional[bytes], bytes) -> None
         self.command = command
         self.message = message
         super(CommandError, self).__init__()
--- a/mercurial/match.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/mercurial/match.py	Fri Apr 14 10:41:40 2023 +0200
@@ -197,7 +197,7 @@
 
     Usually a patternmatcher is returned:
     >>> _match(b'/foo', b'.', [br're:.*\.c$', b'path:foo/a', b'*.py'])
-    <patternmatcher patterns='.*\\.c$|foo/a(?:/|$)|[^/]*\\.py$'>
+    <patternmatcher patterns='[^/]*\\.py$|foo/a(?:/|$)|.*\\.c$'>
 
     Combining 'patterns' with 'include' (resp. 'exclude') gives an
     intersectionmatcher (resp. a differencematcher):
@@ -614,7 +614,7 @@
     True
 
     >>> m.files()
-    ['', 'foo/a', 'b', '']
+    [b'', b'foo/a', b'', b'b']
     >>> m.exact(b'foo/a')
     True
     >>> m.exact(b'b')
@@ -625,10 +625,16 @@
 
     def __init__(self, root, kindpats, badfn=None):
         super(patternmatcher, self).__init__(badfn)
+        kindpats.sort()
 
         self._files = _explicitfiles(kindpats)
         self._prefix = _prefix(kindpats)
-        self._pats, self.matchfn = _buildmatch(kindpats, b'$', root)
+        self._pats, self._matchfn = _buildmatch(kindpats, b'$', root)
+
+    def matchfn(self, fn):
+        if fn in self._fileset:
+            return True
+        return self._matchfn(fn)
 
     @propertycache
     def _dirs(self):
--- a/mercurial/sslutil.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/mercurial/sslutil.py	Fri Apr 14 10:41:40 2023 +0200
@@ -122,7 +122,7 @@
     if ui.insecureconnections:
         minimumprotocol = b'tls1.0'
         if not ciphers:
-            ciphers = b'DEFAULT'
+            ciphers = b'DEFAULT:@SECLEVEL=0'
 
     s[b'minimumprotocol'] = minimumprotocol
     s[b'ciphers'] = ciphers
@@ -553,7 +553,7 @@
 
         # This config option is intended for use in tests only. It is a giant
         # footgun to kill security. Don't define it.
-        exactprotocol = ui.config(b'devel', b'serverexactprotocol')
+        exactprotocol = ui.config(b'devel', b'server-insecure-exact-protocol')
         if exactprotocol == b'tls1.0':
             if b'tls1.0' not in supportedprotocols:
                 raise error.Abort(_(b'TLS 1.0 not supported by this Python'))
@@ -583,7 +583,8 @@
             sslcontext.maximum_version = ssl.TLSVersion.TLSv1_2
         elif exactprotocol:
             raise error.Abort(
-                _(b'invalid value for serverexactprotocol: %s') % exactprotocol
+                _(b'invalid value for server-insecure-exact-protocol: %s')
+                % exactprotocol
             )
     else:
         # Despite its name, PROTOCOL_SSLv23 selects the highest protocol that both
@@ -594,7 +595,7 @@
 
         # This config option is intended for use in tests only. It is a giant
         # footgun to kill security. Don't define it.
-        exactprotocol = ui.config(b'devel', b'serverexactprotocol')
+        exactprotocol = ui.config(b'devel', b'server-insecure-exact-protocol')
         if exactprotocol == b'tls1.0':
             if b'tls1.0' not in supportedprotocols:
                 raise error.Abort(_(b'TLS 1.0 not supported by this Python'))
@@ -609,7 +610,8 @@
             protocol = ssl.PROTOCOL_TLSv1_2
         elif exactprotocol:
             raise error.Abort(
-                _(b'invalid value for serverexactprotocol: %s') % exactprotocol
+                _(b'invalid value for server-insecure-exact-protocol: %s')
+                % exactprotocol
             )
 
         # We /could/ use create_default_context() here since it doesn't load
@@ -625,7 +627,7 @@
     # In tests, allow insecure ciphers
     # Otherwise, use the list of more secure ciphers if found in the ssl module.
     if exactprotocol:
-        sslcontext.set_ciphers('DEFAULT')
+        sslcontext.set_ciphers('DEFAULT:@SECLEVEL=0')
     elif util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
         sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
         # pytype: disable=module-attr
--- a/relnotes/6.4	Wed Apr 12 00:57:01 2023 +0200
+++ b/relnotes/6.4	Fri Apr 14 10:41:40 2023 +0200
@@ -1,3 +1,16 @@
+= Mercurial 6.4.1 =
+
+ * rhg: fix a bug in path encoding
+ * rhg: don't crash on empty directory names in path_encode, just in case
+ * commands: correct documentation of hg serve’s --ipv6 options
+ * run-tests: remove obsolete coverage check and packaging import (issue6805)
+ * chg: populate CHGHG if not set
+ * match: sort patterns before compiling them into a regex
+ * match: match explicit file using a set
+ * rebase: do not cleanup the working copy when --dry-run is used (issue6802)
+ * sslutil: set context security level for legacy tls testing (issue6760)
+
+
 = Mercurial 6.4 =
 
 == New Features ==
--- a/rust/hg-core/src/revlog/path_encode.rs	Wed Apr 12 00:57:01 2023 +0200
+++ b/rust/hg-core/src/revlog/path_encode.rs	Fri Apr 14 10:41:40 2023 +0200
@@ -545,9 +545,15 @@
             let slice = &slice[..std::cmp::min(slice.len(), dirprefixlen)];
             if dest.len() + slice.len() > maxshortdirslen + 3 {
                 break;
-            } else {
-                dest.write_bytes(slice);
             }
+            if let Some(last_char) = slice.last() {
+                if *last_char == b'.' || *last_char == b' ' {
+                    dest.write_bytes(&slice[0..slice.len() - 1]);
+                    dest.write_byte(b'_');
+                } else {
+                    dest.write_bytes(slice);
+                }
+            };
             dest.write_byte(b'/');
         }
     }
@@ -610,6 +616,17 @@
     use crate::utils::hg_path::HgPathBuf;
 
     #[test]
+    fn test_dirname_ends_with_underscore() {
+        let input = b"data/dir1234.foo/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ.i";
+        let expected = b"dh/dir1234_/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.if2e9ce59e095eff5f8f334dc809e65606a0aa50b.i";
+        let res = path_encode(input);
+        assert_eq!(
+            HgPathBuf::from_bytes(&res),
+            HgPathBuf::from_bytes(expected)
+        );
+    }
+
+    #[test]
     fn test_long_filename_at_root() {
         let input = b"data/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ.i";
         let expected = b"dh/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij.i708243a2237a7afae259ea3545a72a2ef11c247b.i";
--- a/tests/run-tests.py	Wed Apr 12 00:57:01 2023 +0200
+++ b/tests/run-tests.py	Fri Apr 14 10:41:40 2023 +0200
@@ -54,7 +54,6 @@
 import json
 import multiprocessing
 import os
-import packaging.version as version
 import platform
 import queue
 import random
@@ -794,9 +793,7 @@
         try:
             import coverage
 
-            covver = version.Version(coverage.__version__)
-            if covver < version.Version("3.3"):
-                parser.error('coverage options require coverage 3.3 or later')
+            coverage.__version__  # silence unused import warning
         except ImportError:
             parser.error('coverage options now require the coverage package')
 
--- a/tests/test-fileset.t	Wed Apr 12 00:57:01 2023 +0200
+++ b/tests/test-fileset.t	Fri Apr 14 10:41:40 2023 +0200
@@ -53,7 +53,7 @@
       (symbol 'glob')
       (symbol 'b?')))
   * matcher:
-  <patternmatcher patterns='a1(?:/|$)|b.$'>
+  <patternmatcher patterns='b.$|a1(?:/|$)'>
   a1
   b1
   b2
--- a/tests/test-https.t	Wed Apr 12 00:57:01 2023 +0200
+++ b/tests/test-https.t	Fri Apr 14 10:41:40 2023 +0200
@@ -344,21 +344,21 @@
 
   $ cd test
   $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
-  > --config devel.serverexactprotocol=tls1.0
+  > --config devel.server-insecure-exact-protocol=tls1.0
   $ cat ../hg0.pid >> $DAEMON_PIDS
   $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \
-  > --config devel.serverexactprotocol=tls1.1
+  > --config devel.server-insecure-exact-protocol=tls1.1
   $ cat ../hg1.pid >> $DAEMON_PIDS
   $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \
-  > --config devel.serverexactprotocol=tls1.2
+  > --config devel.server-insecure-exact-protocol=tls1.2
   $ cat ../hg2.pid >> $DAEMON_PIDS
   $ cd ..
 
 Clients talking same TLS versions work
 
-  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT/
+  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 --config hostsecurity.ciphers="DEFAULT:@SECLEVEL=0" id https://localhost:$HGPORT/
   5fed3813f7f5
-  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers=DEFAULT id https://localhost:$HGPORT1/
+  $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 --config hostsecurity.ciphers="DEFAULT:@SECLEVEL=0" id https://localhost:$HGPORT1/
   5fed3813f7f5
   $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
   5fed3813f7f5
@@ -400,7 +400,7 @@
 The per-host config option overrides the default
 
   $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
-  > --config hostsecurity.ciphers=DEFAULT \
+  > --config hostsecurity.ciphers="DEFAULT:@SECLEVEL=0" \
   > --config hostsecurity.minimumprotocol=tls1.2 \
   > --config hostsecurity.localhost:minimumprotocol=tls1.0
   5fed3813f7f5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-rebase-dry-run.t	Fri Apr 14 10:41:40 2023 +0200
@@ -0,0 +1,97 @@
+======================
+rebase --dry-run tests
+======================
+
+Test behavior associated with `hg rebase --dry-run`
+
+Setup
+=====
+
+  $ hg init r1
+  $ cd r1
+  $ echo one > f01.txt
+  $ echo two > f02.txt
+  $ echo three > f03.txt
+  $ hg add
+  adding f01.txt
+  adding f02.txt
+  adding f03.txt
+  $ hg ci -m 'ci-1' f01.txt f02.txt f03.txt
+  $ hg book base; hg book -i
+  $ echo add-to-one >> f01.txt
+  $ hg ci -m 'br-1' f01.txt
+  $ hg book branch-1; hg book -i
+  $ hg up base; hg book -i
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (activating bookmark base)
+  $ echo add-to-two >> f02.txt
+  $ hg ci -m 'br-2' f02.txt
+  created new head
+  $ hg book branch-2; hg book -i
+  $ hg up branch-1; hg book -i
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (activating bookmark branch-1)
+  $ hg log -G
+  o  changeset:   2:d408211b0a6f
+  |  bookmark:    branch-2
+  |  tag:         tip
+  |  parent:      0:99418d161ee0
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     br-2
+  |
+  | @  changeset:   1:ab62441498e5
+  |/   bookmark:    branch-1
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    summary:     br-1
+  |
+  o  changeset:   0:99418d161ee0
+     bookmark:    base
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     ci-1
+  
+
+
+Check the working copy changes do not get wiped out
+===================================================
+
+  $ echo add-to-three >> f03.txt
+
+f03 is modified
+
+  $ hg st
+  M f03.txt
+  $ hg diff
+  diff -r ab62441498e5 f03.txt
+  --- a/f03.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/f03.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,2 @@
+   three
+  +add-to-three
+
+
+  $ hg rebase -v -n -s branch-2 -d branch-1 --config extensions.rebase=
+  starting dry-run rebase; repository will not be changed
+  rebasing 2:d408211b0a6f branch-2 tip "br-2"
+  resolving manifests
+  getting f02.txt
+  committing files:
+  f02.txt
+  committing manifest
+  committing changelog
+  rebase merging completed
+  dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase
+
+f03 changes are lost
+
+  $ hg st
+  M f03.txt
+  $ hg diff
+  diff -r ab62441498e5 f03.txt
+  --- a/f03.txt	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/f03.txt	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,2 @@
+   three
+  +add-to-three
--- a/tests/test-transaction-rollback-on-revlog-split.t	Wed Apr 12 00:57:01 2023 +0200
+++ b/tests/test-transaction-rollback-on-revlog-split.t	Fri Apr 14 10:41:40 2023 +0200
@@ -130,7 +130,7 @@
 #else
   $ hg pull ../troffset-computation
   pulling from ../troffset-computation
-  Killed
+  *Killed* (glob)
   [137]
 #endif
 
@@ -210,7 +210,7 @@
   adding changesets
   adding manifests
   adding file changes
-  Killed
+  *Killed* (glob)
   [137]
 #endif
 
@@ -275,7 +275,7 @@
   adding changesets
   adding manifests
   adding file changes
-  Killed
+  *Killed* (glob)
   [137]
 #endif
 
--- a/tests/test-walk.t	Wed Apr 12 00:57:01 2023 +0200
+++ b/tests/test-walk.t	Fri Apr 14 10:41:40 2023 +0200
@@ -536,7 +536,7 @@
   f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
   $ hg debugwalk -v beans 'glob:beans/*'
   * matcher:
-  <patternmatcher patterns='beans(?:/|$)|beans/[^/]*$'>
+  <patternmatcher patterns='beans/[^/]*$|beans(?:/|$)'>
   f  beans/black     beans/black
   f  beans/borlotti  beans/borlotti
   f  beans/kidney    beans/kidney