博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SVN diff
阅读量:5098 次
发布时间:2019-06-13

本文共 5683 字,大约阅读时间需要 18 分钟。

http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.diff.html

 

Name

svn diff (di) — This displays the differences between two revisions or paths.

Synopsis

diff [-c M | -r N[:M]] [TARGET[@REV]...]

diff [-r N[:M]] --old=OLD-TGT[@OLDREV] [--new=NEW-TGT[@NEWREV]] [PATH...]

diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

Description

Display the differences between two paths. You can use svn diff in the following ways:

  • Use just svn diff to display local modifications in a working copy.

  • Display the changes made to TARGETs as they are seen in REV between two revisions. TARGETs may be all working copy paths or all URLs. If TARGETs are working copy paths, N defaults to BASE and M to the working copy; if TARGETs are URLs, N must be specified and M defaults to HEAD. The -c M option is equivalent to -r N:M where N = M-1. Using -c -M does the reverse: -r M:N where N = M-1.

  • Display the differences between OLD-TGT as it was seen in OLDREV and NEW-TGT as it was seen in NEWREV. PATHs, if given, are relative to OLD-TGT and NEW-TGT and restrict the output to differences for those paths. OLD-TGT and NEW-TGT may be working copy paths or URL[@REV]. NEW-TGT defaults to OLD-TGT if not specified. -r N makes OLDREV default to N; -r N:M makes OLDREV default to N and NEWREV default to M.

svn diff OLD-URL[@OLDREV] NEW-URL[@NEWREV] is shorthand for svn diff --old=OLD-URL[@OLDREV] --new=NEW-URL[@NEWREV].

svn diff -r N:M URL is shorthand for svn diff -r N:M --old=URL --new=URL.

svn diff [-r N[:M]] URL1[@N] URL2[@M] is shorthand for svn diff [-r N[:M]] --old=URL1 --new=URL2.

If TARGET is a URL, then revs N and M can be given either via the --revision (-r) option or by using the @” notation as described earlier.

If TARGET is a working copy path, the default behavior (when no --revision (-r) option is provided) is to display the differences between the base and working copies of TARGET. If a --revision (-r) option is specified in this scenario, though, it means:

--revision N:M

The server compares TARGET@N and TARGET@M.

--revision N

The client compares TARGET@N against the working copy.

If the alternate syntax is used, the server compares URL1 and URL2 at revisions N and M, respectively. If either N or M is omitted, a value of HEAD is assumed.

By default, svn diff ignores the ancestry of files and merely compares the contents of the two files being compared. If you use --notice-ancestry, the ancestry of the paths in question will be taken into consideration when comparing revisions (i.e., if you run svn diff on two files with identical contents but different ancestry, you will see the entire contents of the file as having been removed and added again).

Options

--change (-c) ARG--changelist ARG--depth ARG--diff-cmd CMD--extensions (-x) ARG--force--new ARG--no-diff-deleted--notice-ancestry--old ARG--revision (-r) ARG--summarize--xml

Examples

Compare BASE and your working copy (one of the most popular uses of svn diff):

$ svn diff COMMITTERS Index: COMMITTERS===================================================================--- COMMITTERS	(revision 4404)+++ COMMITTERS	(working copy)

See what changed in the file COMMITTERS revision 9115:

$ svn diff -c 9115 COMMITTERS Index: COMMITTERS===================================================================--- COMMITTERS	(revision 3900)+++ COMMITTERS	(working copy)

See how your working copy's modifications compare against an older revision:

$ svn diff -r 3900 COMMITTERS Index: COMMITTERS===================================================================--- COMMITTERS	(revision 3900)+++ COMMITTERS	(working copy)

Compare revision 3000 to revision 3500 using @” syntax:

$ svn diff http://svn.collab.net/repos/svn/trunk/COMMITTERS@3000 \           http://svn.collab.net/repos/svn/trunk/COMMITTERS@3500Index: COMMITTERS===================================================================--- COMMITTERS	(revision 3000)+++ COMMITTERS	(revision 3500)…

Compare revision 3000 to revision 3500 using range notation (pass only the one URL in this case):

$ svn diff -r 3000:3500 http://svn.collab.net/repos/svn/trunk/COMMITTERSIndex: COMMITTERS===================================================================--- COMMITTERS	(revision 3000)+++ COMMITTERS	(revision 3500)

Compare revision 3000 to revision 3500 of all the files in trunk using range notation:

$ svn diff -r 3000:3500 http://svn.collab.net/repos/svn/trunk

Compare revision 3000 to revision 3500 of only three files in trunk using range notation:

$ svn diff -r 3000:3500 --old http://svn.collab.net/repos/svn/trunk \           COMMITTERS README HACKING

If you have a working copy, you can obtain the differences without typing in the long URLs:

$ svn diff -r 3000:3500 COMMITTERS Index: COMMITTERS===================================================================--- COMMITTERS	(revision 3000)+++ COMMITTERS	(revision 3500)

Use --diff-cmd CMD --extensions (-x) to pass arguments directly to the external diff program:

$ svn diff --diff-cmd /usr/bin/diff -x "-i -b" COMMITTERS Index: COMMITTERS===================================================================0a1,2> This is a test>

Lastly, you can use the --xml option along with the --summarize option to view XML describing the changes that occurred between revisions, but not the contents of the diff itself:

$ svn diff --summarize --xml http://svn.red-bean.com/repos/test@r2 \           http://svn.red-bean.com/repos/test
http://svn.red-bean.com/repos/test/sandwich.txt
http://svn.red-bean.com/repos/test/burrito.txt
http://svn.red-bean.com/repos/test/snacks

转载于:https://www.cnblogs.com/liujx2019/p/10310029.html

你可能感兴趣的文章
原型模式登记形式
查看>>
享元模式
查看>>
转:RMAN-06023 : no backup or copy of datafile found to restore 说明
查看>>
pcl库的配置
查看>>
FastDFS 分布式文件存储目录
查看>>
TmemoryStream ,bety[], TByteDynArray文件转化函数小结
查看>>
第一个只出现一次的字符
查看>>
235. Lowest Common Ancestor of a Binary Search Tree
查看>>
MySQL 备份恢复(导入导出)单个 innodb表
查看>>
语义分割的简单指南 A Simple Guide to Semantic Segmentation
查看>>
Javascript正则表达式
查看>>
常见笔记本进入bios方法
查看>>
左右滚动的东西
查看>>
Dwz手册的补充说明和常见问题
查看>>
Mybatis 传入List类型参数,报错:There is no getter for property named '__frch_item_0' in
查看>>
不可轻视复制构造函数
查看>>
Mysql高阶
查看>>
vb.net向Excel中写入值
查看>>
builder模式-积木系列
查看>>
POJ 3660 Cow Contest
查看>>