更新I have a file with a fairly long history of changes, but I now need to have have a 2nd copy of this file within the project which will contain it's own individual changes. However, it would be exceedingly useful to be able to view the history of this copied file and see all the changes that took place on the original before the copy took place (as well as those that have taken place since the copy).感谢@Inspired 的回答.正如我在给他们的评论中所说的那样,我有错...Update我刚刚意识到它为什么不起作用:我没有通过命令行或 THG 复制文件,而是通过 Visual Studio (2010) 使用 VisualHG.VHG 必须复制文件然后添加它,而不是使用 mercurial 复制功能.所以以后要记得直接用mercurial!Thanks to @Inspired for their answer. As I said in my comment to them, I was at fault...或者更准确地说,我的猜测是 VisualHG 无法覆盖 Visual Studio 的默认功能,因此只能使用复制的文件,而不是运行 mercurial copy 命令.这纯粹是我的猜测. I just realised why it wasn't working: I didn't copy the file through either the command line or THG, but through Visual Studio (2010) using VisualHG. VHG must copy the file and then add it, rather than using the mercurial copy function. So I need to remember to use mercurial directly in the future!推荐答案从命令行,您可以发出 hg copy 解决方案.Mercurial 确实在您执行复制或重命名(hg cp/hg mv)时保存历史日志.From command line, you can issue hg copy <old name> <new name>. Mercurial does save the history log when you perform copy or rename (hg cp / hg mv).在 TortoiseHG 中复制有点棘手:您必须手动复制文件(例如通过 cp),然后在 Commit 模式下的 THG 中右键单击带有未版本控制的新文件的左下方窗格,然后选择 Detect renames.取消勾选只考虑已删除的文件,让TortoiseHG找到类似的文件,完成后点击源文件.TortoiseHG 会将新文件记录为副本.我还没有找到更简单的方法.In TortoiseHG the copy is a bit tricky: you have to copy the file manually (e.g. via cp), then in THG in Commit mode right-click at the left low pane with the unversioned new file and select Detect renames. Uncheck Only consider deleted files, let TortoiseHG find similar files and click the source file when it finishes. TortoiseHG will record the new file as a copy.I haven't found a simpler way.从命令行查看历史时,查看历史时需要指定-f(或--follow):hg log -f.TortoiseHG 已经做到了.When viewing history from command line, you need to specify -f (or --follow) when you are viewing the history: hg log -f <filename>. TortoiseHG already does that. 这篇关于在 Mercurial (TortoiseHG) 中共享相同历史记录的复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-06 23:05