Subversion diff --summarize only shows old paths

梦想与她 提交于 2019-12-20 04:16:15

问题


If I do this:

svn diff
   --summarize
   --old http.../svn/project/trunk
   --new http.../svn/project/branches/branch

I get a list like this:

D      http.../svn/project/trunk/deletedFile
A      http.../svn/project/trunk/addedFile
M      http.../svn/project/trunk/modifiedFile

It only shows the old paths. Is there a way to get the new paths as well? I'm parsing this output, and I'd like to get these paths:

http.../svn/project/branches/branch/deletedFile
http.../svn/project/branches/branch/addedFile
http.../svn/project/branches/branch/modifiedFile

回答1:


You are comparing the HEAD of trunk and the branch, essentially asking "what needs to happen to trunk to make it the same as branch?", so the answer is in terms of changes to trunk. If you swap old and new, you will get the same list of files, in terms of the branch, but with the opposite operation.

If a file was added in the branch and not trunk, and you run your existing diff (old=trunk, new=branch) you see:

A    http:.../project/trunk/file

If you swap old and new (new=branch, old=trunk), you'll get:

D    http:.../project/branches/branch/file


来源:https://stackoverflow.com/questions/637036/subversion-diff-summarize-only-shows-old-paths

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!