IDE generates USEFORM macros by changing their order

We have a C ++ Builder XE project (VCL Forms application), in which there are several dozen forms and units. Whenever a file belonging to a project is added, deleted, or renamed, the IDE must do two things:

  • A USEFORM macro call is added or modified in the project source file (ProjectName.cpp) if the affected element is a form or frame
  • Added or modified CppCompile element in the project file (ProjectName.cbproj)

However, instead of making the necessary changes, the IDE moves some of the existing USEFORM and CppCompile entries, even if they are not subject to change. If I add Unit (cpp and header file), USEFORMs are shuffled, even if it does not require any changes to the Source Project, only for the cbproj file.

I do not see a specific template about how the new order is formed. If I edit or rename one unit, about half of the USEFORMs seem to change position and only a couple or none of the CppCompile entries. If changing a copy of a project is done on two different machines, most of the changes seem to be similar, but not all. This means that reordering is not random.

Behavior causes problems when using Subversion to merge changes, because it forces you to manually resolve conflicts caused by the changing order.

So the question is: what can cause the above behavior and how to get rid of it?

+7
source share
1 answer

I could not find the correct solution to the problem, but here is a simple way to make it somewhat less annoying:

Adopt a policy to never make accidental changes created using the IDE to the version control repository. Whenever you make changes to code that causes file mixing, return any unnecessary changes to ProjectName.cpp and ProjectName.cbproj . At the moment, it’s still pretty easy, since you know which parts of the files really should have changed. Thus, manual labor is performed when it still requires a minimum amount of work. In addition, the work should be performed only once, unlike changes in the pristine changes, in which case the work must be repeated every time someone combines the changes.

+1
source

All Articles