Commit: 9c54157ce5bcc8e2a414014ddd234efedd8d135c Author: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Committer: Alexander Moskaliov(ir...@php.net) Tue, 20 Mar 2012 11:31:31 +0400 Parents: 42d233ae4752adbce2709553cef0cd456b92a2e0
Link: http://git.php.net/?p=karma.git;a=commitdiff;h=9c54157ce5bcc8e2a414014ddd234efedd8d135c Log: Remove not used methods This methods was moved to bugsweb class early Changed paths: M lib/Git/PostReceiveHook.php Diff: 9c54157ce5bcc8e2a414014ddd234efedd8d135c diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index bd3be9b..da755f4 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -39,70 +39,6 @@ class PostReceiveHook extends ReceiveHook $this->allBranches = $this->getAllBranches(); } - - public function getReceivedMessages() - { - $this->hookInput(); - - $paths = array_map( - function ($input) { - return $this->getReceivedMessagesForRange($input['old'], $input['new']); - }, - $this->refs); - - /* remove empty lines, and flattern the array */ - $flattend = array_reduce($paths, 'array_merge', []); - $paths = array_filter($flattend); - - return array_unique($paths); - } - - /** - * Returns an array of commit messages between revision $old and $new. - * - * @param string $old The old revison number. - * @parma string $new The new revison umber. - * - * @return array - */ - private function getReceivedMessagesForRange($old, $new) - { - $repourl = \Git::getRepositoryPath(); - $output = []; - - if ($old == '0000000000000000000000000000000000000000') { - $cmd = sprintf( - "%s --git-dir=%s for-each-ref --format='%%(refname)' 'refs/heads/*'", - self::GIT_EXECUTABLE, - $repourl - ); - exec($cmd, $output); - - /* do we have heads? otherwise it's a new repo! */ - $heads = implode(' ', $output); - $not = count($output) > 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; - $cmd = sprintf( - '%s --git-dir=%s log --pretty=format:"[%%ae] %%H %%s" %s %s', - \Git::GIT_EXECUTABLE, - $repourl, - $not, - escapeshellarg($new) - ); - exec($cmd, $output); - } else { - $cmd = sprintf( - '%s --git-dir=%s log --pretty=format:"[%%ae] %%H %%s" %s..%s', - \Git::GIT_EXECUTABLE, - $repourl, - escapeshellarg($old), - escapeshellarg($new) - ); - exec($cmd, $output); - } - - return $output; - } - /** * Find user name by nickname in users data file * @param string $user user nickname @@ -225,9 +161,6 @@ class PostReceiveHook extends ReceiveHook } } - - - $mail = new \Mail(); $mail->setSubject($this->emailPrefix . ' branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php