]> khamidou — GitHub mirrors - arcanist.git/commit
Fix double file content in files in new subdirectories in Subversion
authorEvan Priestley <epriestley@orbital.(none)>
Tue, 15 Jul 2014 16:43:04 +0000 (09:43 -0700)
committerEvan Priestley <epriestley@orbital.(none)>
Tue, 15 Jul 2014 16:43:04 +0000 (09:43 -0700)
commit97501da16416fbfdc6e84bd60abcbf5ad9506225
tree7cb934928dcd1dd4dd3701628f3596a547ffbc2b
parent9016207307ae49c4e12eeba90e13c665c00c01f9
Fix double file content in files in new subdirectories in Subversion

Summary:
Fixes T5555. Normally, when we `svn diff subdir/`, we use `--depth empty` to get only changes for the directory itself (usually, property changes).

However, this flag has no effect if the directory is newly added.

Adjust the diff parser so that if two sets of hunks are specified for a single file in a raw diff, we let the last one win instead of including both. This approach is a broadly more reasonable interpretation of these diffs.

Test Plan:
  - Added a new file in a new subdirectory in Subversion.
  - Ran `arc diff --only`.
  - No double file content in resulting diff.
  - Added unit test.
  - There's fairly comprehensive unit test coverage for this stuff.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5555

Differential Revision: https://secure.phabricator.com/D9921
src/__phutil_library_map__.php
src/parser/ArcanistDiffParser.php
src/parser/__tests__/ArcanistDiffParserTestCase.php
src/parser/__tests__/diff/svn-double-diff.svndiff [new file with mode: 0644]
src/parser/diff/ArcanistDiffChange.php
src/repository/api/ArcanistSubversionAPI.php