使用 Mercurial/通用版本控制分解文件的正确方法?

发布于 2024-11-23 15:13:13 字数 217 浏览 3 评论 0原文

我目前有一个源文件,其中包含两个类。我想将其中一个移动到一个单独的文件中。有没有办法以类似于“hg mv”的方式来实现这一点,其中Mercurial实现新文件和旧文件部分之间的关​​系?或者在 Mercurial 看来,它是否必须像删除一个文件的一大块并创建一个全新的文件一样?我还应该遵循其他一些最佳实践吗?

如果这种跟踪确实存在,我会印象非常深刻,但这并不是 Mercurial 第一次给我带来惊喜。

I currently have a source file with two classes in it. I'd like to move one of them into a separate file. Is there any way to do this in a way similar to "hg mv" where Mercurial realizes the relationship between the new file and the part of the old file? Or does it have to look to Mercurial like a big chunk of one file was deleted and a brand new file was created? Is there some other best-practice I should be following here?

I will be very impressed if this kind of tracking actually exists, but it wouldn't be the first time Mercurial has pleasantly surprised me.

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

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

发布评论

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

评论(1

假装爱人 2024-11-30 15:13:13

您可以通过复制(hg copy)命令来完成此操作。只需创建一个副本,更改每个副本并提交即可。

You may do it via copy (hg copy) command. Just create a copy, change each copy and commit.

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