开发者

tracking file-name version control in a real version control system?

开发者 https://www.devze.com 2023-04-10 03:25 出处:网络
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 ?

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 开发者_如何学PythonSCM and relies on the filename+version number, which I've thrown away?)


If you get data in file with permanently changed name and (possibly) changeable data, you can:

  • Store data-file under version-control (mercurial is OK)
  • replace old file with new every time
  • hg addremove -s nnn (Check Manual hg help addremove) will detect possible rename and include new file in history of old
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号