SVN:为大量修订创建差异

发布于 2024-08-07 11:47:38 字数 257 浏览 5 评论 0原文

我有一个私人分支,我对其进行了大量提交,然后将其合并到主干中,并在那里做了一些小调整。

现在,主干维护者希望与我的所有更改进行比较,以防我们需要回滚。

我怎样才能创建这个?如果您的示例需要数字,请假设

224446

是我合并到主干的主要修订版本,

224453224462

是我的小修复,在我的私人分支机构中,我经历了无数的变化。

I had a private branch that I did a ton of commits to, then I merged it into trunk, and did a few little tweaks there.

Now the trunk maintainer wants a diff off all of my changes incase we need a rollback.

How can I create this? If you need numbers for your examples, assume that

224446

was my main revision where I merged into trunk,

224453 and 224462

were my minor fixes, and I have countless changes when in my private branch.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我偏爱纯白色 2024-08-14 11:47:38

一种可能的过程是:

  1. 为 224453 和 224462 创建差异(例如通过 svn diff -r 224452:224463 > diff1.patch)。
  2. 查看 224446 (svn up -r224446)
  3. 应用差异(例如 patch -p0 -i diff1.patch
  4. 创建针对 224445 的差异 (svn diff -r 224445 > diff2.patch)

One possible procedure would be to do this:

  1. Create diffs for 224453 and 224462 (e.g. by svn diff -r 224452:224463 > diff1.patch).
  2. Check out 224446 (svn up -r224446)
  3. Apply the diffs (e.g. patch -p0 -i diff1.patch)
  4. Create a diff of that against 224445 (svn diff -r 224445 > diff2.patch)
扮仙女 2024-08-14 11:47:38

一种选择是在 224446 处创建一个分支,然后合并 224453 和 224462。然后在主干上将其与 224445 进行比较。这应该是所有更改合而为一,如果需要,您可以将其创建为补丁文件:

# Branch from your initial checkin
svn cp svn://xyz/trunk@224446 svn://xyz/branches/foo

# Check it out
svn checkout svn://xyz/branches/foo tmp

# Merge in the two changes
svn merge -c 224453,224462 svn://xyz/trunk tmp

# Commit the changes
svn commit tmp -m "Extra commits 224453 and 224462"

# Diff the branch from mainline before original
svn diff svn://xyz/trunk@224445 svn://xyz/branches/foo

这与 Martin 的答案基本相同,只是应用更改和获取差异的方式不同。请注意,虽然在本例中我已经提交了更改,但您实际上不必这样做 - 您可以只执行 svn diff svn://xyz/trunk@224445 tmp 而不是最后两个命令。将其放在存储库中的好处是,如果需要的话,任何人都可以反向应用差异来回滚它。

One option would be to create a branch at 224446, then merge in 224453 and 224462. Then take a diff between that and 224445 on the trunk. That should be all the changes in one, and you can create it as a patch file should you need to:

# Branch from your initial checkin
svn cp svn://xyz/trunk@224446 svn://xyz/branches/foo

# Check it out
svn checkout svn://xyz/branches/foo tmp

# Merge in the two changes
svn merge -c 224453,224462 svn://xyz/trunk tmp

# Commit the changes
svn commit tmp -m "Extra commits 224453 and 224462"

# Diff the branch from mainline before original
svn diff svn://xyz/trunk@224445 svn://xyz/branches/foo

This is largely the same as Martin's answer, just with different ways of applying the changes and getting the diffs. Note that although in this case I've committed the changes, you don't really have to - you could just do svn diff svn://xyz/trunk@224445 tmp instead of the last two commands. The nice thing about having it in the repository is then anyone can apply the diff in reverse to roll it back, should that be required.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文