Skip to content

Commit

Permalink
Rename getChangelog() to getChangelogLink().
Browse files Browse the repository at this point in the history
This is what it does, and the old name was confusing.
  • Loading branch information
yunosh committed Dec 4, 2017
1 parent 860733e commit e693453
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion data/distribute/openSUSE/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ function processDependencies($component) {
}
// build a text containing only the last change. Use dash instead of *

$changes = "updated to version $package_version\n- [xxx] something changed\n- [yyy] This changed too" . $component->getChangelog(new Components_Helper_ChangeLog($this->_output, $this->_config));
$changes = "updated to version $package_version\n- [xxx] something changed\n- [yyy] This changed too" . $component->getChangelogLink();
//$changes = $component->getInstallationFileList();
shell_exec("cd $destination && mv package.spec $package_name.spec && osc vc -m \"$changes\" &> file");
6 changes: 2 additions & 4 deletions lib/Components/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ public function hasLocalPackageXml();
/**
* Returns the link to the change log.
*
* @param Components_Helper_ChangeLog $helper The change log helper.
*
* @return string|null The link to the change log.
* @return string The link to the change log.
*/
public function getChangelog($helper);
public function getChangelogLink();

/**
* Return the path to the release notes.
Expand Down
6 changes: 2 additions & 4 deletions lib/Components/Component/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,9 @@ public function hasLocalPackageXml()
/**
* Returns the link to the change log.
*
* @param Components_Helper_ChangeLog $helper The change log helper.
*
* @return string|null The link to the change log.
* @return string The link to the change log.
*/
public function getChangelog($helper)
public function getChangelogLink()
{
throw new Components_Exception('Not supported!');
}
Expand Down
8 changes: 3 additions & 5 deletions lib/Components/Component/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,12 @@ public function hasLocalPackageXml()
/**
* Returns the link to the change log.
*
* @param Components_Helper_ChangeLog $helper The change log helper.
*
* @return string|null The link to the change log.
* @return string The link to the change log.
*/
public function getChangelog($helper)
public function getChangelogLink()
{
$base = $this->getFactory()->getGitRoot()->getRoot();
return $helper->getChangelog(
return $this->getFactory()->createChangelog($this)->getChangelogLink(
preg_replace(
'#^' . $base . '#', '', $this->_directory
)
Expand Down
2 changes: 1 addition & 1 deletion lib/Components/Helper/ChangeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public function changes($log, $options)
*
* @return string The link to the change log.
*/
public function getChangelog($root)
public function getChangelogLink($root)
{
if ($changes = $this->changesFileExists()) {
$hordeInfo = $this->_getHordeInfo();
Expand Down
7 changes: 1 addition & 6 deletions lib/Components/Release/Task/Announce.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,7 @@ public function run(&$options)
$mailer->append("\n\n" .
'The full list of changes can be viewed here:' .
"\n\n" .
$this->getComponent()->getChangelog(
new Components_Helper_ChangeLog(
$this->getOutput(),
$this->getComponent()->getConfig()
)
) .
$this->getComponent()->getChangelogLink() .
"\n\n" .
'Have fun!' .
"\n\n" .
Expand Down

0 comments on commit e693453

Please sign in to comment.