From b28e3b765152f5f7a002acf220337eb9fcd49d0c Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 24 Jul 2023 09:15:06 +0100
Subject: [PATCH] Issue #3364646 by dww, catch, longwave: Add a branch alias
 for 11.x

---
 composer.json                                          |  3 +++
 composer.lock                                          |  2 +-
 composer/Metapackage/CoreRecommended/composer.json     |  2 +-
 .../Metapackage/PinnedDevDependencies/composer.json    |  2 +-
 composer/Template/LegacyProject/composer.json          | 10 +++++-----
 composer/Template/RecommendedProject/composer.json     |  8 ++++----
 core/lib/Drupal.php                                    |  2 +-
 core/lib/Drupal/Component/Annotation/composer.json     |  6 +++---
 core/lib/Drupal/Component/Datetime/composer.json       |  2 +-
 core/lib/Drupal/Component/Discovery/composer.json      |  4 ++--
 core/lib/Drupal/Component/FrontMatter/composer.json    |  2 +-
 core/lib/Drupal/Component/Gettext/composer.json        |  2 +-
 core/lib/Drupal/Component/PhpStorage/composer.json     |  2 +-
 core/lib/Drupal/Component/Render/composer.json         |  2 +-
 .../Composer/Component/ComponentsIsolatedBuildTest.php | 10 ++++------
 15 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/composer.json b/composer.json
