|
94 | 94 | $force_local = $args->getArg('force-local');
|
95 | 95 | $min_date = $args->getArg('min-date');
|
96 | 96 |
|
97 |
| -if (count($reparse_what) > 1 || !($all_from_repo xor count($reparse_what))) { |
| 97 | +if (!$all_from_repo && !$reparse_what) { |
98 | 98 | usage("Specify a commit or repository to reparse.");
|
99 | 99 | }
|
100 | 100 |
|
101 |
| -if ($args->getArg('trace')) { |
102 |
| - PhutilServiceProfiler::installEchoListener(); |
103 |
| -} |
104 |
| - |
105 | 101 | if (!$reparse_message && !$reparse_change && !$reparse_herald &&
|
106 | 102 | !$reparse_owners) {
|
107 | 103 | usage("Specify what information to reparse with --message, --change, ".
|
|
146 | 142 | }
|
147 | 143 | $callsign = $repository->getCallsign();
|
148 | 144 | } else {
|
149 |
| - $matches = null; |
150 |
| - if (!preg_match('/r([A-Z]+)([a-z0-9]+)/', $reparse_what, $matches)) { |
151 |
| - throw new Exception("Can't parse commit identifier!"); |
152 |
| - } |
153 |
| - $callsign = $matches[1]; |
154 |
| - $commit_identifier = $matches[2]; |
155 |
| - $repository = id(new PhabricatorRepository())->loadOneWhere( |
156 |
| - 'callsign = %s', |
157 |
| - $callsign); |
158 |
| - if (!$repository) { |
159 |
| - throw new Exception("No repository with callsign '{$callsign}'!"); |
160 |
| - } |
161 |
| - $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( |
162 |
| - 'repositoryID = %d AND commitIdentifier = %s', |
163 |
| - $repository->getID(), |
164 |
| - $commit_identifier); |
165 |
| - if (!$commit) { |
166 |
| - throw new Exception( |
167 |
| - "No matching commit '{$commit_identifier}' in repository '{$callsign}'. ". |
168 |
| - "(For git and mercurial repositories, you must specify the entire ". |
169 |
| - "commit hash.)"); |
| 145 | + $commits = array(); |
| 146 | + foreach ($reparse_what as $identifier) { |
| 147 | + $matches = null; |
| 148 | + if (!preg_match('/r([A-Z]+)([a-z0-9]+)/', $identifier, $matches)) { |
| 149 | + throw new Exception("Can't parse commit identifier!"); |
| 150 | + } |
| 151 | + $callsign = $matches[1]; |
| 152 | + $commit_identifier = $matches[2]; |
| 153 | + $repository = id(new PhabricatorRepository())->loadOneWhere( |
| 154 | + 'callsign = %s', |
| 155 | + $callsign); |
| 156 | + if (!$repository) { |
| 157 | + throw new Exception("No repository with callsign '{$callsign}'!"); |
| 158 | + } |
| 159 | + $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( |
| 160 | + 'repositoryID = %d AND commitIdentifier = %s', |
| 161 | + $repository->getID(), |
| 162 | + $commit_identifier); |
| 163 | + if (!$commit) { |
| 164 | + throw new Exception( |
| 165 | + "No matching commit '{$commit_identifier}' in repository ". |
| 166 | + "'{$callsign}'. (For git and mercurial repositories, you must specify ". |
| 167 | + "the entire commit hash.)"); |
| 168 | + } |
| 169 | + $commits[] = $commit; |
170 | 170 | }
|
171 |
| - $commits = array($commit); |
172 | 171 | }
|
173 | 172 |
|
174 | 173 | if ($all_from_repo && !$force_local) {
|
|
0 commit comments