Hi, I'm using the cvslog module from cvs. What a nice improvement over the 4.3.0 version.

In my case, as I'm sure many others, my CVS repository is hosted on SourceForge. SF has been serving anonymous pserver requests from a system that contains a mirror of the cvsroot and can be up to a day old in mirroring changes that are visible to anonymous pserver users.

It looks to me like the delay between commits on SF and having those mirrored to the anonymous pserver copy cause the current cvslog module to "miss" to changes, since cvslog currently asks for any log entries since the last time the log was checked.

I created a patch that causes cvs.module to use the max created data from any entry in cvs_messages for the repository, which should always query SF (or any other cvs server) using the date of the newest entry.

The patch is shown below:

--- ./cvs.module.orig   2004-10-15 14:35:50.000000000 -0500
+++ ./cvs.module  2004-11-21 20:20:53.582259592 -0600
@@ -275,9 +275,15 @@
     }
   }

-  if ($repo->updated) {
+  $msg = db_fetch_object(db_query("SELECT MAX(created) as maxcreated FROM {cvs_messages} WHERE rid = %d", $repo->rid));
+
+  if ($msg->maxcreated) {
+    $date = '-S -d ">='. gmdate('Y-m-d H:i', $msg->maxcreated) .'Z" ';
+  }
+  elseif ($repo->updated) {
     $date = '-S -d ">='. gmdate('Y-m-d H:i', $repo->updated) .'Z" ';
   }
+
   $repo->updated = time();

   $modules = explode(' ', $repo->modules);

Would you consider accepting this patch and including in cvslog or is there a better way to do this?

Thanks,

jthomps

Comments

markus_petrux’s picture

I haven't checked, but the explanation looks reasonable. Is this still necessary? If so, I would love to see it in. I'm planning, in the near future, to use this module with SF cvs too. OMG.