We're merging materials from an SVN branch into the trunk. The materials in the trunk are modified by the merged branch materials and we commit this change to the trunk so all the files are up to date in the trunk and unmodified locally. We then open the trunk project and Unity modifies the merged materials. We aren't saving or modifying anything directly, we just open the project and the materials are changed on disk. We have version control configured correctly and have meta files committed, along with the Library files indicated in the Unity docs and nothing else. Here is the step by step workflow:
The material test.mat exists in both the branch and trunk.
Renamed test.mat in branch to test_renamed.mat
Merge trunk into branch. Tree Conflict between test.mat and test_renamed.mat
Right click tree conflict and choose Edit Conflicts. Choose Resolve (no choice for local or repo).
Updated trunk and branch.
Trunk > merge. Reintegrate branch -> trunk.
test_renamed.mat is added. test.mat is deleted.
Open trunk project in Unity.
Material is correct. Dont modify or save anything.
Check for modifications on trunk and test_renamed.mat file is changed.Why?????
Revert test_renamed.mat in trunk
Opened trunk project and get the same modification to the material again..
After doing a binary diff on the material files we realized the name of the material is written inside the file when Unity imports the material. We simply SVN renamed the material in the branch with Unity closed to be safe, but this meant that when we re-integrated this material into the trunk and opened the trunk Unity imported the material and wrote the new name inside the file. Seems like the solution is to open and close your project before doing any commits.
answered May 12 '11 at 04:50 AM