From 420d4fdd26d65406db5520c94cbb67fd87a9fbff Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sat, 5 Sep 2015 15:15:36 -0500 Subject: [PATCH] Issue 90: Full change log doesn't work for mercurial --- indefero/src/IDF/Scm/Mercurial.php | 17 ++++++++++++----- indefero/src/IDF/Scm/Svn.php | 7 ++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/indefero/src/IDF/Scm/Mercurial.php b/indefero/src/IDF/Scm/Mercurial.php index 79f7f4d..93ad498 100644 --- a/indefero/src/IDF/Scm/Mercurial.php +++ b/indefero/src/IDF/Scm/Mercurial.php @@ -512,11 +512,18 @@ class IDF_Scm_Mercurial extends IDF_Scm // hg accepts revision IDs as arguments to --branch / -b as well and // uses the branch of the revision in question to filter the other // revisions - $cmd = sprintf(Pluf::f('hg_path', 'hg').' log --debug -R %s -l%s --style %s -b %s', - escapeshellarg($this->repo), - $n, - escapeshellarg($logStyle->get()), - escapeshellarg($commit)); + if ($n) { + $cmd = sprintf(Pluf::f('hg_path', 'hg').' log --debug -R %s -l%s --style %s -b %s', + escapeshellarg($this->repo), + $n, + escapeshellarg($logStyle->get()), + escapeshellarg($commit)); + } else { + $cmd = sprintf(Pluf::f('hg_path', 'hg').' log --debug -R %s --style %s -b %s', + escapeshellarg($this->repo), + escapeshellarg($logStyle->get()), + escapeshellarg($commit)); + } $out = array(); $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; self::exec('IDF_Scm_Mercurial::getChangeLog', $cmd, $out); diff --git a/indefero/src/IDF/Scm/Svn.php b/indefero/src/IDF/Scm/Svn.php index a7dc707..5f10d60 100644 --- a/indefero/src/IDF/Scm/Svn.php +++ b/indefero/src/IDF/Scm/Svn.php @@ -524,8 +524,13 @@ class IDF_Scm_Svn extends IDF_Scm $rev = 'HEAD'; } $res = array(); - $cmd = $this->svnCmd(array('log', '--xml', '-v', '--limit', $n), + if ($n) { + $cmd = $this->svnCmd(array('log', '--xml', '-v', '--limit', $n), $this->repo.'@'.$rev); + } else { + $cmd = $this->svnCmd(array('log', '--xml', '-v'), + $this->repo.'@'.$rev); + } $xmlRes = self::shell_exec('IDF_Scm_Svn::getChangeLog', $cmd); $xml = simplexml_load_string($xmlRes); foreach ($xml->logentry as $entry) {