Pregunta

I'm writing a tool to automate documentation and deployment of code for our website and I came across an anomaly while testing and it throws into doubt my understanding of changesets.

What I'm seeing is a changeset referencing files that aren't actually part of the solution (although at one point they were).

As best as I can determine this is the series of events (all but the last step happened before I joined the company and so this is all deduced from source control history) :

  • A folder is added to a project containing around a dozen txt files which serve as templates for e-mails and these are checked in to TFS
  • 2 weeks later four of the txt files are removed from the project but not physically deleted
  • 2 years later a developer had a task to update e-mail templates and changed all the txt files in the folder including the four that aren't "in" the project
  • Developer checks in his changes resulting in Changeset X

When I look at Changeset X and its list of changes it includes an "edit" to each of the txt files including the four removed files. I've checked the CSPROJ file and there is definitely no reference to the removed files in there at the point the changeset was made.

When my code iterates through all the changes in the changeset it tries to marry up the changed file to the project it belongs to in order to identify what file(s) need to be deployed as a result of the change - ie if its .html or .jpg then it just gets copied but if its source code then I need to deploy the associated binary that gets compiled from the file). So when it finds these files and tries to find a project that they belong to it fails.

Should the changeset reference these removed files or is it a bug in TFS? Or could it be something that happened when the code was migrated from TFS 2008 to TFS 2012 at some time in the 2 years before the two changesets? If its not a bug then in what circumstances would you expect TFS to track changes to files not in the project?

I've tried to replicate it by setting up a totally new project and adding it to source control and then adding, removing and editing an associated text file but I can't get it to behave in the same way.

¿Fue útil?

Solución

TFS is right. Visual Studio Solutions are a nice interface for visually managing a subset of files in Version Control. It is common to have more than one solution and change files in multiple places, but still is a single logical change that I want to record as a single changeset.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top