Arc diff fails for svn move for new versions of svn

Overview

arc diff is not working after I use svn move. This bug was caused by a change in the svn propget command, sometime between svn v1.6 and v1.14. This issue was previously reported here. I have done analysis and would like to propose a fix.

Environment
Windows
svn version 1.14

Reproduction Instructions

# Create a workspace.
mkdir C:\tmp\repos
mkdir C:\tmp\workspace

# Set up the new repository.
svnadmin create C:\tmp\repos\new
svn mkdir -m "Create directory structure." ^
  file:///C:/tmp/repos/new/trunk ^
  file:///C:/tmp/repos/new/branches ^
  file:///C:/tmp/repos/new/tags 

# Add some content to new repository.
cd C:\tmp\workspace
svn checkout file:///C:/tmp/repos/new/trunk new
cd new
echo "Hello, World!" > test1.txt
svn add test1.txt
svn commit -m "add initial content"

# svn move the file
svn move test1.txt test2.txt

# Add a .arcconfig file from your own Phabricator install.
# Then try to use arc diff.
arc diff --only

After following those repro steps, I see the following error:

STDERR
svn: warning: W200017: Property ‘svn:mime-type’ not found on ‘C:/tmp/workspace/new/test2.txt@’
svn: E200000: A problem occurred; see other errors for details

(I can provide the full trace if needed, but I have already done the analysis below.)

Analysis

The root cause is a change in the svn propget command, sometime between svn v1.6 and v1.14. You can download svn version 1.6 here.

You can follow the same repro steps outlined above to set up a separate repository for svn v1.6.

Then, you can run the following command in both repositories to compare the output:

# First confirm the property does not exist on the file.
svn proplist test1.txt

# Then try to get the property anyway.
svn propget svn:mime-type test1.txt

This command returns empty for svn v1.6. But for svn v1.14, it throws the following error:

svn: warning: W200017: Property ‘svn:mime-type’ not found on ‘test1.txt’
svn: E200000: A problem occurred; see other errors for details

Proposed Fix

I propose checking svn proplist before calling svn propget. Something like this:

file: arcanist/src/repository/api/Arcanist/SubversionAPI.php

image

Phabricator/Arcanist Version
I downloaded the latest version from github on 4/15/2021.

(arc version fails for me due to some other unrelated issues, trying to resolve so I can provide a more satisfactory answer here.)