Index: trunk/tools/make-wmf-branch/make-wmf-branch |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | if ( count( $argv ) < 3 ) { |
11 | 11 | echo "Usage: make-wmf-branch <new-version> <old-version>\n"; |
12 | | - echo "Example: make-wmf-branch 1.16wmf4 1.16wmf3\n"; |
| 12 | + echo "Example: make-wmf-branch 1.20r1 1.20r2\n"; |
13 | 13 | exit( 1 ); |
14 | 14 | } |
15 | 15 | |
— | — | @@ -20,31 +20,28 @@ |
21 | 21 | |
22 | 22 | class MakeWmfBranch { |
23 | 23 | var $dryRun; |
24 | | - var $newVersion, $oldVersion, $codeDir, $buildDir; |
| 24 | + var $newVersion, $oldVersion, $buildDir; |
25 | 25 | var $normalExtensions, $specialExtensions, $patches, $preservedItems; |
26 | | - var $destBaseUrl, $mainSourceUrl; |
27 | | - var $unwantedExternals; |
| 26 | + var $baseRepoPath; |
28 | 27 | |
29 | 28 | function __construct( $newVersion, $oldVersion ) { |
30 | 29 | $this->newVersion = $newVersion; |
31 | 30 | $this->oldVersion = $oldVersion; |
32 | | - $this->codeDir = dirname( __FILE__ ); |
| 31 | + $codeDir = dirname( __FILE__ ); |
33 | 32 | $buildDir = sys_get_temp_dir() . '/make-wmf-branch'; |
34 | 33 | |
35 | | - require( "{$this->codeDir}/default.conf" ); |
36 | | - if ( file_exists( "{$this->codeDir}/local.conf" ) ) { |
37 | | - require( "{$this->codeDir}/local.conf" ); |
| 34 | + require( "{$codeDir}/default.conf" ); |
| 35 | + if ( file_exists( "{$codeDir}/local.conf" ) ) { |
| 36 | + require( "{$codeDir}/local.conf" ); |
38 | 37 | } |
39 | 38 | |
40 | 39 | $this->dryRun = $dryRun; |
41 | 40 | $this->buildDir = $buildDir; |
42 | 41 | $this->normalExtensions = $normalExtensions; |
43 | 42 | $this->specialExtensions = $specialExtensions; |
44 | | - $this->unwantedExternals = $unwantedExternals; |
45 | 43 | $this->patches = $patches; |
46 | 44 | $this->preservedItems = $preservedItems; |
47 | | - $this->destBaseUrl = $destBaseUrl; |
48 | | - $this->mainSourceUrl = $mainSourceUrl; |
| 45 | + $this->baseRepoPath = $baseRepoPath; |
49 | 46 | } |
50 | 47 | |
51 | 48 | function runCmd( /*...*/ ) { |
— | — | @@ -91,59 +88,50 @@ |
92 | 89 | } |
93 | 90 | $this->chdir( $this->buildDir ); |
94 | 91 | |
95 | | - # Check out the parent directory of the target branch |
96 | | - $this->runCmd( 'svn', 'co', '--depth=empty', '--quiet', $this->destBaseUrl, 'wmf' ); |
| 92 | + # Clone the repository |
| 93 | + $this->runCmd( 'git', 'clone', '-q', "{$this->baseRepoPath}/core.git", 'wmf' ); |
97 | 94 | |
98 | 95 | $this->chdir( 'wmf' ); |
99 | 96 | |
100 | | - # Copy in phase3 |
101 | | - $destRel = $this->newVersion; |
102 | | - $this->runCmd( 'svn', 'cp', '--quiet', "{$this->mainSourceUrl}/phase3", $destRel ); |
| 97 | + # Create a new branch from master and switch to it |
| 98 | + $this->runCmd( 'git', 'checkout', '-q', '-b', "wmf/{$this->newVersion}" ); |
103 | 99 | |
| 100 | + # Delete extensions/README and extensions/.gitignore |
| 101 | + $this->runWriteCmd( 'git', 'rm', '-q', "extensions/README", "extensions/.gitignore" ); |
104 | 102 | |
105 | | - # Delete extensions/README |
106 | | - $this->runCmd( 'svn', 'rm', '--quiet', "$destRel/extensions/README" ); |
107 | | - |
108 | | - # Add normal extensions |
| 103 | + # Add normal extension submodules |
109 | 104 | foreach ( $this->normalExtensions as $name ) { |
110 | | - $this->runCmd( 'svn', 'cp', '--ignore-externals', '--quiet', |
111 | | - "{$this->mainSourceUrl}/extensions/$name", |
112 | | - "$destRel/extensions/$name" ); |
| 105 | + $this->runWriteCmd( 'git', 'submodule', 'add', '-q', |
| 106 | + "{$this->baseRepoPath}/extensions/{$name}.git", "extensions/$name" ); |
113 | 107 | } |
114 | 108 | |
115 | | - # Add special extensions |
| 109 | + # Add special extensions - TODO/FIXME |
116 | 110 | foreach ( $this->specialExtensions as $name => $sourceUrl ) { |
117 | | - $this->runCmd( 'svn', 'cp', '--ignore-externals', '--quiet', |
118 | | - $sourceUrl, |
119 | | - "$destRel/extensions/$name" ); |
| 111 | + // $this->runCmd( 'svn', 'cp', '--ignore-externals', '--quiet', $baseRepoPath, |
| 112 | + // "extensions/$name" ); |
120 | 113 | } |
121 | 114 | |
122 | | - # Copy in preserved items |
| 115 | + # Copy in preserved items - TODO/FIXME |
123 | 116 | foreach ( $this->preservedItems as $item ) { |
124 | | - $this->runCmd( 'svn', 'cp', '--quiet', |
125 | | - "{$this->destBaseUrl}/{$this->oldVersion}/$item", |
126 | | - dirname( "$destRel/$item" ) ); |
| 117 | + //$this->runCmd( 'svn', 'cp', '--quiet', |
| 118 | + // "{$this->destBaseUrl}/{$this->oldVersion}/$item", |
| 119 | + // dirname( "$item" ) ); |
127 | 120 | } |
128 | 121 | |
129 | 122 | # Do intermediate commit |
130 | | - $this->runWriteCmd( 'svn', 'ci', '-q', '-m', "Creating new WMF {$this->newVersion} branch" ); |
| 123 | + $this->runWriteCmd( 'git', 'commit', '-a', '-q', '-m', "Creating new WMF {$this->newVersion} branch" ); |
131 | 124 | |
132 | 125 | # Fix $wgVersion |
133 | | - $this->fixVersion( "$destRel/includes/DefaultSettings.php" ); |
| 126 | + $this->fixVersion( "includes/DefaultSettings.php" ); |
134 | 127 | |
135 | | - # Apply patches |
| 128 | + # Apply patches - TODO/FIXME |
136 | 129 | foreach ( $this->patches as $patch ) { |
137 | | - $this->runCmd( 'svn', 'merge', '-q', '-c', $patch['rev'], $patch['base'], $destRel ); |
| 130 | + // $this->runCmd( 'svn', 'merge', '-q', '-c', $patch['rev'], $patch['base'], $destRel ); |
138 | 131 | } |
139 | 132 | |
140 | | - # Remove unwanted externals |
141 | | - foreach ( $this->unwantedExternals as $external ) { |
142 | | - $this->runCmd( 'svn', 'propdel', '-q', 'svn:externals', "$destRel/$external" ); |
143 | | - } |
144 | | - |
145 | 133 | # Do the final commit |
146 | | - $this->runWriteCmd( 'svn', 'ci', '-q', '-m', |
147 | | - "Applied local patches for new WMF {$this->newVersion} branch" ); |
| 134 | + $this->runWriteCmd( 'git', 'commit', '-a', '-m', '-q', |
| 135 | + "Applied patches to new WMF {$this->newVersion} branch" ); |
148 | 136 | } |
149 | 137 | |
150 | 138 | function fixVersion( $fileName ) { |
Index: trunk/tools/make-wmf-branch/default.conf |
— | — | @@ -3,6 +3,7 @@ |
4 | 4 | # You can override variables in this file by creating a file in the same |
5 | 5 | # directory called local.conf |
6 | 6 | |
| 7 | +# These extensions are all pulling from HEAD on master |
7 | 8 | $normalExtensions = array( |
8 | 9 | 'AbuseFilter', |
9 | 10 | 'ActiveAbstract', // Used as part of dumpBackup |
— | — | @@ -10,6 +11,7 @@ |
11 | 12 | 'AntiSpoof', |
12 | 13 | 'ApiSandbox', |
13 | 14 | 'ArticleFeedback', |
| 15 | + 'ArticleFeedbackv5', |
14 | 16 | 'AssertEdit', |
15 | 17 | 'Babel', |
16 | 18 | 'CategoryTree', |
— | — | @@ -120,31 +122,20 @@ |
121 | 123 | 'ZeroRatedMobileAccess', |
122 | 124 | ); |
123 | 125 | |
124 | | -# Extensions that we don't want to pull directly from the target branch |
| 126 | +# Extensions extensions that we want to copy their status from the previous branch |
125 | 127 | $specialExtensions = array( |
126 | | - 'ArticleFeedbackv5' => '^/branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5', |
| 128 | + # 'ArticleFeedbackv5', |
127 | 129 | ); |
128 | 130 | |
| 131 | +# These items are copied from the old branch to the new one |
129 | 132 | $preservedItems = array( |
130 | 133 | 'StartProfiler.php', |
131 | | - 'extensions/FlaggedRevs/maintenance/wikimedia-periodic-update.sh', |
132 | 134 | ); |
133 | 135 | |
134 | | -$unwantedExternals = array( |
135 | | - 'extensions/SyntaxHighlight_GeSHi', |
136 | | -); |
| 136 | +$baseRepoPath = 'ssh://gerrit.wikimedia.org:29418/mediawiki'; |
137 | 137 | |
138 | | -$destBaseUrl = 'svn+ssh://svn.wikimedia.org/svnroot/mediawiki/branches/wmf'; |
139 | | -$mainSourceUrl = '^/branches/REL1_19'; |
140 | 138 | $patches = array( |
141 | | - array( 'rev' => 97505, 'base' => '^/branches/wmf/1.18wmf1' ), |
142 | | - array( 'rev' => 97508, 'base' => '^/branches/wmf/1.18wmf1' ), // r96552 part merged to trunk |
143 | | - array( 'rev' => 97509, 'base' => '^/branches/wmf/1.18wmf1' ), |
144 | | - array( 'rev' => 97512, 'base' => '^/branches/wmf/1.18wmf1' ), |
145 | | - array( 'rev' => 99928, 'base' => '^/branches/wmf/1.18wmf1' ), |
146 | | - |
147 | | - //array( 'rev' => 111194, 'base' => '^/branches/wmf/1.19wmf1' ), |
148 | | - array( 'rev' => 112080, 'base' => '^/branches/wmf/1.19wmf1' ), |
| 139 | + # array( 'rev' => 97505, 'base' => '^/branches/wmf/1.18wmf1' ), |
149 | 140 | ); |
150 | 141 | |
151 | 142 | $dryRun = false; |