在 CVS 中移动文件而不重置修订号
最近我一直在源代码树中移动源文件。 例如,将一堆文件放入一个公共程序集中。 我一直在这样做,从 CVS 中删除文件,然后将其再次添加到新位置。 问题是文件的修订号重置回 1.1。 有没有一些简单的方法可以在不重置号码的情况下移动物品?
我可能应该提到我无权访问存储库,因此任何需要的内容对我没有帮助,但可能对其他人有帮助。
Lately I've be moving source files around in our source tree. For example placing a bunch of files into a common assembly. I've been doing this my deleting the file from CVS and then adding it again in the new spot. The problem is the revision number of the file resets back to 1.1. Is there some simple way to move things without having the number reset.
I probably should have mentioned that I don't have access to the repository so anything that requires that doesn't help me but it might help others.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
实现此效果的普遍接受的方法是执行以下步骤。 其技术术语是 repocopy。
此过程将文件历史记录保留在新位置,并且不会破坏存储库的向后连续性。 如果您及时返回,该文件将正确显示在其旧位置。 您还可以使用相同的过程来重命名文件。
The generally accepted way to achieve this effect is to perform the following steps. The technical term for this is a repocopy.
This procedure maintains the file history in its new location, and also doesn't break the backward continuity of the repository. If you move back in time, the file will correctly appear in its old location. You can also use the same procedure to rename a file.
无法使用仅客户端命令来移动文件。 您需要访问服务器文件系统,并且可以将存储库中的“,v”文件移动到新位置。 这将保留所有历史记录,因为 CVS 将每个修订及其注释记录在该文件中。
请记住,删除文件后,文件将移至“Attic”子文件夹(从客户端无法看到)。 这就是文件删除后可以恢复的方法。
一般来说,这种方法不会立即出现问题,但是如果您决定查看产品的早期版本(可能依赖于以前的目录结构),则必须考虑后果!
这就是 Subversion 等其他版本控制系统具有明显优势的地方。
There is no way to move files around with client-only commands. You need access to the servers file system and can move the ",v" file in the repository to a new location. This will keep all history, since CVS records every revision and their comments in that one file.
Keep in mind that files are moved into an "Attic" subfolder (which cannot be seen from the client) when they are deleted. This is how files can be restored after they have been deleted.
Generally there are no immediate problems with this approach, however you have to consider the consequences should you decide to check out an earlier version of your product which might rely on the previous directory structure!
This is where other revision control systems like Subversion have a definitive advantage.
在线 CVS 手册 有关如何执行此操作的一些详细信息:
The online CVS manual has some detail on how to do this:
那么最简单的方法是访问您的存储库所在的 cvs 服务器,然后使用 mv 移动您的文件夹/文件(假设是 *nix 机器)。 这样文件的历史记录将被保留。
well the simplest way would be to acess the cvs server where your repo is and just move your folders/files around with mv (assuming a *nix machine). that way the history of the file will be keeped.
这不是 CVS 的已知缺陷之一 - 没有用于移动文件的内置机制吗? 然而我已经很久没有使用它了,所以也许现在有一个解决方案。
Subversion 将允许您移动文件,但这也会被跟踪,以便新文件获得最新的修订号。
Isn't this one of the known flaws with CVS - no inbuilt mechanism for moving files? It has been a long time since I used it however, so maybe there is now a solution.
Subversion will allow you to move files, but that will be tracked as well so the new file gets the most recent revision number.
它似乎保留了版本历史记录,您在移动时必须使用 -v 选项,请参见下文
It seems to keep the version history you haver to use the -v option when moving see below