Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14708043
D7470.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D7470.diff
View Options
Index: src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
===================================================================
--- src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
+++ src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
@@ -9,6 +9,31 @@
return 60 * 60 * 24;
}
+ abstract protected function parseCommitChanges(
+ PhabricatorRepository $repository,
+ PhabricatorRepositoryCommit $commit);
+
+ protected function parseCommit(
+ PhabricatorRepository $repository,
+ PhabricatorRepositoryCommit $commit) {
+
+ $identifier = $commit->getCommitIdentifier();
+ $callsign = $repository->getCallsign();
+ $full_name = 'r'.$callsign.$identifier;
+
+ $this->log("Parsing %s...\n", $full_name);
+ if ($this->isBadCommit($full_name)) {
+ $this->log("This commit is marked bad!");
+ $result = null;
+ } else {
+ $result = $this->parseCommitChanges($repository, $commit);
+ }
+
+ $this->finishParse();
+
+ return $result;
+ }
+
public static function lookupOrCreatePaths(array $paths) {
$repository = new PhabricatorRepository();
$conn_w = $repository->establishConnection('w');
Index: src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
===================================================================
--- src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
+++ src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
@@ -3,17 +3,10 @@
final class PhabricatorRepositoryGitCommitChangeParserWorker
extends PhabricatorRepositoryCommitChangeParserWorker {
- protected function parseCommit(
+ protected function parseCommitChanges(
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
- $full_name = 'r'.$repository->getCallsign().$commit->getCommitIdentifier();
- echo "Parsing {$full_name}...\n";
- if ($this->isBadCommit($full_name)) {
- echo "This commit is marked bad!\n";
- return;
- }
-
// Check if the commit has parents. We're testing to see whether it is the
// first commit in history (in which case we must use "git log") or some
// other commit (in which case we can use "git diff"). We'd rather use
@@ -272,8 +265,6 @@
PhabricatorRepository::TABLE_PATHCHANGE,
implode(', ', $sql_chunk));
}
-
- $this->finishParse();
}
}
Index: src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php
===================================================================
--- src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php
+++ src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryMercurialCommitChangeParserWorker.php
@@ -3,17 +3,10 @@
final class PhabricatorRepositoryMercurialCommitChangeParserWorker
extends PhabricatorRepositoryCommitChangeParserWorker {
- protected function parseCommit(
+ protected function parseCommitChanges(
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
- $full_name = 'r'.$repository->getCallsign().$commit->getCommitIdentifier();
- echo "Parsing {$full_name}...\n";
- if ($this->isBadCommit($full_name)) {
- echo "This commit is marked bad!\n";
- return;
- }
-
list($stdout) = $repository->execxLocalCommand(
'status -C --change %s',
$commit->getCommitIdentifier());
@@ -307,8 +300,6 @@
PhabricatorRepository::TABLE_PATHCHANGE,
implode(', ', $sql_chunk));
}
-
- $this->finishParse();
}
private function mercurialPathExists(
Index: src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
===================================================================
--- src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
+++ src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
@@ -3,7 +3,7 @@
final class PhabricatorRepositorySvnCommitChangeParserWorker
extends PhabricatorRepositoryCommitChangeParserWorker {
- protected function parseCommit(
+ protected function parseCommitChanges(
PhabricatorRepository $repository,
PhabricatorRepositoryCommit $commit) {
@@ -27,15 +27,6 @@
$uri = $repository->getDetail('remote-uri');
$svn_commit = $commit->getCommitIdentifier();
- $callsign = $repository->getCallsign();
- $full_name = 'r'.$callsign.$svn_commit;
- echo "Parsing {$full_name}...\n";
-
- if ($this->isBadCommit($full_name)) {
- echo "This commit is marked bad!\n";
- return;
- }
-
// Pull the top-level path changes out of "svn log". This is pretty
// straightforward; just parse the XML log.
$log = $this->getSVNLogXMLObject($uri, $svn_commit, $verbose = true);
@@ -368,8 +359,6 @@
$this->writeChanges($repository, $commit, $effects, $path_map, $commit_map);
$this->writeBrowse($repository, $commit, $effects, $path_map);
-
- $this->finishParse();
}
private function writeChanges(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 8:24 AM (12 h, 51 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7000768
Default Alt Text
D7470.diff (5 KB)
Attached To
Mode
D7470: Mark IMPORTED_CHANGE more consistently
Attached
Detach File
Event Timeline
Log In to Comment