WebKit Bugzilla
Attachment 348766 Details for
Bug 14590
: svn-create-patch fails when svn mv is used on directory trees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1 - WIP
bug-14590-v1.diff (text/plain), 3.32 KB, created by
David Kilzer (:ddkilzer)
on 2018-09-03 04:53:46 PDT
(
hide
)
Description:
Patch v1 - WIP
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2018-09-03 04:53:46 PDT
Size:
3.32 KB
patch
obsolete
>Index: Tools/Scripts/svn-create-patch >=================================================================== >--- Tools/Scripts/svn-create-patch (revision 235584) >+++ Tools/Scripts/svn-create-patch (working copy) >@@ -35,10 +35,7 @@ > # Handles binary files (encoded as a base64 chunk of text). > # Sorts the diffs alphabetically by text files, then binary files. > # Handles copied and moved files. >-# >-# Missing features: >-# >-# Handle copied and moved directories. >+# Handles copied and moved directories. > > use strict; > use warnings; >@@ -252,6 +249,8 @@ > my $patch = ""; > my $isAdditionWithHistory = $fileData->{modificationType} eq "additionWithHistory"; > if ($isAdditionWithHistory) { >+ # Nothing to do for a moved directory since each moved file is handled individually. >+ return if -d $fileData->{path}; > manufacturePatchForAdditionWithHistory($fileData, $prefix); > } > >@@ -283,6 +282,7 @@ > my %testDirectories = map { $_ => 1 } qw(LayoutTests); > my $escapedStatPath = escapeSubversionPath($statPath); > my @deletedFiles; >+ my @additionWithHistoryDirectories; > > print STDERR "Performing \"svn stat '$escapedStatPath'\"\n" if $verbose; > >@@ -305,8 +305,6 @@ > $path = substr($line, 7); > } > >- next if -d $path; >- > my $modificationType = findModificationType($stat); > > if ($modificationType eq "missing") { >@@ -343,10 +341,35 @@ > my ($sourceFile, $sourceRevision) = findSourceFileAndRevision($path); > $diffFiles->{$path}->{sourceFile} = $sourceFile; > $diffFiles->{$path}->{sourceRevision} = $sourceRevision; >+ push(@additionWithHistoryDirectories, $path) if -d $path; > } > } > close STAT; > >+ foreach my $directory (@additionWithHistoryDirectories) { >+ my ($sourceDirectory, $sourceRevision) = findSourceFileAndRevision($directory); >+ # Gather a hierarchical list of files inside the moved directory. >+ my $diffOptions = diffOptionsForFile($sourceDirectory); >+ my $escapedDirectory = escapeSubversionPath($directory); >+ print STDERR "Performing \"svn diff --diff-cmd diff -x -$diffOptions '$escapedDirectory'\"\n" if $verbose; >+ open DIFF, "svn diff --diff-cmd diff -x -$diffOptions '$escapedDirectory' |" or die; >+ while (<DIFF>) { >+ if (m/^Index: (.*)$/) { >+ my $movedFile = $1; >+ # Ignore other files added/moved into the moved directory. >+ next if exists $diffFiles->{$movedFile}; >+ $diffFiles->{$movedFile}->{path} = $movedFile; >+ $diffFiles->{$movedFile}->{modificationType} = "additionWithHistory"; >+ $diffFiles->{$movedFile}->{isBinary} = isBinaryMimeType($movedFile); >+ $diffFiles->{$movedFile}->{isTestFile} = exists $testDirectories{(File::Spec->splitdir($movedFile))[0]} ? 1 : 0; >+ my $relativePath = File::Spec->abs2rel("/" . $movedFile, "/" . $directory); >+ $diffFiles->{$movedFile}->{sourceFile} = File::Spec->catfile($sourceDirectory, $relativePath); >+ $diffFiles->{$movedFile}->{sourceRevision} = $sourceRevision; >+ } >+ } >+ close DIFF; >+ } >+ > foreach my $path (@deletedFiles) { > my $isInsideDeletedDirectory = 0; > foreach my $compare (@deletedFiles) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 14590
:
348766
|
348782
|
348784
|
348853
|
348862
|
348961