index 7c2fca0449fa..992fa1d61888 100644
--- a/composer.json
+++ b/composer.json
@@ -68,6 +68,9 @@
         }
     },
     "extra": {
+        "branch-alias": {
+          "dev-11.x": "10.2.x-dev"
+        },
         "_readme": [
             "By default Drupal loads the autoloader from ./vendor/autoload.php.",
             "To change the autoloader you can edit ./autoload.php.",
diff --git a/composer.lock b/composer.lock
index 1d37f0276579..2ee08416faca 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "e98db90afbd0b05e99c667319f2f2eba",
+    "content-hash": "d5d9a4f206c270584532c37f9ec140fc",
     "packages": [
         {
             "name": "asm89/stack-cors",
diff --git a/composer/Metapackage/CoreRecommended/composer.json b/composer/Metapackage/CoreRecommended/composer.json
index 6e33b9eeeb7d..901b6565a084 100644
--- a/composer/Metapackage/CoreRecommended/composer.json
+++ b/composer/Metapackage/CoreRecommended/composer.json
@@ -7,7 +7,7 @@
         "webflo/drupal-core-strict": "*"
     },
     "require": {
-        "drupal/core": "11.x-dev",
+        "drupal/core": "10.2.x-dev",
         "asm89/stack-cors": "~v2.1.1",
         "composer/semver": "~3.3.2",
         "doctrine/annotations": "~1.14.3",
diff --git a/composer/Metapackage/PinnedDevDependencies/composer.json b/composer/Metapackage/PinnedDevDependencies/composer.json
index 4b3c3ec5e00a..4c1f9f4f2c8f 100644
--- a/composer/Metapackage/PinnedDevDependencies/composer.json
+++ b/composer/Metapackage/PinnedDevDependencies/composer.json
@@ -7,7 +7,7 @@
         "webflo/drupal-core-require-dev": "*"
     },
     "require": {
-        "drupal/core": "11.x-dev",
+        "drupal/core": "10.2.x-dev",
         "behat/mink": "v1.10.0",
         "behat/mink-browserkit-driver": "v2.1.0",
         "behat/mink-selenium2-driver": "v1.6.0",
diff --git a/composer/Template/LegacyProject/composer.json b/composer/Template/LegacyProject/composer.json
index 204d1dcba1eb..a8fceccd0dd2 100644
--- a/composer/Template/LegacyProject/composer.json
+++ b/composer/Template/LegacyProject/composer.json
@@ -16,13 +16,13 @@
     ],
     "require": {
         "composer/installers": "^2.0",
-        "drupal/core-composer-scaffold": "^11",
-        "drupal/core-project-message": "^11",
-        "drupal/core-recommended": "^11",
-        "drupal/core-vendor-hardening": "^11"
+        "drupal/core-composer-scaffold": "^10.2",
+        "drupal/core-project-message": "^10.2",
+        "drupal/core-recommended": "^10.2",
+        "drupal/core-vendor-hardening": "^10.2"
     },
     "require-dev": {
-        "drupal/core-dev": "^11"
+        "drupal/core-dev": "^10.2"
     },
     "conflict": {
         "drupal/drupal": "*"
diff --git a/composer/Template/RecommendedProject/composer.json b/composer/Template/RecommendedProject/composer.json
index 0b4926dabfda..56d98de870fd 100644
--- a/composer/Template/RecommendedProject/composer.json
+++ b/composer/Template/RecommendedProject/composer.json
@@ -16,12 +16,12 @@
     ],
     "require": {
         "composer/installers": "^2.0",
-        "drupal/core-composer-scaffold": "^11",
-        "drupal/core-project-message": "^11",
-        "drupal/core-recommended": "^11"
+        "drupal/core-composer-scaffold": "^10.2",
+        "drupal/core-project-message": "^10.2",
+        "drupal/core-recommended": "^10.2"
     },
     "require-dev": {
-        "drupal/core-dev": "^11"
+        "drupal/core-dev": "^10.2"
     },
     "conflict": {
         "drupal/drupal": "*"
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index cb51a509fcee..33b94192a2b4 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -75,7 +75,7 @@ class Drupal {
   /**
    * The current system version.
    */
-  const VERSION = '11.0-dev';
+  const VERSION = '10.2.0-dev';
 
   /**
    * Core API compatibility.
diff --git a/core/lib/Drupal/Component/Annotation/composer.json b/core/lib/Drupal/Component/Annotation/composer.json
index feabe9279fe0..a755e8f04867 100644
--- a/core/lib/Drupal/Component/Annotation/composer.json
+++ b/core/lib/Drupal/Component/Annotation/composer.json
@@ -9,9 +9,9 @@
     "require": {
         "php": ">=8.1.0",
         "doctrine/annotations": "^1.14",
-        "drupal/core-file-cache": "11.x-dev",
-        "drupal/core-plugin": "11.x-dev",
-        "drupal/core-utility": "11.x-dev"
+        "drupal/core-file-cache": "10.2.x-dev",
+        "drupal/core-plugin": "10.2.x-dev",
+        "drupal/core-utility": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/Datetime/composer.json b/core/lib/Drupal/Component/Datetime/composer.json
index 91bd608f5570..7a16ab9e344f 100644
--- a/core/lib/Drupal/Component/Datetime/composer.json
+++ b/core/lib/Drupal/Component/Datetime/composer.json
@@ -8,7 +8,7 @@
     "license": "GPL-2.0-or-later",
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-utility": "11.x-dev"
+        "drupal/core-utility": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/Discovery/composer.json b/core/lib/Drupal/Component/Discovery/composer.json
index 4a9343967682..c0800a842b7c 100644
--- a/core/lib/Drupal/Component/Discovery/composer.json
+++ b/core/lib/Drupal/Component/Discovery/composer.json
@@ -8,8 +8,8 @@
     "license": "GPL-2.0-or-later",
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-file-cache": "11.x-dev",
-        "drupal/core-serialization": "11.x-dev"
+        "drupal/core-file-cache": "10.2.x-dev",
+        "drupal/core-serialization": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/FrontMatter/composer.json b/core/lib/Drupal/Component/FrontMatter/composer.json
index 9baa12c9d92d..ac246ae49b15 100644
--- a/core/lib/Drupal/Component/FrontMatter/composer.json
+++ b/core/lib/Drupal/Component/FrontMatter/composer.json
@@ -8,7 +8,7 @@
     "license": "GPL-2.0-or-later",
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-serialization": "11.x-dev"
+        "drupal/core-serialization": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/Gettext/composer.json b/core/lib/Drupal/Component/Gettext/composer.json
index 0db3a4bc30b6..8893295f5fb0 100644
--- a/core/lib/Drupal/Component/Gettext/composer.json
+++ b/core/lib/Drupal/Component/Gettext/composer.json
@@ -9,7 +9,7 @@
     },
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-render": "11.x-dev"
+        "drupal/core-render": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/PhpStorage/composer.json b/core/lib/Drupal/Component/PhpStorage/composer.json
index 0517f06b0e35..29466cafd95c 100644
--- a/core/lib/Drupal/Component/PhpStorage/composer.json
+++ b/core/lib/Drupal/Component/PhpStorage/composer.json
@@ -8,7 +8,7 @@
     "license": "GPL-2.0-or-later",
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-file-security": "11.x-dev"
+        "drupal/core-file-security": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/lib/Drupal/Component/Render/composer.json b/core/lib/Drupal/Component/Render/composer.json
index 338eb5135b2b..fd01afa0b255 100644
--- a/core/lib/Drupal/Component/Render/composer.json
+++ b/core/lib/Drupal/Component/Render/composer.json
@@ -8,7 +8,7 @@
     "license": "GPL-2.0-or-later",
     "require": {
         "php": ">=8.1.0",
-        "drupal/core-utility": "11.x-dev"
+        "drupal/core-utility": "10.2.x-dev"
     },
     "autoload": {
         "psr-4": {
diff --git a/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php b/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
index 85b5570fbacb..7059c90b529b 100644
--- a/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
+++ b/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
@@ -66,12 +66,10 @@ public function testComponentComposerJson(string $component_path): void {
    *   The working directory.
    */
   protected function addExpectedRepositories(string $working_dir): void {
-    $repo_paths = [
-      'Render' => 'drupal/core-render',
-      'Utility' => 'drupal/core-utility',
-    ];
-    foreach ($repo_paths as $path => $package_name) {
-      $path_repo = $this->getWorkingPath() . static::$componentsPath . '/' . $path;
+    foreach ($this->provideComponentPaths() as $path) {
+      $path = $path[0];
+      $package_name = 'drupal/core' . strtolower(preg_replace('/[A-Z]/', '-$0', substr($path, 1)));
+      $path_repo = $this->getWorkingPath() . static::$componentsPath . $path;
       $repo_name = strtolower($path);
       // Add path repositories with the current version number to the current
       // package under test.
-- 
GitLab