Subversion Partial Commit

Sometimes you make several unrelated changes to files while programming and want to commit these to the repository into separate revisions. GIT has built-in tools for handling this, however with subversion it is much harder. Here is a simple script that assists in the task of doing partial commit with subversion.

This script does several tasks for you. It will copy the changed files to a backup folder, revert the changes and use kompare to copy selected changes back to the code tree. Then it will make a commit after which the changed files will be copied back to the code tree, allowing the user to make a second partial commit.

  1. Install the required tools: subversion, kompare and the script.
  2. Do a backup of your changes, until the script has been extensively tested.
  3. Execute svn-ci-partial when in your code tree.
  4. Select changes using the automatically opened kompare window. Only one file at a time will be treated, due to limitations in kompare. Save the selected changes and close the window.
  5. Subversion will open your default commit message editor where you edit your description of the commit. Save and exit the editor and the commit will be executed.
  6. The script will automatically copy back all uncommited changes, however do check if this is true before removing your backup.