Contributing to TWCore: Committing/submitting your changes

Have you finished your code, made it compliant to the Programming guidelines and tested it completely? Then you're ready to commit your code to the TWCore source repository so it can be reviewed!

This guide describes how to commit code using Subclipse in Eclipse.

Committing using the Team Synchronizing perspective

From the Team Synchronizing perspective you can compare your local workspace to the online source code repository. Once compared you can commit your changes or update your local copy to the changes in the repository.

  1. As the title says, we need to switch to the Team Synchronizing perspective. Since you probably haven't opened that perspective before (and thus there isn't a perspective switcher button for it yet), use the Open Perspective button and select "Other…" to choose the Team Synchronizing perspective (see the picture at the right).

Tip: Right-click a button of the Perspective Switcher toolbar and uncheck "Show Text" to decrease the size of the buttons and make the buttons fit better.

  1. Click the synchronize button (see the picture at the right). (You only need to set the settings once, the next time it will synchronize immediately.)
  2. In the new Synchronize window, click on the SVN option and click Next.
  3. Choose what resource to synchronize: Click the Workspace radiobutton under "Scope" or only select the TWCore project.
  4. Click Finish to start synchronizing.
  5. If Eclipse asks you for your username/password, enter the username/password you use here too.
  6. Once done synchronizing you'll see a tree with files at the left when changes are detected.

    Each file can have one of the following (or multiple combined) icons which represent a certain change:
    • = (The contents of) a folder has been changed in the repository.
    • = (The contents of) a file has been changed in the repository.
    • = A complete new file has been added to the repository but isn't in your workspace.
    • = (The contents of) a file has been changed in your workspace.
    • = A complete new file has been added to your workspace but doesn't exist in the repository.
    • = (The contents of) a file has been changed in the repository but also in your workspace. This is called a conflict.
    • Each of these icons can have a or that shows if the file contains compilation errors and/or warnings.
  7. Double-click a file to see the specific changes in the compare editor at the right.
  8. Depending on the change, do the following:
    • For files marked by the blue arrow (change in the repository), right-click and click "Update" to update your local files with the changes from the repository
      Tip: To update multiple files at the same time, select multiple files using Ctrl or Shift, right-click and click "Update".
      Tip2: To update all files at the same time you can right-click your project and click "Update".

    • For files marked by the black arrow (local change), right-click and click "Commit…" to commit your local changes to the repository. Eclipse will ask you for your username/password (if necessary) and a commit message. Always specify a commit message where you describe what the change contains, why you have changed it and/or referring to a specific ticket.

    • If you have any conflicting files (marked with the red arrow: ) you must solve this conflict first before updating and/or committing the changes. Double-click the conflicting file and check which parts are conflicting (marked with red). Change the contents of your local file to resolve the conflict. If you have resolved the conflict but there is still a conflict showing, you can right-click the file and click "Mark as Merged". This will reset the file and any changes you still have can be committed.
      Tip: If your local changes are neglectible you can override your local changes by choosing "Override and Update" from the right-click menu.

Note: You don't have to commit/update everything. Sometimes you'll find files that don't belong in the repository. You can have the repository ignore these files by choosing "Add to svn:ignore" from the right-click menu. However, only do this to files that should be ignored by other developers too (and you're sure they can be ignored).

If everything went well then you have committed your work successfully! You can check the timeline to see your changes summarized in a changeset.

Committing "blind"

From the Java Perspective it's possible to commit your changes "blind": unaware of any other changes that were made. You can do this by clicking a changed file (marked by the ), right-click and choose Team / Commit… .

It's strongly recommended to commit your changes using the Synchronizing perspective (not committing "blind") since that enables you to see other changes and solve any conflicts at the same time.

Attachments