[Webkit-unassigned] [Bug 14590] svn-create-patch fails when svn mv is used on directory trees
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 4 13:09:39 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=14590
--- Comment #7 from David Kilzer (ddkilzer) <ddkilzer at webkit.org> 2009-11-04 13:09:38 PDT ---
(In reply to comment #6)
> svn-create-patch has changed a lot in the past few years. Is this still an
> issue?
Yes.
$ svn mv WebKitTools/mangleme WebKitTools/mangleyou
A WebKitTools/mangleyou
D WebKitTools/mangleme/LICENSE
D WebKitTools/mangleme/tags.h
D WebKitTools/mangleme/mangle.cgi.c
D WebKitTools/mangleme/remangle.cgi.c
D WebKitTools/mangleme/Makefile
D WebKitTools/mangleme/README
D WebKitTools/mangleme
$ ./WebKitTools/Scripts/svn-create-patch WebKitTools > diff
$ svn revert --recursive WebKitTools
Reverted 'WebKitTools/mangleme'
Reverted 'WebKitTools/mangleme/LICENSE'
Reverted 'WebKitTools/mangleme/tags.h'
Reverted 'WebKitTools/mangleme/mangle.cgi.c'
Reverted 'WebKitTools/mangleme/remangle.cgi.c'
Reverted 'WebKitTools/mangleme/Makefile'
Reverted 'WebKitTools/mangleme/README'
Reverted 'WebKitTools/mangleyou'
$ rm -rf WebKitTools/mangleyou
$ ./WebKitTools/Scripts/svn-apply diff
patching file WebKitTools/mangleme/LICENSE
D WebKitTools/mangleme/LICENSE
patching file WebKitTools/mangleme/Makefile
D WebKitTools/mangleme/Makefile
patching file WebKitTools/mangleme/README
D WebKitTools/mangleme/README
patching file WebKitTools/mangleme/mangle.cgi.c
D WebKitTools/mangleme/mangle.cgi.c
patching file WebKitTools/mangleme/remangle.cgi.c
D WebKitTools/mangleme/remangle.cgi.c
patching file WebKitTools/mangleme/tags.h
D WebKitTools/mangleme/tags.h
D WebKitTools/mangleme
$ svn stat WebKitTools
D WebKitTools/mangleme
D WebKitTools/mangleme/LICENSE
D WebKitTools/mangleme/tags.h
D WebKitTools/mangleme/mangle.cgi.c
D WebKitTools/mangleme/remangle.cgi.c
D WebKitTools/mangleme/Makefile
D WebKitTools/mangleme/README
As you can see, the patch only contains the removed files. It doesn't contain
the "added" files in the renamed directory, and it doesn't even "understand"
that the directory was renamed (with no other changes).
Because git only cares about files (and not directories), doing the same thing
in git results in just a "rename" patch for each file moved:
$ git mv WebKitTools/mangleme WebKitTools/mangleyou
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# renamed: WebKitTools/mangleme/LICENSE -> WebKitTools/mangleyou/LICENSE
# renamed: WebKitTools/mangleme/Makefile ->
WebKitTools/mangleyou/Makefile
# renamed: WebKitTools/mangleme/README -> WebKitTools/mangleyou/README
# renamed: WebKitTools/mangleme/mangle.cgi.c ->
WebKitTools/mangleyou/mangle.cgi.c
# renamed: WebKitTools/mangleme/remangle.cgi.c ->
WebKitTools/mangleyou/remangle.cgi.c
# renamed: WebKitTools/mangleme/tags.h -> WebKitTools/mangleyou/tags.h
If we make svn-create-patch mimic what git does, then we'd have a series of
rename patches for each file (although svn-create-patch does those
differently--it puts a full delete and a full add patch in for each file, plus
a third patch if the source was changed after the move). However, you still
have to have some logic in svn-apply (and svn-unapply) that can figure out that
we renamed an entire directory before it applies the individual patches.
One approach would be to add a special patch entry (similar to a property
change "patch", except it would denote directory moves/renames) that does
nothing when used with patch(1), but provides a hint to svn-apply and
svn-unapply that whole directories were renamed or moved. Then we could
"ignore" the whole-file-delete and whole-file-add patches and only apply the
"changes-after-move" patch for any given file under that directory.
Does that make any sense? :)
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list