How to commit changes to SVN

From The DarkMod Wiki
Revision as of 10:42, 27 November 2007 by Greebo (talk | contribs) (New page: This tutorial assumes that you have a Working Copy of the darkmod repository checked out on your hard drive, in the folder C:\Games\Doom3. Furthermore, it's a...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This tutorial assumes that you have a Working Copy of the darkmod repository checked out on your hard drive, in the folder C:\Games\Doom3. Furthermore, it's aimed at TortoiseSVN users.

Initial Situation

The initial situation looks like this:

Svn commit 1.jpg

This is my current darkmod/ folder. As you notice, nearly all files are marked green (see also What are the red and green icons for?), apart from my maps/ folder. This means that one or more files in that folder have been changed by me and they are different to the versions on the SVN Server. A few files don't have icons at all, meaning that these files are not under version control.

Make your change

As first step, we are going to change a shader in one of the .mtr files. Let's go into the materials/ folder and open the target file in our favourite text editor. I'll take the player_equipment.mtr file and will add a comment to one of the shaders:

Svn commit 2.jpg >> Svn commit 3.jpg

As soon as you save your change in the text editor, you'll notice that the icon of the changed file will change from green to red. This means that TortoiseSVN has detected a difference in the file and that it will be considered for the next upload.

Prepare for commit

Now that we've finished editing our file we can get ready for sending/uploading it into the repository. (This process is called "Commit" as you might have expected). Right-click the materials/ folder and choose SVN Commit...:

Svn commit 4.jpg >> Svn commit 5.jpg

In the following SVN commit dialog you will be asked to enter a log message describing your commit. Enter a brief message here to indicate what you've done with that commit (and perhaps why). In the list in the lower half of the dialog you see the list of files that will be affected by your commit operation. In our example, this is just the player_equipment.mtr file, which is ok. (If you changed another file in the same folder, it would be committed too, which might be undesired in some situations.) You can now uncheck any files if you want to exclude them from your operation. In our case, we're happy with our selection and we can proceed to commit, click OK:

Svn commit 6.jpg

You might need to enter your authentication details, in case you haven't committed anything yet or do not want to let TortoiseSVN to save your password. Once you entered your username/password, the commit progress dialog will be displayed, this should be finished fairly quickly, given our small change.

Background note: SVN is clever and only sends the actual difference of text-based files to the server. However, for binary files like textures this is not possible and SVN will upload the entire file. In any case, the data is compressed to save bandwidth.

Congratulations, you have committed your first file! By committing a change to the file you also increased the revision number of the repository ("Done, at revision 3982").

As soon as the commit operation is finished, the icon of that file goes back to green and an automatic mail is sent to all other Team Members to notify them about your change, including your username, your log message and the files you've changed.