SVN将中继合并到分支删除文件中 [英] SVN merge trunk into branch deleting files

查看:131
本文介绍了SVN将中继合并到分支删除文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试做一些看似简单但又有问题的事情.

I am trying to do something seemingly simple, yet having problems.

基本上,我有一个svn存储库,它有一个主干和一个从修订版122创建的分支.

Basically, I have an svn repo, it has a trunk and a branch which was created from revision 122.

我向分支添加了一个文件(src/utils/foo.py),并将其提交为修订版128,一切都很好.

I added a file (src/utils/foo.py) to the branch, committed it as revision 128, all good.

但是,我想在分支中对主干执行几次提交(即(123,124,125,126,127).所以我要做类似的事情:

However, there have been several commits (namely (123,124,125,126,127) in to the trunk that I'd like in my branch. So I do something like:

$ svn merge -r122:127 ^/projects/my_project/trunk/src/utils .
--- Merging r123 through r127 into '.':
D    foo.py

哇!它删除了我的文件!我在做什么错,这样就不会发生?

Whoops! It deleted my file! What am I doing wrong so that this doesn't happen?

推荐答案

与拥有文件的文件夹相比,与文件本身有更多关系.我相信大多数SCM工具都会像对待文件一样对待文件夹,因为它们也会得到版本控制.您可能需要上一层,以确保"utils"文件夹也被合并.

It may have more to do with the folder that owns the file, than the file itself. I believe most SCM tools treat folders like files in that they get versioned as well. You might need to go up one level to make sure that the "utils" folder gets merged over also.

仅需解释一下,是文件夹"utils"记录了文件"foo.py"是其子文件,因此即使foo.py存在于主干中,也不会合并更新的utils文件夹可能不会显示.

Just to explain a bit more, it is the folder "utils" that records that the file "foo.py" is a child of it, so even if foo.py exists in trunk, without merging the updated utils folder it may not display.

这篇关于SVN将中继合并到分支删除文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