From 7a01013080ac320aa5b069cc95e8252a24074482 Mon Sep 17 00:00:00 2001
From: Marco Villegas <marvil07@gmail.com>
Date: Thu, 11 Nov 2010 22:22:08 -0500
Subject: [PATCH] re-add lock as column for repo table instead of using data field.

---
 includes/VersioncontrolRepository.php |    8 +++++++-
 versioncontrol.install                |   26 +++++++++++++++++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git includes/VersioncontrolRepository.php includes/VersioncontrolRepository.php
index 6d8f1e5..9cb66c9 100644
--- includes/VersioncontrolRepository.php
+++ includes/VersioncontrolRepository.php
@@ -68,12 +68,18 @@ abstract class VersioncontrolRepository implements VersioncontrolEntityInterface
   public $updated = 0;
 
   /**
+   * Indicates if the repository is being updated now.
+   *
+   * @var    integer
+   */
+  public $locked = 0;
+
+  /**
    * An array of additional per-repository settings, mostly populated by
    * third-party modules. It is serialized on DB.
    */
   public $data = array();
 
-  // Associations
   /**
    * The backend associated with this repository
    *
diff --git versioncontrol.install versioncontrol.install
index 7f191b5..de747dd 100644
--- versioncontrol.install
+++ versioncontrol.install
@@ -359,6 +359,12 @@ function versioncontrol_schema() {
         'not null' => TRUE,
         'default' => 1
       ),
+      'locked' => array(
+        'description' => '1 locked repository, 0 unlocked.',
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+      ),
       'data' => array(
         'description' => t('A serialized array of additional per-repository settings, mostly populated by backends.'),
         'type' => 'text',
@@ -647,7 +653,7 @@ function versioncontrol_update_6301() {
 }
 
 /**
- * Add the 'updated', 'updated_method' and 'locked' columns.
+ * Add the 'updated' and 'updated_method' columns.
  *
  * These fields were previously stored as members of a serialized array stored
  * in the data column but this could be problematic for views integration and
@@ -737,3 +743,21 @@ function versioncontrol_update_6304() {
   db_drop_table($ret, 'versioncontrol_operation_items');
   return $ret;
 }
+
+/**
+ * Add 'locked' column.
+ *
+ * This field was previously stored as members of a serialized array stored
+ * in the data column. Now an independent field.
+ */
+function versioncontrol_update_6305() {
+  $ret = array();
+  $locked = array(
+    'description' => '1 locked repository, 0 unlocked.',
+    'type' => 'int',
+    'not null' => TRUE,
+    'default' => 0,
+  );
+  db_add_field($ret, 'versioncontrol_repositories', 'locked', $locked);
+  return $ret;
+}
-- 
1.7.2.3

