}
public function getMetadataPath() {
- return $this->getPath('.svn');
+ static $svn_dir = null;
+ if ($svn_dir === null) {
+ // from svn 1.7, subversion keeps a single .svn directly under
+ // the working copy root. However, we allow .arcconfigs that
+ // aren't at the working copy root.
+ foreach (Filesystem::walkToRoot($this->getPath()) as $parent) {
+ $possible_svn_dir = Filesystem::resolvePath('.svn', $parent);
+ if (Filesystem::pathExists($possible_svn_dir)) {
+ $svn_dir = $possible_svn_dir;
+ break;
+ }
+ }
+ }
+ return $svn_dir;
}
protected function buildLocalFuture(array $argv) {
'.hg',
'.svn',
);
+ $found_meta_dir = false;
foreach ($vc_dirs as $dir) {
- $local_path = Filesystem::resolvePath(
- $dir.'/arc/config',
+ $meta_path = Filesystem::resolvePath(
+ $dir,
$this->projectRoot);
- if (Filesystem::pathExists($local_path)) {
- $file = Filesystem::readFile($local_path);
- if ($file) {
- $this->localConfig = json_decode($file, true);
- break;
+ if (Filesystem::pathExists($meta_path)) {
+ $found_meta_dir = true;
+ $local_path = Filesystem::resolvePath(
+ 'arc/config',
+ $meta_path);
+ if (Filesystem::pathExists($local_path)) {
+ $file = Filesystem::readFile($local_path);
+ if ($file) {
+ $this->localConfig = json_decode($file, true);
+ }
+ }
+ break;
+ }
+ }
+
+ if (!$found_meta_dir) {
+ // Try for a single higher-level .svn directory as used by svn 1.7+
+ foreach (Filesystem::walkToRoot($this->projectRoot) as $parent_path) {
+ $local_path = Filesystem::resolvePath(
+ '.svn/arc/config',
+ $parent_path);
+ if (Filesystem::pathExists($local_path)) {
+ $file = Filesystem::readFile($local_path);
+ if ($file) {
+ $this->localConfig = json_decode($file, true);
+ }
}
}
}