Comment collaborer sur des projets avec SVN

1

Index

Taggé

Statistiques

7,163 visites, 13,771 vues

Outils

Partager

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 2 Jul, 2018. Last updated 25 Feb, 2019

Modifying the project in Construct 2

Open the project on SVN in Construct 2. Add a Sprite and draw an image for it. Save the project and close Construct 2. Notice how the SVN folder changes:

Here we can clearly see: the events haven't been changed, but the project file and a layout was changed, and there's a new Animations folder.

Right-click the parent folder (to make sure we operate on the entire project) and select SVN Commit again.

Notice here it's listed two modified files: the layout (since a instance was placed on the layout), and the project file (since a new object type was added). Over time you'll learn which files store which kinds of information, and which files are modified by certain changes in the editor.

Also note a new file has been added, for the Sprite's animation frame image. SVN has not been set to ignore this file, but it also has not been explicitly added. TortoiseSVN is showing it because it thinks you might want to add it (and Show unversioned files is ticked). You must tick the box by the new file to add it and have it sent to the server - if you don't, other clients won't get the file and Construct 2 will start throwing up errors about about missing images. It's really handy that TortoiseSVN lists it as a suggestion, since it helps us avoid forgetting to add new files that are added while editing the project. On the other hand, remember to actually tick the box for new files! (Check: All along the top is a quick way to do this.) Remember if you add layouts, event sheets, audio or project files, new files will also be created and need to be added.

Before you click OK to commit, here's another great feature. Double-click one of the modified files. TortoiseSVN highlights exactly what you've changed. Below is an example showing the XML that's been added to the layout file given that a new instance has been placed on it.

Admittedly, it's quite text heavy for what is a visual change in the editor. On the other hand it's useful to highlight which section of the file was changed. On the left, you can see the old version, with a grey space showing it used to be empty there, and on the right in yellow is the new content. We can also spot various properties of the object, such as its position and size. Also when making smaller changes like changing a single property, this view should very clearly show what it used to be, and what the new value is.

When committing, it's very useful to review your changes. You can often catch mistakes before sending them off to the server this way. Remember to also tick the checkboxes to add new files, and write a good commit message.

There are lots of other features in the commit dialog, like being able to revert particular changes if you change your mind. You can find out more about these from the TortoiseSVN documentation.

Click OK on the commit dialog and off it goes to the server. Update on one of the other clients. Notice the update log lists the files that have been added and updated. Open the project in Construct 2... and you should see the newly added sprite is there!

Renaming items

Rename the sprite to something else, and save the project. Commit the root directory.

The commit dialog now lists the old files and folders referring to the old sprite name as missing, and the new files and folders referring to the new sprite name as non-versioned. That's because all the files got renamed, so TortoiseSVN thinks the old files got deleted, and the new files were added. As before, just Check all, and the old files will be deleted from SVN and the new files added. The process is similar when renaming layouts, event sheets and project files - the old files get deleted and the new files get added. (TortoiseSVN does provide a 'rename' option, but since Construct 2 renames files automatically this is the easiest way to handle it.)

Warning: if you SVN Update after renaming something but before committing, SVN will simply re-download the missing files with the old name from the server. These files will be redundant, so to avoid this make renames a small and quick commit (update, rename, immediately commit). If you do end up with redundant files, you can SVN delete them (via the TortoiseSVN right-click menu) and commit to remove them from the server.

Hopefully now you are comfortable with making changes and updating with SVN. The remaining pages will cover some extras like conflict resolution and the useful tools TortoiseSVN provides.

  • 0 Comments

Want to leave a comment? Login or Register an account!