Fossil SCM

Fix the value of the ANN_FILE_VERS flag so that it no longer overlaps with DIFF_SLOW_SBS. Omit the ANN_FILE_ANCEST flag which was always true. Update the annotator so that it follows check-ins in generation order according to the ancestor table.

drh 2017-09-23 19:10 trunk
Commit d9ef474a1a319217f2251784a71a543d3cd29913f8b32fd05fe13efbf4984adb
1 file changed +8 -10
+8 -10
--- src/diff.c
+++ src/diff.c
@@ -43,10 +43,13 @@
4343
#define DIFF_CONTEXT_EX (((u64)0x04)<<32) /* Use context even if zero */
4444
#define DIFF_NOTTOOBIG (((u64)0x08)<<32) /* Only display if not too big */
4545
#define DIFF_STRIP_EOLCR (((u64)0x10)<<32) /* Strip trailing CR */
4646
#define DIFF_SLOW_SBS (((u64)0x20)<<32) /* Better, but slower side-by-side */
4747
48
+/* Annotation flags (any DIFF flag can be used as Annotation flag as well) */
49
+#define ANN_FILE_VERS (((u64)0x40)<<32) /* File vers not commit vers */
50
+
4851
/*
4952
** These error messages are shared in multiple locations. They are defined
5053
** here for consistency.
5154
*/
5255
#define DIFF_CANNOT_COMPUTE_BINARY \
@@ -2177,14 +2180,10 @@
21772180
/* Return no errors */
21782181
return 0;
21792182
}
21802183
21812184
2182
-/* Annotation flags (any DIFF flag can be used as Annotation flag as well) */
2183
-#define ANN_FILE_VERS (((u64)0x20)<<32) /* File vers not commit vers */
2184
-#define ANN_FILE_ANCEST (((u64)0x40)<<32) /* Prefer checkins in the ANCESTOR */
2185
-
21862185
/*
21872186
** Compute a complete annotation on a file. The file is identified
21882187
** by its filename number (filename.fnid) and check-in (mlink.mid).
21892188
*/
21902189
static void annotate_file(
@@ -2223,17 +2222,16 @@
22232222
"SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
22242223
" (SELECT uuid FROM blob WHERE rid=mlink.mid),"
22252224
" date(event.mtime),"
22262225
" coalesce(event.euser,event.user),"
22272226
" mlink.pid"
2228
- " FROM mlink, event"
2227
+ " FROM mlink, event, ancestor"
22292228
" WHERE mlink.fid=:rid"
22302229
" AND event.objid=mlink.mid"
22312230
" AND mlink.pid NOT IN vseen"
2232
- " ORDER BY %s event.mtime",
2233
- (annFlags & ANN_FILE_ANCEST)!=0 ?
2234
- "(mlink.mid IN (SELECT rid FROM ancestor)) DESC,":""
2231
+ " AND ancestor.rid=mlink.mid"
2232
+ " ORDER BY ancestor.generation;"
22352233
);
22362234
22372235
db_bind_int(&q, ":rid", rid);
22382236
if( iLimit==0 ) iLimit = 1000000000;
22392237
while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
@@ -2310,11 +2308,11 @@
23102308
void annotation_page(void){
23112309
int mid;
23122310
int fnid;
23132311
int i;
23142312
int iLimit; /* Depth limit */
2315
- u64 annFlags = (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR);
2313
+ u64 annFlags = DIFF_STRIP_EOLCR;
23162314
int showLog = 0; /* True to display the log */
23172315
int ignoreWs = 0; /* Ignore whitespace */
23182316
const char *zFilename; /* Name of file to annotate */
23192317
const char *zCI; /* The check-in containing zFilename */
23202318
Annotator ann;
@@ -2590,11 +2588,11 @@
25902588
if( mid==0 ){
25912589
fossil_fatal("unable to find manifest");
25922590
}
25932591
25942592
if( iLimit<=0 ) iLimit = 1000000000;
2595
- annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR);
2593
+ annFlags |= DIFF_STRIP_EOLCR;
25962594
annotate_file(&ann, fnid, mid, iLimit, annFlags);
25972595
if( showLog ){
25982596
struct AnnVers *p;
25992597
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
26002598
fossil_print("version %3d: %s %S file %S\n",
26012599
--- src/diff.c
+++ src/diff.c
@@ -43,10 +43,13 @@
43 #define DIFF_CONTEXT_EX (((u64)0x04)<<32) /* Use context even if zero */
44 #define DIFF_NOTTOOBIG (((u64)0x08)<<32) /* Only display if not too big */
45 #define DIFF_STRIP_EOLCR (((u64)0x10)<<32) /* Strip trailing CR */
46 #define DIFF_SLOW_SBS (((u64)0x20)<<32) /* Better, but slower side-by-side */
47
 
 
 
48 /*
49 ** These error messages are shared in multiple locations. They are defined
50 ** here for consistency.
51 */
52 #define DIFF_CANNOT_COMPUTE_BINARY \
@@ -2177,14 +2180,10 @@
2177 /* Return no errors */
2178 return 0;
2179 }
2180
2181
2182 /* Annotation flags (any DIFF flag can be used as Annotation flag as well) */
2183 #define ANN_FILE_VERS (((u64)0x20)<<32) /* File vers not commit vers */
2184 #define ANN_FILE_ANCEST (((u64)0x40)<<32) /* Prefer checkins in the ANCESTOR */
2185
2186 /*
2187 ** Compute a complete annotation on a file. The file is identified
2188 ** by its filename number (filename.fnid) and check-in (mlink.mid).
2189 */
2190 static void annotate_file(
@@ -2223,17 +2222,16 @@
2223 "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
2224 " (SELECT uuid FROM blob WHERE rid=mlink.mid),"
2225 " date(event.mtime),"
2226 " coalesce(event.euser,event.user),"
2227 " mlink.pid"
2228 " FROM mlink, event"
2229 " WHERE mlink.fid=:rid"
2230 " AND event.objid=mlink.mid"
2231 " AND mlink.pid NOT IN vseen"
2232 " ORDER BY %s event.mtime",
2233 (annFlags & ANN_FILE_ANCEST)!=0 ?
2234 "(mlink.mid IN (SELECT rid FROM ancestor)) DESC,":""
2235 );
2236
2237 db_bind_int(&q, ":rid", rid);
2238 if( iLimit==0 ) iLimit = 1000000000;
2239 while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
@@ -2310,11 +2308,11 @@
2310 void annotation_page(void){
2311 int mid;
2312 int fnid;
2313 int i;
2314 int iLimit; /* Depth limit */
2315 u64 annFlags = (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR);
2316 int showLog = 0; /* True to display the log */
2317 int ignoreWs = 0; /* Ignore whitespace */
2318 const char *zFilename; /* Name of file to annotate */
2319 const char *zCI; /* The check-in containing zFilename */
2320 Annotator ann;
@@ -2590,11 +2588,11 @@
2590 if( mid==0 ){
2591 fossil_fatal("unable to find manifest");
2592 }
2593
2594 if( iLimit<=0 ) iLimit = 1000000000;
2595 annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR);
2596 annotate_file(&ann, fnid, mid, iLimit, annFlags);
2597 if( showLog ){
2598 struct AnnVers *p;
2599 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2600 fossil_print("version %3d: %s %S file %S\n",
2601
--- src/diff.c
+++ src/diff.c
@@ -43,10 +43,13 @@
43 #define DIFF_CONTEXT_EX (((u64)0x04)<<32) /* Use context even if zero */
44 #define DIFF_NOTTOOBIG (((u64)0x08)<<32) /* Only display if not too big */
45 #define DIFF_STRIP_EOLCR (((u64)0x10)<<32) /* Strip trailing CR */
46 #define DIFF_SLOW_SBS (((u64)0x20)<<32) /* Better, but slower side-by-side */
47
48 /* Annotation flags (any DIFF flag can be used as Annotation flag as well) */
49 #define ANN_FILE_VERS (((u64)0x40)<<32) /* File vers not commit vers */
50
51 /*
52 ** These error messages are shared in multiple locations. They are defined
53 ** here for consistency.
54 */
55 #define DIFF_CANNOT_COMPUTE_BINARY \
@@ -2177,14 +2180,10 @@
2180 /* Return no errors */
2181 return 0;
2182 }
2183
2184
 
 
 
 
2185 /*
2186 ** Compute a complete annotation on a file. The file is identified
2187 ** by its filename number (filename.fnid) and check-in (mlink.mid).
2188 */
2189 static void annotate_file(
@@ -2223,17 +2222,16 @@
2222 "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid),"
2223 " (SELECT uuid FROM blob WHERE rid=mlink.mid),"
2224 " date(event.mtime),"
2225 " coalesce(event.euser,event.user),"
2226 " mlink.pid"
2227 " FROM mlink, event, ancestor"
2228 " WHERE mlink.fid=:rid"
2229 " AND event.objid=mlink.mid"
2230 " AND mlink.pid NOT IN vseen"
2231 " AND ancestor.rid=mlink.mid"
2232 " ORDER BY ancestor.generation;"
 
2233 );
2234
2235 db_bind_int(&q, ":rid", rid);
2236 if( iLimit==0 ) iLimit = 1000000000;
2237 while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){
@@ -2310,11 +2308,11 @@
2308 void annotation_page(void){
2309 int mid;
2310 int fnid;
2311 int i;
2312 int iLimit; /* Depth limit */
2313 u64 annFlags = DIFF_STRIP_EOLCR;
2314 int showLog = 0; /* True to display the log */
2315 int ignoreWs = 0; /* Ignore whitespace */
2316 const char *zFilename; /* Name of file to annotate */
2317 const char *zCI; /* The check-in containing zFilename */
2318 Annotator ann;
@@ -2590,11 +2588,11 @@
2588 if( mid==0 ){
2589 fossil_fatal("unable to find manifest");
2590 }
2591
2592 if( iLimit<=0 ) iLimit = 1000000000;
2593 annFlags |= DIFF_STRIP_EOLCR;
2594 annotate_file(&ann, fnid, mid, iLimit, annFlags);
2595 if( showLog ){
2596 struct AnnVers *p;
2597 for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
2598 fossil_print("version %3d: %s %S file %S\n",
2599

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button