Page MenuHomePhorge

Arcanist is broken on Subversion when moving a file
Open, HighPublic

Description

I just discovered this upstream Task since I met the very same bug:

https://secure.phabricator.com/T10608

My error message was something like:

svn: warning: W200017: Property 'svn:mime-type' not found on '<MYFILE>@'
svn: E200000: A problem occurred; see other errors for details
#2 ArcanistSubversionAPI::getSVNProperty(string, string) called at [<arcanist>/src/repository/api/ArcanistSubversionAPI.php:454
...

Running with latest version of Arcanist.

Steps to reproduce:

  1. svn mv <file> <file>_2
  2. arc diff --only (or also arc diff --only)

My dirty workaround was:

diff --git a/src/repository/api/ArcanistSubversionAPI.php b/src/repository/api/ArcanistSubversionAPI.php
index 887fa4f..3f8ca98 100644
--- a/src/repository/api/ArcanistSubversionAPI.php
+++ b/src/repository/api/ArcanistSubversionAPI.php
@@ -199,7 +199,7 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
 
   public function getSVNProperty($path, $property) {
     list($stdout) = execx(
-      'svn propget %s %s@',
+      'svn propget %s %s@ || true',
       $property,
       $this->getPath($path));
     return trim($stdout);

Inspired by this one:

https://secure.phabricator.com/T10608#204905

Event Timeline

valerio.bozzolan created this task.
valerio.bozzolan created this object in space S1 Public.

I put this into a subtask of T15096 since it's obvious to me that, without fixing this problem, users simply cannot use Arcanist with Subversion. We cannot just propose to end-users to do not rename a file.

At least using svn 1.13.0, adding --show-inherited-props to the command doesn't print an error and exits with status 0 from the propget command, but I'm not sure what it actually does.

Alternatively, maybe svn proplist --xml can be used.

According to svn help propset:

A mimetype beginning with 'text/' (or an absent mimetype) is treated as text. Anything else is treated as binary.


In other news, getSVNProperty() can probably be removed and replaced with private getRecordedMimeType() - it's only used twice, both times locally and both times for mime-type.