SVN diff
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 inREVbetween two revisions.TARGETs may be all working copy paths or allURLs. IfTARGETs are working copy paths,Ndefaults toBASEandMto the working copy; ifTARGETs areURLs,Nmust be specified andMdefaults toHEAD. The-c Moption is equivalent to-r N:MwhereN = M-1. Using-c -Mdoes the reverse:-r M:NwhereN = M-1.Display the differences between
OLD-TGTas it was seen inOLDREVandNEW-TGTas it was seen inNEWREV.PATHs, if given, are relative toOLD-TGTandNEW-TGTand restrict the output to differences for those paths.OLD-TGTandNEW-TGTmay be working copy paths orURL[@REV].NEW-TGTdefaults toOLD-TGTif not specified.-r NmakesOLDREVdefault toN;-r N:MmakesOLDREVdefault toNandNEWREVdefault toM.
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@NandTARGET@M. --revision N-
The client compares
TARGET@Nagainst 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@3500
Index: 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/COMMITTERS
Index: 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
<?xml version="1.0"?>
<diff>
<paths>
<path
props="none"
kind="file"
item="modified">http://svn.red-bean.com/repos/test/sandwich.txt</path>
<path
props="none"
kind="file"
item="deleted">http://svn.red-bean.com/repos/test/burrito.txt</path>
<path
props="none"
kind="dir"
item="added">http://svn.red-bean.com/repos/test/snacks</path>
</paths>
</diff>
SVN diff的更多相关文章
- svn diff 详解
UI版: 如果多人编辑同一段代码,常常容易出现冲突的情况: 如果出现冲突,我们如何解决他呢? 1 可以选择使用自己的文件mime file,也可以使用 他们的文件 their file 2 解决冲突, ...
- Mac、Linux更换命令行svn diff为P4Merge、vimdiff
2015-01-21 21:25:52 这里先把那个程序员大神的博客地址贴一下(PS:大神,我不是为了抄袭哦,真是怕自己忘记了),http://www.ccvita.com/445.html,里面还有 ...
- 如何使用 vimdiff 来 git diff /svn diff
#git 如何实现vimdiffgit config --global diff.tool vimdiff git config --global difftool.prompt false git ...
- svn小技巧——重定向svn diff
svn diff的默认输出模式比较冗长,如果遇到修改比较多的情况,有时会较难看清diff.svn本身提供了自定义diff输出的选项,可能的修改方法如下: 建立一个脚本文件(如svndiff.sh),调 ...
- [转]svn diff 替代工具
svn diff 替代工具 http://blog.csdn.net/fudesign2008/article/details/8168811 一. 使用vimdiff替换svn diff: 对于多数 ...
- SVN diff 笔记
SVN diff命令在实际中经常使用,在此记录使用点滴. #对比工作文件与缓存在.svn的“原始”拷贝: svn diff #显示工作文件和服务器版本2的不同: svn diff -r 2 #显示分支 ...
- svn diff color
大致有两种方式: 1,在bashrc中添加如下脚本 svndiff() { svn diff "${@}" | colordiff } 2,修改svn的配置文件 $ vim ~/. ...
- 使用svn diff的-r参数的来比较任意两个版本的差异
1 svn diff的用法1.1 对比当前本地的工作拷贝文件(working copy)和缓存在.svn下的版本库文件的区别 svn diff 1.2 对比当前本地的工作拷贝文件(working co ...
- learning svn diff --summarize
# svn diff --summarizeA armbian-custom-dc/test/4g-power.shA armbian-custom-dc/test/4g-reset.shM armb ...
- svn diff 只显示文件名
svn diff --summarize
随机推荐
- 总结:自动将函数对象添加到字典的bug
介绍 本文以ATM项目为背景,介绍一个比较实用的编程技巧,使用装饰器将项目中的指定函数添加到字典中. 利用字典通过key访问value的特点,实现用户输入编号,通过字典直接获取并调用编号对应的功能函数 ...
- 运输问题中产销不平衡问题(表上作业法和LINGO方法)
对于产销不平衡问题有两种情况: 供大于求(产大于销)→增加虚拟销地 供不应求(产小于销)→增加虚拟产地 例如以下例题: 这个题中,总产量为55,总销量为60,故而我们知道这个问题属于供不应求. 1.这 ...
- 利用data文件恢复MySQL数据库
背景:测试服务器 MySQL 数据库不知何种原因宕机,且无法启动,而原先的数据库并没有备份,重新搭建一个新服务器把原data 复制出来 进行恢复 1 尽量把原data复制出来(一个都不要少以防意外 其 ...
- Light of future-冲刺Day 5
目录 1.SCRUM部分: 每个成员进度 SCRUM 会议的照片 签入记录 代码运行截图 用户浏览界面 订单详情界面 管理员浏览界面 新增后台界面 2.PM 报告: 时间表 燃尽图 任务总量变化曲线 ...
- 深入解读ES6系列(四)
来自老曾es6的前言: 哈喽小伙伴们,爱说'废'话的Z又回来了,欢迎来到Super IT曾的博客时间,上一节说了字符串,面向对象以及json的知识,这一节我们继续我们知识的海洋,一起奋斗不秃头!不足的 ...
- eolinker测试增强
地址:https://www.eolinker.com Chrome: https://chrome.google.com/webstore/detail/eolinker/mdbgchaihbacj ...
- 052.Kubernetes集群管理-故障排错指南
一 故障指南 1.1 常见问题排障 为了跟踪和发现在Kubernetes集群中运行的容器应用出现的问题,常用如下查错方法: 查看Kubernetes对象的当前运行时信息,特别是与对象关联的Event事 ...
- VBScript - 弹出“文件选择对话框”方法大全!
本文记录,VBScript 中,各种打开 "文件选择对话框" 的方法. 实现方法-1 (mshta.exe): 首先,我们要实现的就是,弹出上面的这个"文件选择对话框&q ...
- 【数据库】MySQL数据库(五)
一.DCL语句 1.添加权限: '; 注:sakili为数据库名,z1为新创建的数据库用户,123为密码 数据库添加权限 2.权限收回: revoke insert on sakila.* from ...
- 使用tap、Fragment等相关相关知识点。实现类似微信的界面
实验结果,可以实现通过左右活动来切换不同的界面.也可以通过点击不同的下方按钮来实现切换不同的界面. 自己也添加了相关的自己编写的小页面来展示相关的效果.主要的是对于碎片Fragment对于tap的相关 ...