Page MenuHomePhabricator

Arcanist reports that it cannot generate a diff from SVN repo even though there are changes in the working copy
Open, Needs TriagePublic

Description

System Information

Vaguely similar SVN repo structure:

  • trunk
    • some
      • sub
        • dir
          • ChangedFile.js
    • other
      • sub
        • dir
          • OtherFilesWithChanges.js

Reproduction Steps

  1. Make changes to "ChangedFile.js"
  2. Also makes changes to "OtherFilesWithChanges.js"
  3. cd working copy (where .svn folder is)
  4. arc diff some/sub/dir
  5. Fill out form with information on changes...etc
  6. Outcome: Usage Exception: There are no changes to generate a diff from!
  7. Expected: A revision to be created that contained changes from "ChangedFile.js" and other files in that location only.

I think this error is connect to T5441.

I've tracked the issue down to ArcanistDiffWorkflow.php and to the method generateAffectedPaths. The issue is when I do arc diff some/sub/dir it correctly identified the root directory and finds the files that have changed (ChangedFile.js...etc plus other in and below that part of the working copy). However, when it runs generateAffectedPaths it does a check to see if that files discovered are a part of the local working copy but it unfortunately compares:

  • C:\workingcopy\trunk\some\sub\dir\

to

  • C:/workingcopy/trunk/some/sub/dir/ChangedFile.js
  • ...etc

The slashes are wrong and thus each one of the discovered paths in that part of the working copy are removed from the array with the check:

foreach ($paths as $path => $mask) {
  if (!$file_list->contains($repository_api->getPath($path), true)) {
    unset($paths[$path]);
  }
}

If I known your code base better I'd fix it myself, but it took me a lot of digging to figure this much out.

Event Timeline

Additional clarification. This happens if you give Arcanist an absolute path when doing an arc diff call.