在真实的版本控制系统中跟踪文件名版本控制?
是否有一种既定的方法来告诉 SCM(在我的例子中是 Mercurial),模式 foobaz_1_2_3.csv
的文件都应该被视为 foobaz.csv
的版本?
在我的应用程序中,我依赖于外部源的数据表,该数据表将版本号放在文件名中。最近,当我花了几天时间排除我这边的错误时,却发现这是因为他们更改了一些数据内容和所述更改的通知,因此跟踪各个版本之间的更改的重要性变得非常重要没有到达我。
如果文件名是不变的,Hg 会立即通知我内部变化,我可以在一两个小时内做出适当的反应,而且压力很小。我可以养成在签入之前将 foobaz_2_3_4 重命名为 foobaz 的习惯,或者运行 diff old new
,从现在起我可能会做其中一个或两个。
整个经历让我想知道是否有其他我没有想到的方法不会弄乱外部文件。 (例如,我有一个不使用 SCM 并依赖于我已丢弃的文件名+版本号的下游用户,那该怎么办?)
Is there an established method to tell the SCM, mercurial in my case, that files of the pattern foobaz_1_2_3.csv
should all be considered versions of foobaz.csv
?
In my application I rely on data tables from an external source that put the version number in the filename. The importance of tracking changes across their versions was made painfully sharp recently when I spend days troubleshooting a bug on my side of the fence, only to discover it was because they changed some data content and notification of said change did not reach me.
If the filename was constant Hg would have informed me immediately of the internal change and I could have responded appropriately in an hour or two, with very little stress. I could just adopt the habit of renaming foobaz_2_3_4 to foobaz myself before checking in, or running diff old new
and one or both of those is likely what I'll do from now on.
The whole experience has me wondering though if there might be other methods I've not thought of that don't mess with the external file. (for example what of I have a downstream user who doesn't use SCM and relies on the filename+version number, which I've thrown away?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在文件中获取的数据具有永久更改的名称和(可能)可更改的数据,您可以:
hg addremove -s nnn(检查手册
hg help addremove
)将检测可能的重命名并将新文件包含在旧的历史记录中If you get data in file with permanently changed name and (possibly) changeable data, you can:
hg addremove -s nnn
(Check Manualhg help addremove
) will detect possible rename and include new file in history of old