Take the 2-minute tour ×

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?)

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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
share|improve this answer
thank you, that will work perfectly (and leaves me wondering why I didn't think of it as I've used rename detection before!) –  matt wilkie Oct 4 '11 at 16:41

Your Answer


