sed 示例

在匹配到的行尾添加:

删除匹配后的N行(delete n lines following a pattern)or (delete n lines after match/matches)

如果匹配到的行不需要删除

 

正则替换:

将 “craete time: 1988-02-02 11:22:12″ 替换为”craete time: 1988-02-02T11:22:12”

  1. 使用 -r
  2. 反向引用

 

参考资料: http://blog.csdn.net/holandstone/article/details/8488434

http://stackoverflow.com/questions/4396974/sed-or-awk-delete-n-lines-following-a-pattern

http://stackoverflow.com/questions/8323287/how-can-i-use-sed-to-delete-2-lines-after-match-matches

 

 

svn 1.7手册

http://svnbook.red-bean.com/en/1.7/

 

Examining History

Your Subversion repository is like a time machine. It keeps a record of every change ever committed and allows you to explore this history by examining previous versions of files and directories as well as the metadata that accompanies them. With a single Subversion command, you can check out the repository (or restore an existing working copy) exactly as it was at any date or revision number in the past. However, sometimes you just want to peer into the past instead of going into it.

Several commands can provide you with historical data from the repository:

svn diff
Shows line-level details of a particular change

svn log
Shows you broad information: log messages with date and author information attached to revisions and which paths changed in each revision

svn cat
Retrieves a file as it existed in a particular revision number and displays it on your screen

svn annotate
Retrieves a human-readable file as it existed in a particular revision number, displaying its contents in a tabular form with last-changed information attributed to each line of the file.

svn list
Displays the files in a directory for any given revision

 

more…

理解SVN关键词BASE,HEAD,COMMITTED,PREV

SVN是以版本号(revision number)来记录版本库的每一次改变,一般的SVN操作不需要用到版本号,但是有些SVN操作需要指定版本号。我们可以指定一个明确的整数版本号,但是也可以使用SVN关键字来指代某个特殊的版本号,SVN会真正计算出它所指代的实际整数版本号:

HEAD:版本库中最新的版本;

BASE:某个工作副本项的版本,注意这个是你上次update该项时的版本号,可能晚于当前最新的版本号;

COMMITTED:某个工作副本项最近修改的版本,与BASE相同或更早;

PREV:COMMITTED – 1。

HEAD针对于版本库,另外3个针对于某个工作副本目录或文件。

示例:

$ svn diff -r PREV:COMMITTED foo.c
# shows the last change committed to foo.c
$ svn log -r HEAD
# shows log message for the latest repository commit
$ svn diff -r HEAD
# compares your working copy (with all of its local changes) to the latest version of that tree in the repository
$ svn diff -r BASE:HEAD foo.c
# compares the unmodified version of foo.c with the latest version of foo.c in the repository
$ svn log -r BASE:HEAD
# shows all commit logs for the current versioned directory since you last updated
$ svn update -r PREV foo.c
# rewinds the last change on foo.c, decreasing foo.c’s working revision
$ svn diff -r BASE:14 foo.c
# compares the unmodified version of foo.c with the way foo.c looked in revision 14

 

原文链接: http://www.cnblogs.com/frydsh/archive/2012/08/25/2655569.html