svn-create-patch fails when svn mv is used on directory trees
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Sep 2018 12:38:47 +0000 (12:38 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Sep 2018 12:38:47 +0000 (12:38 +0000)
commitea49d6bd9547a58e5f753b9168c24ff6ba976131
treeb701a70ed6db0083bb9024d6dcda254d053a5918
parentd70bcf28e6abd2f2c3c012aed3cb8f892c98e84b
svn-create-patch fails when svn mv is used on directory trees
<https://webkit.org/b/14590>

Reviewed by Daniel Bates.

* Scripts/VCSUtils.pm: Export parseSvnDiffStartLine() for
svn-create-patch.
(parseDiffStartLine): Use parseSvnDiffStartLine().
(parseGitDiffStartLine): Document a prerequisite.  Fix a bug
when parsing git patches using `git diff --no-prefix` non-native
line endings.  Found by new tests written for
Scripts/webkitperl/VCSUtils_unittest/parseDiffStartLine.pl.
(parseSvnDiffStartLine): Add.  Extract logic from
parseDiffStartLine() for use with svn-create-patch.

* Scripts/svn-create-patch: Update copyright and license.
(generateDiff): Return early for moved directories since
individual files within the directory are handled separately.
(generateFileList): Keep track of moved directories in the
@additionWithHistoryDirectories array, then process this array
in reverse order to create delete/add patches for each file in
a moved directory.  This also prevents duplicate patches.
(manufacturePatchForAdditionWithHistory): Fix a long-standing
bug where the path used to describe property changes contained
the original (moved-from) path instead of the new (moved-to)
path. This could cause svn-apply to fail mysteriously when
trying to apply an empty patch created by the property change
containing the moved-from path.

* Scripts/webkitperl/VCSUtils_unittest/parseDiffStartLine.pl: Add.
Tests for parseDiffStartLine(), parseGitDiffStartLine() and
parseSvnDiffStartLine().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/VCSUtils.pm
Tools/Scripts/svn-create-patch
Tools/Scripts/webkitperl/VCSUtils_unittest/parseDiffStartLine.pl [new file with mode: 0644]