]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Normalize Windows directory separators in SVN
authorepriestley <git@epriestley.com>
Wed, 9 Jan 2013 20:34:37 +0000 (12:34 -0800)
committerepriestley <git@epriestley.com>
Wed, 9 Jan 2013 20:34:37 +0000 (12:34 -0800)
Summary: Fixes T1946.

Test Plan: Ran `arc diff --only` with added paths inside directories. Saw only "/" entries in the diff.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran, mbishopim3
Maniphest Tasks: T1946

Differential Revision: https://secure.phabricator.com/D4374

src/repository/api/ArcanistSubversionAPI.php

index 1345f66445879fb8f06806b8c9ab162547c5999f..61783db017c162e11af15f3696495bbd4c162f4d 100644 (file)
@@ -87,6 +87,11 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
         $this->svnBaseRevisions = array();
         foreach ($target->entry as $entry) {
           $path = (string)$entry['path'];
+          // On Windows, we get paths with backslash directory separators here.
+          // Normalize them to the format everything else expects and generates.
+          if (phutil_is_windows()) {
+            $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
+          }
           $mask = 0;
 
           $props = (string)($entry->{'wc-status'}[0]['props']);