Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2013 10:23:24 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r314549 - in head/devel/fossil: . files
Message-ID:  <201303181023.r2IANO4q097734@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Mar 18 10:23:23 2013
New Revision: 314549
URL: http://svnweb.freebsd.org/changeset/ports/314549

Log:
  Prevent time warps from causing infinite loops in the annotator.
  
  Obtained from:	fossil's upstream (http://www.fossil-scm.org/xfer/info/1605649f3e)

Added:
  head/devel/fossil/files/patch-annotate   (contents, props changed)
Modified:
  head/devel/fossil/Makefile

Modified: head/devel/fossil/Makefile
==============================================================================
--- head/devel/fossil/Makefile	Mon Mar 18 10:21:48 2013	(r314548)
+++ head/devel/fossil/Makefile	Mon Mar 18 10:23:23 2013	(r314549)
@@ -2,7 +2,7 @@
 
 PORTNAME=	fossil
 PORTVERSION=	20130216000435
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	devel www
 MASTER_SITES=	http://www.fossil-scm.org/download/

Added: head/devel/fossil/files/patch-annotate
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/fossil/files/patch-annotate	Mon Mar 18 10:23:23 2013	(r314549)
@@ -0,0 +1,57 @@
+--- src/diff.c.orig	2013-02-16 01:13:55.000000000 +0100
++++ src/diff.c	2013-03-18 11:16:10.684776601 +0100
+@@ -2202,6 +2202,7 @@
+   int rid;             /* Artifact ID of the file being annotated */
+   char *zLabel;        /* Label to apply to a line */
+   Stmt q;              /* Query returning all ancestor versions */
++  Stmt ins;            /* Inserts into the temporary VSEEN table */
+   int cnt = 0;         /* Number of versions examined */
+ 
+   /* Initialize the annotation */
+@@ -2214,7 +2215,13 @@
+   }
+   if( iLimit<=0 ) iLimit = 1000000000;
+   annotation_start(p, &toAnnotate);
+-  
++  db_begin_transaction();
++  db_multi_exec(
++    "CREATE TABLE IF NOT EXISTS vseen(rid INTEGER PRIMARY KEY);"
++    "DELETE FROM vseen;"
++  );
++
++  db_prepare(&ins, "INSERT OR IGNORE INTO vseen(rid) VALUES(:rid)");
+   db_prepare(&q,
+     "SELECT (SELECT uuid FROM blob WHERE rid=mlink.%s),"
+     "       date(event.mtime),"
+@@ -2223,10 +2230,11 @@
+     "  FROM mlink, event"
+     " WHERE mlink.fid=:rid"
+     "   AND event.objid=mlink.mid"
++    "   AND mlink.pid NOT IN vseen"
+     " ORDER BY event.mtime",
+     (annFlags & ANN_FILE_VERS)!=0 ? "fid" : "mid"
+   );
+-  
++
+   db_bind_int(&q, ":rid", rid);
+   if( iLimit==0 ) iLimit = 1000000000;
+   while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
+@@ -2247,6 +2255,9 @@
+     p->azVers[p->nVers-1] = zLabel;
+     content_get(rid, &step);
+     annotation_step(p, &step, zLabel);
++    db_bind_int(&ins, ":rid", rid);
++    db_step(&ins);
++    db_reset(&ins);
+     blob_reset(&step);
+     db_reset(&q);
+     rid = prevId;
+@@ -2254,6 +2265,8 @@
+     cnt++;
+   }
+   db_finalize(&q);
++  db_finalize(&ins);
++  db_end_transaction(0);
+ }
+ 
+ /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303181023.r2IANO4q097734>