Index: versioncontrol.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/versioncontrol.drush.inc,v
retrieving revision 1.9
diff -u -p -r1.9 versioncontrol.drush.inc
--- versioncontrol.drush.inc	6 Jan 2011 00:51:16 -0000	1.9
+++ versioncontrol.drush.inc	12 Jan 2011 01:27:33 -0000
@@ -20,7 +20,8 @@ function versioncontrol_drush_command() 
     ),
     'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
   );
-  $items['vcapi-map-operations'] = array(
+  $items['vcapi-map-commits'] = array(
+    'aliases' => array('vcapi-map-operations'),
     'description' => "Attempt to map author & committer data in tracked commits/operations to Drupal users. By default, only unmapped operations will be attempted.",
     'arguments' => array(
       'repositories' => 'A comma-delimited list of repository ids or shortnames. Mixing and matching names and ids is fine.',
@@ -49,6 +50,7 @@ function versioncontrol_drush_help($sect
   switch ($section) {
     case 'drush:vcapi-parse-logs':
       return dt("This command will fetch all new activity in the repositories listed on the command line. If no repositories are given, log fetching will be triggered on all repositories.");
+    case 'drush:vcapi-map-commits':
     case 'drush:vcapi-map-operations':
       return dt("This command will attempt to map raw operation author/committer data to known Drupal accounts.");
   }
@@ -114,7 +116,7 @@ function drush_versioncontrol_vcapi_pars
   drush_backend_batch_process();
 }
 
-function drush_versioncontrol_vcapi_map_operations() {
+function drush_versioncontrol_vcapi_map_commits() {
   $repos = array();
   if ($discover = drush_get_option('discover', FALSE)) {
     $ids = db_select('versioncontrol_operations', 'vco')
Index: versioncontrol.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/versioncontrol.info,v
retrieving revision 1.11
diff -u -p -r1.11 versioncontrol.info
--- versioncontrol.info	3 Jan 2011 16:09:20 -0000	1.11
+++ versioncontrol.info	12 Jan 2011 01:27:33 -0000
@@ -9,6 +9,7 @@ files[] = includes/VersioncontrolBackend
 files[] = includes/VersioncontrolBranch.php
 files[] = includes/VersioncontrolItem.php
 files[] = includes/VersioncontrolOperation.php
+files[] = includes/VersioncontrolCommit.php
 files[] = includes/VersioncontrolRepository.php
 files[] = includes/VersioncontrolTag.php
 files[] = includes/interfaces.inc
Index: versioncontrol.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/versioncontrol.module,v
retrieving revision 1.194
diff -u -p -r1.194 versioncontrol.module
--- versioncontrol.module	11 Jan 2011 09:29:53 -0000	1.194
+++ versioncontrol.module	12 Jan 2011 01:27:34 -0000
@@ -87,7 +87,7 @@ define('VERSIONCONTROL_ITEM_DIRECTORY', 
  * Only used for items that don't exist in the repository (anymore), at least
  * not in the given revision. That is mostly the case with items that
  * were deleted by a commit and are returned as result by
- * VersioncontrolOperation::getItems(). A "deleted file" can also be
+ * VersioncontrolCommit::getItems(). A "deleted file" can also be
  * returned by directory listings for CVS, representing "dead files".
  */
 //@{
@@ -416,7 +416,7 @@ function _versioncontrol_get_fallback_au
  *   The repository that the items are located in.
  * @param $items
  *   An array of item arrays, for example as returned by
- *   VersioncontrolOperation::getItems().
+ *   VersioncontrolCommit::getItems().
  *
  * @return
  *   This function does not have a return value; instead, it alters the
@@ -522,7 +522,7 @@ function versioncontrol_fetch_source_ite
  *   The repository that the items are located in.
  * @param $items
  *   An array of item arrays, for example as returned by
- *   VersioncontrolOperation::getItems().
+ *   VersioncontrolCommit::getItems().
  *
  * @return
  *   This function does not have a return value; instead, it alters the
@@ -733,7 +733,7 @@ function theme_versioncontrol_account_us
  *
  * @param $statistics
  *   An array of statistics objects as returned by
- *   versioncontrol_get_operation_statistics(), grouped by at least uid and
+ *   versioncontrol_get_commit_statistics(), grouped by at least uid and
  *   optionally repo_id/username columns.
  * @param $options
  *   An array of optional further options. Currently, the only supported
@@ -747,14 +747,14 @@ function theme_versioncontrol_user_stati
   $rows = array();
 
   foreach ($statistics as $user_stats) {
-    $last_operation_date = t('!time ago', array(
-      '!time' => format_interval(time() - $user_stats->last_operation_date, 1),
+    $last_commit_date = t('!time ago', array(
+      '!time' => format_interval(time() - $user_stats->last_commit_date, 1),
     ));
-    $first_operation_date = t('!time ago', array(
-      '!time' => format_interval(time() - $user_stats->first_operation_date, 1),
+    $first_commit_date = t('!time ago', array(
+      '!time' => format_interval(time() - $user_stats->first_commit_date, 1),
     ));
-    $total_operations = format_plural(
-      $user_stats->total_operations, '1 commit', '@count commits'
+    $total_commits = format_plural(
+      $user_stats->total_commits, '1 commit', '@count commits'
     );
 
     if (isset($options['constraints']) && module_exists('commitlog')) {
@@ -765,14 +765,14 @@ function theme_versioncontrol_user_stati
       else {
         $options['constraints']['uids'] = array($user_stats->uid);
       }
-      $total_operations = l($total_operations, commitlog_get_url($options['constraints']));
+      $total_commits = l($total_commits, commitlog_get_url($options['constraints']));
     }
 
     $rows[] = array(
       theme('versioncontrol_user_statistics_account', $user_stats),
-      $last_operation_date,
-      $first_operation_date,
-      $total_operations,
+      $last_commit_date,
+      $first_commit_date,
+      $total_commits,
     );
   }
   return theme('table', $header, $rows);
@@ -784,7 +784,7 @@ function theme_versioncontrol_user_stati
  *
  * @param $statistics
  *   An array of statistics objects as returned by
- *   versioncontrol_get_operation_statistics(), grouped by at least uid and
+ *   versioncontrol_get_commit_statistics(), grouped by at least uid and
  *   optionally repo_id/username columns.
  */
 function theme_versioncontrol_user_statistics_item_list($statistics, $more_link = NULL) {
@@ -800,15 +800,15 @@ function theme_versioncontrol_user_stati
     $item .= t('!committer - !commit-count', array(
       '!committer' => theme('versioncontrol_user_statistics_account', $user_stats),
       '!commit-count' => '<span class="versioncontrol-commit-count">'
-        . format_plural($user_stats->total_operations, '1 commit', '@count commits')
+        . format_plural($user_stats->total_commits, '1 commit', '@count commits')
         . '</span>',
     ));
 
-    if (!empty($user_stats->first_operation_date)) { // has committed yet?
+    if (!empty($user_stats->first_commit_date)) { // has committed yet?
       $item .= '<div class="versioncontrol-commit-times">';
       $item .= t('last: !last_time ago, first: !first_time ago', array(
-        '!last_time' => format_interval(time() - $user_stats->last_operation_date, 1),
-        '!first_time' => format_interval(time() - $user_stats->first_operation_date, 1),
+        '!last_time' => format_interval(time() - $user_stats->last_commit_date, 1),
+        '!first_time' => format_interval(time() - $user_stats->first_commit_date, 1),
       ));
       $item .= '</div>';
     }
Index: includes/VersioncontrolBackend.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/VersioncontrolBackend.php,v
retrieving revision 1.14
diff -u -p -r1.14 VersioncontrolBackend.php
--- includes/VersioncontrolBackend.php	10 Jan 2011 04:35:30 -0000	1.14
+++ includes/VersioncontrolBackend.php	12 Jan 2011 01:27:34 -0000
@@ -74,6 +74,7 @@ abstract class VersioncontrolBackend {
       'repo'      => 'VersioncontrolRepositoryController',
       'account'   => 'VersioncontrolAccountController',
       'operation' => 'VersioncontrolOperationController',
+      'commit'    => 'VersioncontrolCommitController',
       'item'      => 'VersioncontrolItemController',
       'branch'    => 'VersioncontrolBranchController',
       'tag'       => 'VersioncontrolTagController',
@@ -84,6 +85,7 @@ abstract class VersioncontrolBackend {
       'repo'      => 'VersioncontrolRepository',
       'account'   => 'VersioncontrolAccount',
       'operation' => 'VersioncontrolOperation',
+      'commit'    => 'VersioncontrolCommit',
       'item'      => 'VersioncontrolItem',
       'branch'    => 'VersioncontrolBranch',
       'tag'       => 'VersioncontrolTag',
Index: includes/VersioncontrolBranch.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/VersioncontrolBranch.php,v
retrieving revision 1.9
diff -u -p -r1.9 VersioncontrolBranch.php
--- includes/VersioncontrolBranch.php	27 Nov 2010 19:07:55 -0000	1.9
+++ includes/VersioncontrolBranch.php	12 Jan 2011 01:27:34 -0000
@@ -64,7 +64,7 @@ class VersioncontrolBranch extends Versi
    */
   public function loadCommits($ids = array(), $conditions = array(), $options = array()) {
     $conditions['branches'] = array($this->label_id);
-    return $this->backend->loadEntities('operation', $ids, $conditions, $options);
+    return $this->backend->loadEntities('commit', $ids, $conditions, $options);
   }
 
   public function update($options = array()) {
Index: includes/VersioncontrolCommit.php
===================================================================
RCS file: includes/VersioncontrolCommit.php
diff -N includes/VersioncontrolCommit.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/VersioncontrolCommit.php	12 Jan 2011 01:27:34 -0000
@@ -0,0 +1,116 @@
+<?php
+// $Id$
+/**
+ * @file
+ * Commit class
+ */
+
+/**
+ * Represents a repository commit.
+ */
+class VersioncontrolCommit extends VersioncontrolOperation {
+  public $type = VERSIONCONTROL_OPERATION_COMMIT;
+
+  /**
+   * Implementation of abstract method.
+   */
+  public function getSelectedLabel($target_item) {
+    // How CVS and many other version control systems will probably do it,
+    // as they have exactly one label assigned to each operation.
+    return $operation->labels[0];
+
+    // If an operation - or more specifically, a commit - applies to multiple
+    // branches and/or tags (as can happen in SVN, for example), then the correct
+    // label for each item has to be determined.
+  }
+
+  public function insert($options = array()) {
+    if (!empty($this->vc_op_id)) {
+      // This is supposed to be a new commit, but has a vc_op_id already.
+      throw new Exception('Attempted to insert a Versioncontrol commit which is already present in the database.', E_ERROR);
+    }
+
+    // Append default options.
+    $options += $this->defaultCrudOptions['insert'];
+
+    if ($options['map users']) {
+      $this->mapUsers();
+    }
+
+    // make sure repo id is set for drupal_write_record()
+    if (empty($this->repo_id)) {
+      $this->repo_id = $this->repository->repo_id;
+    }
+    drupal_write_record('versioncontrol_operations', $this);
+
+    if (!empty($options['nested'])) {
+      $this->insertNested();
+    }
+
+    $this->backendInsert($options);
+
+    // Everything's done, invoke the hook.
+    module_invoke_all('versioncontrol_entity_commit_insert', $this);
+    return $this;
+  }
+
+  public function update($options = array()) {
+    if (empty($this->vc_op_id)) {
+      // This is supposed to be an existing branch, but has no vc_op_id.
+      throw new Exception('Attempted to update a Versioncontrol commit which has not yet been inserted in the database.', E_ERROR);
+    }
+
+    // Append default options.
+    $options += $this->defaultCrudOptions['update'];
+
+    if ($options['map users']) {
+      $this->mapUsers();
+    }
+
+    // make sure repo id is set for drupal_write_record()
+    if (empty($this->repo_id)) {
+      $this->repo_id = $this->repository->repo_id;
+    }
+    drupal_write_record('versioncontrol_operations', $this, 'vc_op_id');
+
+    if (!empty($options['nested'])) {
+      $this->updateNested();
+    }
+
+    $this->backendUpdate($options);
+
+    // Everything's done, invoke the hook.
+    module_invoke_all('versioncontrol_entity_commit_update', $this);
+    return $this;
+  }
+
+  /**
+   * Delete a commit, a branch operation or a tag operation from the database,
+   * and call the necessary hooks.
+   *
+   * @param $operation
+   *   The commit, branch operation or tag operation array containing
+   *   the operation that should be deleted.
+   */
+  public function delete($options = array()) {
+    // Append default options.
+    $options += $this->defaultCrudOptions['delete'];
+
+    db_delete('versioncontrol_operations')
+      ->condition('vc_op_id', $this->vc_op_id)
+      ->execute();
+
+    if (!empty($options['nested'])) {
+      $this->deleteNested($options);
+    }
+
+    // Remove relevant entries from the versioncontrol_operation_labels table.
+    db_delete('versioncontrol_operation_labels')
+      ->condition('vc_op_id', $this->vc_op_id)
+      ->execute();
+
+    $this->backendDelete($options);
+
+    module_invoke_all('versioncontrol_entity_commit_delete', $this);
+  }
+}
Index: includes/VersioncontrolItem.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/VersioncontrolItem.php,v
retrieving revision 1.14
diff -u -p -r1.14 VersioncontrolItem.php
--- includes/VersioncontrolItem.php	3 Dec 2010 08:44:58 -0000	1.14
+++ includes/VersioncontrolItem.php	12 Jan 2011 01:27:34 -0000
@@ -164,7 +164,7 @@ abstract class VersioncontrolItem extend
    *   sorted in reverse chronological order, so the newest revision
    *   comes first. Each element has its (file-level) item revision as
    *   key, and a standard item object (as the ones retrieved by
-   *   VersioncontrolOperation::getItems()) as value. All items except
+   *   VersioncontrolCommit::getItems()) as value. All items except
    *   for the oldest one will also have the 'action' and 'source_items'
    *   properties filled in, the oldest item might or might not have
    *   them. (If they exist for the oldest item, 'action' will be
@@ -305,7 +305,7 @@ abstract class VersioncontrolItem extend
    *
    * When first retrieving an item, the selected label is initialized
    * with a sensible value - for example,
-   * VersioncontrolOperation::getItems() assigns the affected branch or
+   * VersioncontrolCommit::getItems() assigns the affected branch or
    * tag of that operation to all the items. (This is especially
    * important for version control systems like Subversion where there is
    * a need to specify the label per item and not per operation, as a
@@ -335,6 +335,7 @@ abstract class VersioncontrolItem extend
     // label.
     switch ($this->selected_label->get_from) {
     case 'operation':
+    case 'commit':
       $selected_label = $this->selected_label->operation->getSelectedLabel($this);
       break;
     case 'other_item':
Index: includes/VersioncontrolOperation.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/VersioncontrolOperation.php,v
retrieving revision 1.18
diff -u -p -r1.18 VersioncontrolOperation.php
--- includes/VersioncontrolOperation.php	3 Jan 2011 16:09:19 -0000	1.18
+++ includes/VersioncontrolOperation.php	12 Jan 2011 01:27:34 -0000
@@ -178,7 +178,7 @@ abstract class VersioncontrolOperation e
   public function insert($options = array()) {
     if (!empty($this->vc_op_id)) {
       // This is supposed to be a new commit, but has a vc_op_id already.
-      throw new Exception('Attempted to insert a Versioncontrol commit which is already present in the database.', E_ERROR);
+      throw new Exception('Attempted to insert a Versioncontrol operation which is already present in the database.', E_ERROR);
     }
 
     // Append default options.
@@ -201,7 +201,7 @@ abstract class VersioncontrolOperation e
     $this->backendInsert($options);
 
     // Everything's done, invoke the hook.
-    module_invoke_all('versioncontrol_entity_commit_insert', $this);
+    module_invoke_all('versioncontrol_entity_operation_insert', $this);
     return $this;
   }
 
@@ -217,7 +217,7 @@ abstract class VersioncontrolOperation e
   public function update($options = array()) {
     if (empty($this->vc_op_id)) {
       // This is supposed to be an existing branch, but has no vc_op_id.
-      throw new Exception('Attempted to update a Versioncontrol commit which has not yet been inserted in the database.', E_ERROR);
+      throw new Exception('Attempted to update a Versioncontrol operation which has not yet been inserted in the database.', E_ERROR);
     }
 
     // Append default options.
@@ -240,7 +240,7 @@ abstract class VersioncontrolOperation e
     $this->backendUpdate($options);
 
     // Everything's done, invoke the hook.
-    module_invoke_all('versioncontrol_entity_commit_update', $this);
+    module_invoke_all('versioncontrol_entity_operation_update', $this);
     return $this;
   }
 
@@ -300,7 +300,7 @@ abstract class VersioncontrolOperation e
 
     $this->backendDelete($options);
 
-    module_invoke_all('versioncontrol_entity_commit_delete', $this);
+    module_invoke_all('versioncontrol_entity_operation_delete', $this);
   }
 
   protected function deleteNested($options) {
Index: includes/VersioncontrolRepository.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/VersioncontrolRepository.php,v
retrieving revision 1.26
diff -u -p -r1.26 VersioncontrolRepository.php
--- includes/VersioncontrolRepository.php	5 Jan 2011 05:39:21 -0000	1.26
+++ includes/VersioncontrolRepository.php	12 Jan 2011 01:27:34 -0000
@@ -224,7 +224,7 @@ abstract class VersioncontrolRepository 
   public function loadCommits($ids = array(), $conditions = array(), $options = array()) {
     $conditions['type'] = VERSIONCONTROL_OPERATION_COMMIT;
     $conditions['repo_id'] = $this->repo_id;
-    return $this->backend->loadEntities('operation', $ids, $conditions, $options);
+    return $this->backend->loadEntities('commit', $ids, $conditions, $options);
   }
 
   /**
Index: includes/controllers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/controllers.inc,v
retrieving revision 1.21
diff -u -p -r1.21 controllers.inc
--- includes/controllers.inc	5 Jan 2011 05:39:21 -0000	1.21
+++ includes/controllers.inc	12 Jan 2011 01:27:34 -0000
@@ -505,6 +505,19 @@ class VersioncontrolOperationController 
   }
 }
 
+class VersioncontrolCommitController extends VersioncontrolOperationController {
+  protected $entityType = 'commit';
+
+  /**
+   * Ensure we're only retrieving commit operations.
+   */
+  protected function buildQueryConditions(&$query, $ids, $conditions) {
+    parent::buildQueryConditions($query, $ids, $conditions);
+    $this->attachCondition($query, 'type', VERSIONCONTROL_OPERATION_COMMIT);
+    return $query;
+  }
+}
+
 class VersioncontrolItemController extends VersioncontrolEntityController {
   protected $entityType = 'item';
   protected $baseTable = 'versioncontrol_item_revisions';
Index: includes/interfaces.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/interfaces.inc,v
retrieving revision 1.6
diff -u -p -r1.6 interfaces.inc
--- includes/interfaces.inc	3 Jan 2011 16:09:19 -0000	1.6
+++ includes/interfaces.inc	12 Jan 2011 01:27:34 -0000
@@ -183,26 +183,26 @@ interface VersioncontrolRepositoryGetIte
 
 interface VersioncontrolUserMapperInterface {
   /**
-   * Map the author of the passed VersioncontrolOperation object to a Drupal
+   * Map the author of the passed VersioncontrolCommit object to a Drupal
    * uid, or FALSE if no uid mapping could be made.
    *
-   * @param VersioncontrolOperation $commit
+   * @param VersioncontrolCommit $commit
    *   The commit to be mapped.
    * @return mixed
    *   Either a uid (int), or FALSE if the mapping failed.
    */
-  public function mapAuthor(VersioncontrolOperation $commit);
+  public function mapAuthor(VersioncontrolCommit $commit);
 
   /**
-   * Map the committer of the passed VersioncontrolOperation object to a Drupal
+   * Map the committer of the passed VersioncontrolCommit object to a Drupal
    * uid, or FALSE if no uid mapping could be made.
    *
-   * @param VersioncontrolOperation $commit
+   * @param VersioncontrolCommit $commit
    *   The commit to be mapped.
    * @return mixed
    *   Either a uid (int), or FALSE if the mapping failed.
    */
-  public function mapCommitter(VersioncontrolOperation $commit);
+  public function mapCommitter(VersioncontrolCommit $commit);
 }
 
 interface VersioncontrolAuthHandlerInterface {
Index: includes/plugins/user_mapping_methods/VersioncontrolUserMapperSimpleMail.class.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/includes/plugins/user_mapping_methods/VersioncontrolUserMapperSimpleMail.class.php,v
retrieving revision 1.2
diff -u -p -r1.2 VersioncontrolUserMapperSimpleMail.class.php
--- includes/plugins/user_mapping_methods/VersioncontrolUserMapperSimpleMail.class.php	4 Dec 2010 17:32:03 -0000	1.2
+++ includes/plugins/user_mapping_methods/VersioncontrolUserMapperSimpleMail.class.php	12 Jan 2011 01:27:34 -0000
@@ -7,11 +7,11 @@
  * does no checking to ensure they're good.
  */
 class VersioncontrolUserMapperSimpleMail implements VersioncontrolUserMapperInterface {
-  public function mapAuthor(VersioncontrolOperation $commit) {
+  public function mapAuthor(VersioncontrolCommit $commit) {
     return $this->map($commit->author);
   }
 
-  public function mapCommitter(VersioncontrolOperation $commit) {
+  public function mapCommitter(VersioncontrolCommit $commit) {
     return $this->map($commit->committer);
   }
 
Index: tests/VersioncontrolBackendTests.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/tests/VersioncontrolBackendTests.test,v
retrieving revision 1.6
diff -u -p -r1.6 VersioncontrolBackendTests.test
--- tests/VersioncontrolBackendTests.test	3 Jan 2011 16:09:20 -0000	1.6
+++ tests/VersioncontrolBackendTests.test	12 Jan 2011 01:27:34 -0000
@@ -31,7 +31,7 @@ class VersioncontrolBackendBaseUnitTest 
     // As soon as the backend is initialized, the base class should have a bunch
     // of classes declared on it and available for factory operations. Check.
     // This also has the effect of ensuring autoload declarations are in place.
-    $types = array('repo', 'operation', 'item', 'branch', 'tag');
+    $types = array('repo', 'operation', 'commit', 'item', 'branch', 'tag');
     foreach ($this->backends as $backend) { // Iterate over all available backends.
       foreach ($types as $type) { // Iterate over each entity type.
         $this->assertTrue(isset($backend->classesEntities[$type]), "$backend->name backend declares an entity class for type '$type'", 'PHP');
Index: tests/VersioncontrolCommitUnitTestingTestCase.test
===================================================================
RCS file: tests/VersioncontrolCommitUnitTestingTestCase.test
diff -N tests/VersioncontrolCommitUnitTestingTestCase.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tests/VersioncontrolCommitUnitTestingTestCase.test	12 Jan 2011 01:27:34 -0000
@@ -0,0 +1,134 @@
+<?php
+// $Id$
+/**
+ * @file
+ * Unit tests for commit class.
+ */
+require_once drupal_get_path('module', 'versioncontrol') . '/tests/VersioncontrolTestCase.test';
+
+/**
+ * Unit tests for VersioncontrolCommit class.
+ */
+class VersioncontrolCommitUnitTestingTestCase extends VersioncontrolTestCase {
+
+  /**
+   * Implementation of getInfo().
+   */
+  public static function getInfo() {
+    return array(
+      'name' => t('Commit class unit tests'),
+      'description' => t('Unit tests for the VersioncontrolCommit class.'),
+      'group' => t('Version Control API'),
+    );
+  }
+
+  /**
+   * Implementation of setUp().
+   */
+  function setUp() {
+    $this->useBackends = self::BACKENDS_TEST;
+    parent::setUp();
+  }
+
+  public function testCreation() {
+    // Build and insert.
+    $repo = $this->versioncontrolCreateRepository('test');
+    $data = array(
+      'type' => VERSIONCONTROL_OPERATION_COMMIT,
+      'date' => time(),
+      'author' => $this->randomName(7),
+      'author_uid' => 0,
+      'committer' => $this->randomName(7),
+      'committer_uid' => 0,
+      'revision' => $this->randomName(4),
+      'message' => $this->randomString(20),
+      'repository' => $repo,
+      'labels' => array(),
+      'itemRevisions' => array(),
+    );
+    $commit = $this->testBackend->buildEntity('commit', $data);
+    $commit->insert();
+
+    // Verify.
+    $db_commit = db_select('versioncontrol_operations', 'o')
+      ->fields('o')
+      ->condition('vc_op_id', $commit->vc_op_id)
+      ->execute()
+      ->fetchObject();
+    foreach ($commit as $key => $val) {
+      // labels and itemRevisions are not real DB fields
+      if ($key == 'labels' || $key == 'itemRevisions') {
+        continue;
+      }
+      $this->assertEqual($val, $db_commit->$key, t('%key commit attribute is stored correctly', array('%key' => $key)), t('Creation'));
+    }
+  }
+
+  public function testRead() {
+    $controller = new VersioncontrolCommitController();
+    // no commit, test we get valid output
+    $commits = $controller->load(array(''));
+    $this->assertTrue(empty($commits), t('Make sure we get an empty array when trying to get a commit with empty vc_op_id'), t('Read'));
+
+    $commits = $controller->load(NULL);
+    $this->assertTrue(empty($commits), t('Make sure we get an empty array when trying to get a commit with a NULL vc_op_id'), t('Read'));
+
+    $commits = $controller->load(array(1));
+    $this->assertTrue(empty($commits), t('Make sure we get an empty array when trying to get a commit which do not exit'), t('Read'));
+
+    // create commit and test again
+    $commit = $this->versioncontrolCreateCommit('test');
+    $db_commits = $controller->load(array($commit->vc_op_id));
+    $this->assertEqual(count($db_commits), 1, t('Only one commit found'), t('Read'));
+    $db_commit = reset($db_commits);
+    $this->assertTrue(isset($db_commit) && is_a($db_commit, 'VersioncontrolCommit'), t('Make sure we get a valid return when passing a good vc_op_id.'), t('Read'));
+    $this->assertEqual($db_commit->vc_op_id, $commit->vc_op_id, t('Make sure we get the right commit.'), t('Read'));
+  }
+
+  public function testUpdate() {
+    $commit = $this->versioncontrolCreateCommit('test');
+
+    $data = array(
+      'date' => time(),
+      'author' => $this->randomName(7),
+      'author_uid' => 0,
+      'committer' => $this->randomName(7),
+      'committer_uid' => 0,
+      'revision' => $this->randomName(4),
+      'message' => $this->randomString(20),
+    );
+
+    foreach ($data as $key => $val) {
+      $commit->$key = $val;
+    }
+    $commit->update();
+
+    $db_commit = db_select('versioncontrol_operations', 'o')
+      ->fields('o')
+      ->condition('vc_op_id', $commit->vc_op_id)
+      ->execute()
+      ->fetchObject();
+    foreach ($commit as $key => $val) {
+      // labels and itemRevisions are not real DB fields
+      if ($key == 'labels' || $key == 'itemRevisions') {
+        continue;
+      }
+      $this->assertEqual($val, $db_commit->$key, t('%key commit attribute is updated correctly', array('%key' => $key)), t('Update'));
+    }
+
+  }
+
+  public function testDelete() {
+    $commit = $this->versioncontrolCreateCommit('test');
+    $commit->delete();
+
+    $result = db_select('versioncontrol_operations', 'o')
+      ->fields('o')
+      ->condition('vc_op_id', $commit->vc_op_id)
+      ->execute();
+    foreach ($result as $db_commit) {
+      $this->fail(t('The commit was not deleted correctly.'), t('Delete'));
+    }
+  }
+
+}
Index: tests/VersioncontrolItemUnitTestingTestCase.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/tests/VersioncontrolItemUnitTestingTestCase.test,v
retrieving revision 1.1
diff -u -p -r1.1 VersioncontrolItemUnitTestingTestCase.test
--- tests/VersioncontrolItemUnitTestingTestCase.test	17 Dec 2010 08:45:55 -0000	1.1
+++ tests/VersioncontrolItemUnitTestingTestCase.test	12 Jan 2011 01:27:34 -0000
@@ -33,9 +33,9 @@ class VersioncontrolItemUnitTestingTestC
   public function testCreation() {
     // Build and insert.
     $repo = $this->versioncontrolCreateRepository('test');
-    $operation = $this->versioncontrolCreateOperation('test');
+    $commit = $this->versioncontrolCreateCommit('test');
     $data = array(
-      'vc_op_id' => $operation->vc_op_id,
+      'vc_op_id' => $commit->vc_op_id,
       'path' => '/fake/path/to/file',
       'revision' => $this->randomName(4),
       'type' => VERSIONCONTROL_ITEM_FILE,
Index: tests/VersioncontrolTestCase.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/versioncontrol/tests/VersioncontrolTestCase.test,v
retrieving revision 1.7
diff -u -p -r1.7 VersioncontrolTestCase.test
--- tests/VersioncontrolTestCase.test	3 Jan 2011 16:09:20 -0000	1.7
+++ tests/VersioncontrolTestCase.test	12 Jan 2011 01:27:34 -0000
@@ -238,6 +238,39 @@ abstract class VersioncontrolTestCase ex
     return $operation;
   }
 
+  public function versioncontrolCreateCommit($backend_name = 'test', $data = array(), $insert=TRUE) {
+    static $i = 0;
+    $name = $this->randomName(7);
+    $default_data = array(
+      'type' => VERSIONCONTROL_OPERATION_COMMIT,
+      'date' => time(),
+      'author' => $name,
+      'author_uid' => 0,
+      'committer' => $name,
+      'committer_uid' => 0,
+      'revision' => ++$i,
+      'message' => $this->randomString(20),
+      'labels' => array(),
+      'itemRevisions' => array(),
+    );
+    $data += $default_data;
+
+    $backend = $this->backends[$backend_name];
+    if (!isset($data['repo_id'])) {
+      if (!isset($data['repository']) || !is_subclass_of($data['repository'], 'VersioncontrolRepository')) {
+        $repo = $this->versioncontrolCreateRepository($backend_name);
+        $data['repo_id'] = $repo->repo_id;
+      }
+    }
+    $commit = $backend->buildEntity('commit', $data);
+    if ($insert) {
+      $commit->insert();
+      $this->assertTrue(isset($commit->vc_op_id) && is_numeric($commit->vc_op_id), t('VersioncontrolCommit::insert() properly populates a new repository object with an integer vc_op_id.'));
+    }
+
+    return $commit;
+  }
+
   public function versioncontrolCreateItem($backend_name = 'test', $data = array(), $insert=TRUE) {
     static $i = 0;
     $default_data = array(
