Skip to content

Commit

Permalink
Commit in two steps.
Browse files Browse the repository at this point in the history
First the actual change and changelog.yml (which is the same in all branches). Then CHANGES and package.xml (which are different on each branch).
  • Loading branch information
yunosh committed Oct 25, 2017
1 parent 6801c86 commit d742737
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/Components/Component/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ public function changed(
$options
);
}
if ($file && !empty($options['commit'])) {
$options['commit']->add($file, $this->_directory);
if ($file && !empty($options['commit2'])) {
$options['commit2']->add($file, $this->_directory);
}
}
if (empty($options['nochanges'])) {
Expand All @@ -243,8 +243,8 @@ public function changed(
} else {
$file = $helper->changes($log, $options);
}
if ($file && !empty($options['commit'])) {
$options['commit']->add($file, $this->_directory);
if ($file && !empty($options['commit2'])) {
$options['commit2']->add($file, $this->_directory);
}
}
}
Expand Down
15 changes: 10 additions & 5 deletions lib/Components/Runner/Change.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ class Components_Runner_Change
/**
* Constructor.
*
* @param Components_Config $config The configuration for the current
* job.
* @param Components_Config $config The configuration for the
* current job.
* @param Components_Helper_ChangeLog $helper Change log helper
*/
public function __construct(
Components_Config $config,
Components_Helper_ChangeLog $helper,
Components_Output $output
) {
)
{
$this->_config = $config;
$this->_helper = $helper;
$this->_output = $output;
Expand All @@ -74,16 +75,20 @@ public function run()
$log = null;
}

if (!empty($options['commit'])) {
if ($log && !empty($options['commit'])) {
$options['commit'] = new Components_Helper_Commit(
$this->_output, $options
);
$options['commit2'] = new Components_Helper_Commit(
$this->_output, $options
);
}
$this->_config->getComponent()->changed(
$log, $this->_helper, $options
);
if (!empty($options['commit'])) {
if ($log && !empty($options['commit'])) {
$options['commit']->commit($log);
$options['commit2']->commit($log);
}
}
}

0 comments on commit d742737

Please sign in to comment.