@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow `bin/storage renamespace` to work with underscores

If the namespace is something like "test_example" we currently fail to
renamespace the dump.

(Cowboy committing this since this is currently blocking a data export.)

Test Plan:

- Renamespaced a local dump, examined the output, saw 60 create / 60 use, reimported it.
- Will export in production.

Auditors: chad

+4 -12
+4 -12
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
··· 138 138 $output_name)); 139 139 } 140 140 141 + $name_pattern = preg_quote($from, '@'); 142 + 141 143 $patterns = array( 142 - 'use' => '@^(USE `)([^_]+)(_.*)$@', 143 - 'create' => '@^(CREATE DATABASE /\*.*?\*/ `)([^_]+)(_.*)$@', 144 + 'use' => '@^(USE `)('.$name_pattern.')(_.*)$@', 145 + 'create' => '@^(CREATE DATABASE /\*.*?\*/ `)('.$name_pattern.')(_.*)$@', 144 146 ); 145 147 146 148 $found = array_fill_keys(array_keys($patterns), 0); ··· 151 153 152 154 foreach ($patterns as $key => $pattern) { 153 155 if (preg_match($pattern, $line, $matches)) { 154 - $namespace = $matches[2]; 155 - if ($namespace != $from) { 156 - throw new Exception( 157 - pht( 158 - 'Expected namespace "%s", found "%s": %s.', 159 - $from, 160 - $namespace, 161 - $line)); 162 - } 163 - 164 156 $line = $matches[1].$to.$matches[3]; 165 157 $found[$key]++; 166 158 }