diff options
author | bapt <bapt@FreeBSD.org> | 2013-03-18 18:23:23 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2013-03-18 18:23:23 +0800 |
commit | 897a1d360220f7365e1ef581c51c192284baa9f0 (patch) | |
tree | f34dc476112012135800b54ff13ea70ebae269bf /devel/fossil | |
parent | e85eea1d9b7d9b65e64ac233eb90c735f16a4787 (diff) | |
download | freebsd-ports-gnome-897a1d360220f7365e1ef581c51c192284baa9f0.tar.gz freebsd-ports-gnome-897a1d360220f7365e1ef581c51c192284baa9f0.tar.zst freebsd-ports-gnome-897a1d360220f7365e1ef581c51c192284baa9f0.zip |
Prevent time warps from causing infinite loops in the annotator.
Obtained from: fossil's upstream (http://www.fossil-scm.org/xfer/info/1605649f3e)
Diffstat (limited to 'devel/fossil')
-rw-r--r-- | devel/fossil/Makefile | 2 | ||||
-rw-r--r-- | devel/fossil/files/patch-annotate | 57 |
2 files changed, 58 insertions, 1 deletions
diff --git a/devel/fossil/Makefile b/devel/fossil/Makefile index 2f123de76d1b..0cc3b0b014fc 100644 --- a/devel/fossil/Makefile +++ b/devel/fossil/Makefile @@ -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/ diff --git a/devel/fossil/files/patch-annotate b/devel/fossil/files/patch-annotate new file mode 100644 index 000000000000..bf99b7d4b84e --- /dev/null +++ b/devel/fossil/files/patch-annotate @@ -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); + } + + /* |