Subversion: log of a path, regardless of copies
When I do svn log <path>
, it will show me the history of that path, up until the point where it was copied from another path. At that point, it will start showing me the history of the original path.
Is there a way to get the history of all changes to a particular path, regardless of whether it was copied from somewhere else? I know you can pass --stop-on-copy
, but that cuts off all history before the copy, which is exactly what I want to see.
The only workaround I've found is to first do svn log <path>
, look for the revision where it was copied, and then do svn log <path>@<revision - 2>
(assuming that the original file was deleted immediately before the copy). Then repeat for subsequent copies. But there must be a simpler way.
This would be useful in several situations:
Sometimes you copy a file, not because you want to share its history, but just because you want its contents. If you're copying it over an existing file, you still may want to retain the existing file's history.
When you do a merge from a branch using
开发者_运维问答--reintegrate
, you have to delete the branch, since it will break on future merges. If you want to reuse the same branch name, you have to make a new copy of it. But you may want to see what was in the branch before it was re-copied.
If this isn't possible, isn't this a pretty major omission?
This question is looking for similar data I think.
There’s no native Subversion way to do this because Subversion treats files, not paths, as the things to keep track of. The method you describe in your question of getting the log of a file, stopping on copy, and then using a peg revision from before the copy, etc. would seem to be the only way of tracking the history of that path. The person in the linked question was doing something like this via a script.
Re: your bullet point, if you want to insert the contents of a file into another file while maintaining the destination file’s history, you should copy and paste into it.
精彩评论