public function getSVNStatus($with_externals = false) {
if ($this->svnStatus === null) {
- list($status) = execx('(cd %s && svn --xml status)', $this->getPath());
+ list($status) = $this->execxLocal('--xml status');
$xml = new SimpleXMLElement($status);
if (count($xml->target) != 1) {
//
// Work around this by cd-ing into the directory before executing
// 'svn info'.
- return new ExecFuture(
- '(cd %s && svn info .)',
- $this->getPath());
+ return $this->buildLocalFuture(array('info .'));
} else {
// Note: here and elsewhere we need to append "@" to the path because if
// a file has a literal "@" in it, everything after that will be
// interpreted as a revision. By appending "@" with no argument, SVN
// parses it properly.
- return new ExecFuture(
- 'svn info %s@',
- $this->getPath($path));
+ return $this->buildLocalFuture(array('info %s@', $this->getPath($path)));
}
}
// want that, so prevent recursive diffing.
$root = phutil_get_library_root('arcanist');
- return new ExecFuture(
- '(cd %s; svn diff --depth empty --diff-cmd %s -x -U%d %s)',
- $this->getPath(),
- $root.'/../scripts/repository/binary_safe_diff.sh',
- $this->getDiffLinesOfContext(),
- $path);
+ if (phutil_is_windows()) {
+ // TODO: Provide a binary_safe_diff script for Windows.
+ // TODO: Provide a diff command which can take lines of context somehow.
+ return $this->buildLocalFuture(
+ array(
+ 'diff --depth empty %s',
+ $path,
+ ));
+ } else {
+ $diff_bin = $root.'/../scripts/repository/binary_safe_diff.sh';
+ $diff_cmd = Filesystem::resolvePath($diff_bin);
+ return $this->buildLocalFuture(
+ array(
+ 'diff --depth empty --diff-cmd %s -x -U%d %s',
+ $diff_cmd,
+ $this->getDiffLinesOfContext(),
+ $path,
+ ));
+ }
}
public function primeSVNInfoResult($path, $result) {
"Error #{$err} executing svn info against '{$path}'.");
}
+ // TODO: Hack for Windows.
+ $stdout = str_replace("\r\n", "\n", $stdout);
+
$patterns = array(
'/^(URL): (\S+)$/m',
'/^(Revision): (\d+)$/m',
public function getBlame($path) {
$blame = array();
- list($stdout) = execx(
- '(cd %s && svn blame %s)',
- $this->getPath(),
- $path);
+ list($stdout) = $this->execxLocal('blame %s', $path);
$stdout = trim($stdout);
if (!strlen($stdout)) {
// SVN issues warnings for nonexistent paths, directories, etc., but still
// returns no error code. However, for new paths in the working copy it
// fails. Assume that failure means the original file does not exist.
- list($err, $stdout) = exec_manual(
- '(cd %s && svn cat %s@)',
- $this->getPath(),
- $path);
+ list($err, $stdout) = $this->execManualLocal('cat %s@', $path);
if ($err) {
return null;
}