[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#422004: cvsps should ignore changesets newer than starttime - timestamp_fuzz



Package: cvsps
Version: 2.1-2
Severity: normal
Tags: patch

cvsps considers changesets as being part of a changeset when the committer
name matches, the change message matches, and the patches are no further
than timestamp_fuzz apart.

Now, if cvsps is called in the middle of a changeset, while it happens,
it will report that the newest changeset is actually complete, while
it can't be sure that this is the case. This problem can be encountered
when (e.g.) running cvsps regularly on a fast-changing repository from
git-cvsimport, which will result in "split" atomic commits in the git
repository.

--- cvsps.c     2006-05-24 09:15:05.000000000 +0200
+++ ../cvsps.c  2006-05-24 09:14:03.000000000 +0200
@@ -84,6 +84,7 @@
 static struct hash_table * branch_heads;
 static struct list_head all_patch_sets;
 static struct list_head collisions;
+static time_t start_time;
 
 /* settable via options */
 static int timestamp_fuzz_factor = 300;
@@ -207,6 +208,8 @@
     if (cvs_direct && (do_diff || (update_cache && !test_log_file)))
        cvs_direct_ctx = open_cvs_server(root_path, compress);
 
+    start_time = time(NULL);
+
     if (update_cache)
     {
        load_from_cvs();
@@ -1373,6 +1376,9 @@
         (restrict_date_end > 0 && ps->date > restrict_date_end)))
        return;
 
+    if (start_time > 0 && ps->date > start_time - timestamp_fuzz_factor)
+       return;
+
     if (restrict_author && strcmp(restrict_author, ps->author) != 0)
        return;

I'm currently using this with git-cvsimport the sbcl repository, with
a fuzz setting of 15 minutes, and haven't split into any pseudo-atomic
commits yet, nor have I run into any other problems. I did send this
patch to the upstream maintainer, but haven't heard from them in almost
a year; I'd be glad if debian users could benefit from it, though.

Cheers, Andreas.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-amd64
Locale: LANG=C, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)

Versions of packages cvsps depends on:
ii  cvs                         1:1.12.13-8  Concurrent Versions System
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  zlib1g                      1:1.2.3-13   compression library - runtime

cvsps recommends no packages.

-- no debconf information



Reply to: