Index: docroot/sites/all/modules/custom/services_client/services_client.module
===================================================================
--- docroot/sites/all/modules/custom/services_client/services_client.module	(revision 50641)
+++ docroot/sites/all/modules/custom/services_client/services_client.module	(working copy)
@@ -489,15 +489,22 @@
     // Add roles to user data
     services_client_process_roles_mapping($user, $user_data, $mapping['user_sync_roles'], $client, $task->conn_name);
 
+    // managed by user_revision module
+    if (module_exists('user_revision')) {
+      _services_client_revision_message($user_data);
+    }
+
     // Because different calls and versions of the services module use both data
     // or account depending on various conditions, we apply the data to both.
     $data = (array) $user_data;
 
     // TODO DEBUGGING REMOVE ME
-    watchdog('sc_user', 'Sending user to %conn: <pre>@user</pre>', array(
-      '%conn' => $task->conn_name,
-      '@user' => print_r($data, TRUE),
-    ));
+    if (variable_get('services_client_debug_mode', TRUE)) {
+      watchdog('sc_user', 'Sending user to %conn: <pre>@user</pre>', array(
+        '%conn' => $task->conn_name,
+        '@user' => print_r($data, TRUE),
+      ));
+    }
 
     // Find out if there is already an object on the master server with this UUID
     $remote_name = isset($user->original->name) ? $user->original->name : $user->name;
@@ -511,7 +518,7 @@
       $uid = services_client_scalar_result($client->get('uuid', 'user', array('uuid' => $user->uuid)));
     }
 
-    // We have a result. We need to update the node
+    // We have a result. We need to update the user
     if (!empty($uid)) {
       watchdog('sc_user', 'Got @uid for uuid @uuid', array(
         '@uid' => $uid,
@@ -521,7 +528,7 @@
       // Update the user on the services master
       $client->update('user_raw', $uid, $data);
     }
-    // No result on our UUID search. Create a node.
+    // No result on our UUID search. Create a user.
     else {
       // Create the user on the services master
       $client->create('user_raw', $data);
@@ -592,14 +599,18 @@
       $node_data->_services_client = $node->_services_client;
     }
 
+    _services_client_revision_message($node_data);
+
     // Node data needs to be an array containing an object.
     $data = (array) $node_data;
 
     // TODO DEBUGGING REMOVE ME
-    watchdog('sc_node', 'Sending node to %conn: <pre>@node</pre>', array(
-      '%conn' => $task->conn_name,
-      '@node' => print_r($data, TRUE)
-    ));
+    if (variable_get('services_client_debug_mode', TRUE)) {
+        watchdog('sc_node', 'Sending node to %conn: <pre>@node</pre>', array(
+        '%conn' => $task->conn_name,
+        '@node' => print_r($data, TRUE)
+      ));
+    }
 
     // Find out if there is already an object on the master server with this UUID
     $nid = services_client_scalar_result($client->get('uuid', 'node', array('uuid' => $node->uuid)));
@@ -697,22 +708,25 @@
     if (count($types) > 0) {
       $submission_data->type = services_client_type_override($types, 'webform');
     }
-    // set revision and language, just in case.
-    $submission_data->revision = '';
+
     $submission_data->language = LANGUAGE_NONE;
 
     if (isset($submission->_services_client)) {
       $submission_data->_services_client = $submission->_services_client;
     }
 
+    _services_client_revision_message($submission_data);
+
     // Node data needs to be an array containing an object.
     $data = (array) $submission_data;
 
     // TODO DEBUGGING REMOVE ME
-    watchdog('sc_node', 'Sending node to %conn: <pre>@node</pre>', array(
-      '%conn' => $task->conn_name,
-      '@node' => print_r($data, TRUE)
-    ));
+    if (variable_get('services_client_debug_mode', TRUE)) {
+      watchdog('sc_node', 'Sending node to %conn: <pre>@node</pre>', array(
+        '%conn' => $task->conn_name,
+        '@node' => print_r($data, TRUE)
+      ));
+    }
 
     // Create the node on the services master
     $response = $client->create('node_raw', $data);
@@ -1203,3 +1217,30 @@
     }
   }
 }
+
+/**
+ * Generate a message to be included in a services-driven revision.
+ *
+ * @param $data
+ *   arbitrary data object
+ */
+function _services_client_revision_message($data) {
+  $message = variable_get('services_client_revision_message', '');
+  if ($message) {
+    global $user;
+
+    $tokens = array(
+      '!origin' => services_client_get_id(),
+      '!account_name' => $user->name,
+    );
+
+    $data->revision = 1;
+    // append the system message to an existing log message
+    if (!empty($data->log)) {
+      $data->log .= "\n\r\n\r" . format_string($message, $tokens);
+    }
+    else {
+      $data->log = format_string($message, $tokens);
+    }
+  }
+}
\ No newline at end of file
