[原]Faint, 现在俺知道咋将一个历史的版本变成trunk了
最近我遇到一个问题,因为我将那个Subversion 的trunk改得乱糟糟的,想改回去都郁闷,一个一个改,还怕改不对,有没有一种方法直接将一个历史的版本覆盖当前的trunk呢?我研究了n久之后,现在终于找到方法了,faint,很郁闷,没有一条直接的命令可以实现这个东东,但是我们可以简介的实现:)
这个方法就是:
大家听好啦,我觉得这个会非常有用的,呵呵,其实我以前经常碰到这个问题,但是变动不大,所以就手动改回去了,现在,手动改回去似乎很麻烦,所以需要一种自动的方法来实现这个目的,。
我在网上找啊找的找,就是没有找到,faint,现在,我找到了,请原谅我这么啰嗦,实在太激动了,而且我万年难得写一篇博客,所以,:)
下面进入正题
其实就是通过merge实现,怎么实现呢?
通过TSVN的文档可以知道,它有三个选项
faint,其实你右键也可以找到这三个选项,因为鄙人用的是英文版的,懒啊,不装中文包的后果,虽然我经常与这三个选项照面,但是总是随意选取一个就处理,额,不经过大脑的表现,但是上一次,我认真的看了一下这三个选项,并一一尝试,后来发觉第三个选项有点诡异:)
Merge two different trees
This is a more general case of the reintegrate method. What you are asking Subversion to do is: “Calculate the changes necessary to get [FROM] the head revision of the trunk [TO] the head revision of the branch, and apply those changes to my working copy (of the trunk).” The net result is that trunk now looks exactly like the branch.
If your server/repository does not support merge-tracking then this is the only way to merge a branch back to trunk. Another use case occurs when you are using vendor branches and you need to merge the changes following a new vendor drop into your trunk code. For more information read the chapter vendor branches in the Subversion Book.
就是说找 目录x的第Vx个版本 与 目录y的第Vy个版本 之间的差异,然后把这个差异应用到 你要施加改变的目录上。那么给定如下命令 , 当然目录x的第Vx个版本是基,
那么我们已trunk目录的HEAD vesion为基,以一个trunk历史的版本为Vy,然后吧他们之间的差异应用到trunk上么,那么提交之后trunk的HEAD就变成了这个历史的版本啦:)
相当于
x +( y -x) = y , x就是当前的trunk y就是历史的版本
mmm,游戏结束