Skip to content

Commit

Permalink
Only update changelog.yml when running the 'changed' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Schneider committed Jan 2, 2019
1 parent 352114c commit 067393e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 72 deletions.
48 changes: 0 additions & 48 deletions lib/Components/Component/Source.php
Expand Up @@ -679,54 +679,6 @@ public function changed($log, $options)
}
}

// Update package.xml
if (empty($options['nopackage'])) {
$xml = $this->getPackageXml();
if ($helper->changelogFileExists()) {
$file = $helper->updatePackage($xml);
if (empty($options['pretend'])) {
$xml->save();
$output[] = sprintf('Updated %s.', $xml->getFileName());
} else {
$output[] = sprintf('Would update %s now.', $xml->getFileName());
}
} else {
$file = $helper->packageXml($log, $xml);
if (empty($options['pretend'])) {
$xml->save();
$output[] = sprintf(
'Added new note to version %s of %s.',
$xml->getVersion(),
$xml->getFileName()
);
} else {
$output[] = sprintf(
'Would add change log entry to %s now.',
$xml->getFileName()
);
}
}
if ($file && !empty($options['commit2'])) {
$options['commit2']->add($file, $this->_directory);
}
}

// Update CHANGES
if (empty($options['nochanges'])) {
$file = $helper->updateChanges();
if ($file) {
if (empty($options['pretend'])) {
$this->getWrapper('Changes')->save();
$output[] = sprintf('Updated %s.', $file);
} else {
$output[] = sprintf('Would update %s now.', $file);
}
if (!empty($options['commit2'])) {
$options['commit2']->add($file, $this->_directory);
}
}
}

return $output;
}

Expand Down
21 changes: 1 addition & 20 deletions lib/Components/Module/Change.php
Expand Up @@ -38,24 +38,7 @@ public function getOptionGroupDescription()

public function getOptionGroupOptions()
{
return array(
new Horde_Argv_Option(
'',
'--nochanges',
array(
'action' => 'store_true',
'help' => 'Don\'t add entry to CHANGES.'
)
),
new Horde_Argv_Option(
'',
'--nopackage',
array(
'action' => 'store_true',
'help' => 'Don\'t add entry to package.xml.'
)
),
);
return array();
}

/**
Expand Down Expand Up @@ -129,8 +112,6 @@ public function getContextOptionHelp()
{
return array(
'--commit' => 'Commit the change log entries to git (using the change log entry as commit message).',
'--nochanges' => '',
'--nopackage' => '',
'--pretend' => ''
);
}
Expand Down
4 changes: 0 additions & 4 deletions lib/Components/Runner/Change.php
Expand Up @@ -69,14 +69,10 @@ public function run()
$options['commit'] = new Components_Helper_Commit(
$this->_output, $options
);
$options['commit2'] = new Components_Helper_Commit(
$this->_output, $options
);
}
$output = $this->_config->getComponent()->changed($log, $options);
if ($log && !empty($options['commit'])) {
$options['commit']->commit($log);
$options['commit2']->commit($log);
}
foreach ($output as $message) {
$this->_output->plain($message);
Expand Down

0 comments on commit 067393e

Please sign in to comment.