1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Allow arc to parse svnlook diffs from moves/copies

Summary: Ref T4697. This is similar to the existing stuff, but `svnlook diff ...` can also produce a "Copied" header. Currently, we choke on it in Herald when running pre-commit rules.

Test Plan: Added and ran tests. In the next diff, used this in a real system.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4697

Differential Revision: https://secure.phabricator.com/D8653
This commit is contained in:
epriestley 2014-04-01 08:20:55 -07:00
parent d0bab7f34a
commit a36969e58b
3 changed files with 10 additions and 1 deletions

View file

@ -232,7 +232,7 @@ final class ArcanistDiffParser {
// This is a normal SVN text change, probably from "svn diff". // This is a normal SVN text change, probably from "svn diff".
'(?P<type>Index): (?P<cur>.+)', '(?P<type>Index): (?P<cur>.+)',
// This is an SVN text change, probably from "svnlook diff". // This is an SVN text change, probably from "svnlook diff".
'(?P<type>Modified|Added|Deleted): (?P<cur>.+)', '(?P<type>Modified|Added|Deleted|Copied): (?P<cur>.+)',
// This is an SVN property change, probably from "svn diff". // This is an SVN property change, probably from "svn diff".
'(?P<type>Property changes on): (?P<cur>.+)', '(?P<type>Property changes on): (?P<cur>.+)',
// This is a git commit message, probably from "git show". // This is a git commit message, probably from "git show".
@ -314,6 +314,7 @@ final class ArcanistDiffParser {
case 'Modified': case 'Modified':
case 'Added': case 'Added':
case 'Deleted': case 'Deleted':
case 'Copied':
$this->parseIndexHunk($change); $this->parseIndexHunk($change);
break; break;
case 'Property changes on': case 'Property changes on':

View file

@ -573,6 +573,7 @@ EOTEXT
case 'svnlook-basics.svndiff': case 'svnlook-basics.svndiff':
case 'svnlook-add.svndiff': case 'svnlook-add.svndiff':
case 'svnlook-delete.svndiff': case 'svnlook-delete.svndiff':
case 'svnlook-copied.svndiff':
$this->assertEqual(1, count($changes)); $this->assertEqual(1, count($changes));
break; break;
case 'git-format-patch.gitdiff': case 'git-format-patch.gitdiff':

View file

@ -0,0 +1,7 @@
Copied: movedfile (from rev 30, newfile)
===================================================================
--- movedfile (rev 0)
+++ movedfile 2014-03-31 02:21:25 UTC (txn 30-1o)
@@ -0,0 +1,2 @@
+blamo
+blamo