4

In SVN you can use some keyword expansion to put your revision number inside source files. I find this particularly useful on SQL scripts.

Using TFS2010, how can I put the changeset number inside a source file ?

Community
  • 1
  • 1
Machado
  • 741
  • 2
  • 6
  • 19
  • Why is it useful? Can't you just query the source control history when you actually need to know about the changeset? – John Saunders Apr 20 '12 at 19:45
  • I'd like to know why you find this useful – Jupaol Apr 20 '12 at 20:38
  • 1
    To control part of my production environment. Many people (not just from the IT-DEV team) can make changes on SQL scripts on my current job, and sometimes, after a database restore do development environment, we find that some key functions and procedure were changed, and with the changeset I can track if the routine changed matches the one on the source control. – Machado Apr 21 '12 at 00:25

1 Answers1

3

If you really must insert the current changeset number in a file, you can use the Keyword Substitution Check-in Policy.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • 1
    Nice, but seems a bit complicate. Doesn't TFS have a built-in support for this ? – Machado Apr 21 '12 at 00:27
  • 1
    No. And, although I'm biased, having worked on a TFS client for several years, I think that changing the contents of your files after checking them in and having them appear "unmodified" is perhaps not intuitive. – Edward Thomson Apr 21 '12 at 05:00