|
@@ -244,6 +244,7 @@ class Perforce
|
|
return $value;
|
|
return $value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ return null;
|
|
} else {
|
|
} else {
|
|
$command = 'echo $' . $name;
|
|
$command = 'echo $' . $name;
|
|
$this->executeCommand($command);
|
|
$this->executeCommand($command);
|
|
@@ -516,18 +517,22 @@ class Perforce
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param $reference
|
|
|
|
+ * @return mixed|null
|
|
|
|
+ */
|
|
protected function getChangeList($reference)
|
|
protected function getChangeList($reference)
|
|
{
|
|
{
|
|
$index = strpos($reference, '@');
|
|
$index = strpos($reference, '@');
|
|
if ($index === false) {
|
|
if ($index === false) {
|
|
- return;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
$label = substr($reference, $index);
|
|
$label = substr($reference, $index);
|
|
$command = $this->generateP4Command(' changes -m1 ' . $label);
|
|
$command = $this->generateP4Command(' changes -m1 ' . $label);
|
|
$this->executeCommand($command);
|
|
$this->executeCommand($command);
|
|
$changes = $this->commandResult;
|
|
$changes = $this->commandResult;
|
|
if (strpos($changes, 'Change') !== 0) {
|
|
if (strpos($changes, 'Change') !== 0) {
|
|
- return;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
$fields = explode(' ', $changes);
|
|
$fields = explode(' ', $changes);
|
|
$changeList = $fields[1];
|
|
$changeList = $fields[1];
|
|
@@ -535,15 +540,20 @@ class Perforce
|
|
return $changeList;
|
|
return $changeList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param $fromReference
|
|
|
|
+ * @param $toReference
|
|
|
|
+ * @return mixed|null
|
|
|
|
+ */
|
|
public function getCommitLogs($fromReference, $toReference)
|
|
public function getCommitLogs($fromReference, $toReference)
|
|
{
|
|
{
|
|
$fromChangeList = $this->getChangeList($fromReference);
|
|
$fromChangeList = $this->getChangeList($fromReference);
|
|
if ($fromChangeList == null) {
|
|
if ($fromChangeList == null) {
|
|
- return;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
$toChangeList = $this->getChangeList($toReference);
|
|
$toChangeList = $this->getChangeList($toReference);
|
|
if ($toChangeList == null) {
|
|
if ($toChangeList == null) {
|
|
- return;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
$index = strpos($fromReference, '@');
|
|
$index = strpos($fromReference, '@');
|
|
$main = substr($fromReference, 0, $index) . '/...';
|
|
$main = substr($fromReference, 0, $index) . '/...';
|