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.
Commit
d9ef474a1a319217f2251784a71a543d3cd29913f8b32fd05fe13efbf4984adb
Parent
b83ea94eb24ab11…
1 file changed
+8
-10
+8
-10
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -43,10 +43,13 @@ | ||
| 43 | 43 | #define DIFF_CONTEXT_EX (((u64)0x04)<<32) /* Use context even if zero */ |
| 44 | 44 | #define DIFF_NOTTOOBIG (((u64)0x08)<<32) /* Only display if not too big */ |
| 45 | 45 | #define DIFF_STRIP_EOLCR (((u64)0x10)<<32) /* Strip trailing CR */ |
| 46 | 46 | #define DIFF_SLOW_SBS (((u64)0x20)<<32) /* Better, but slower side-by-side */ |
| 47 | 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 | + | |
| 48 | 51 | /* |
| 49 | 52 | ** These error messages are shared in multiple locations. They are defined |
| 50 | 53 | ** here for consistency. |
| 51 | 54 | */ |
| 52 | 55 | #define DIFF_CANNOT_COMPUTE_BINARY \ |
| @@ -2177,14 +2180,10 @@ | ||
| 2177 | 2180 | /* Return no errors */ |
| 2178 | 2181 | return 0; |
| 2179 | 2182 | } |
| 2180 | 2183 | |
| 2181 | 2184 | |
| 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 | 2185 | /* |
| 2187 | 2186 | ** Compute a complete annotation on a file. The file is identified |
| 2188 | 2187 | ** by its filename number (filename.fnid) and check-in (mlink.mid). |
| 2189 | 2188 | */ |
| 2190 | 2189 | static void annotate_file( |
| @@ -2223,17 +2222,16 @@ | ||
| 2223 | 2222 | "SELECT (SELECT uuid FROM blob WHERE rid=mlink.fid)," |
| 2224 | 2223 | " (SELECT uuid FROM blob WHERE rid=mlink.mid)," |
| 2225 | 2224 | " date(event.mtime)," |
| 2226 | 2225 | " coalesce(event.euser,event.user)," |
| 2227 | 2226 | " mlink.pid" |
| 2228 | - " FROM mlink, event" | |
| 2227 | + " FROM mlink, event, ancestor" | |
| 2229 | 2228 | " WHERE mlink.fid=:rid" |
| 2230 | 2229 | " AND event.objid=mlink.mid" |
| 2231 | 2230 | " 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;" | |
| 2235 | 2233 | ); |
| 2236 | 2234 | |
| 2237 | 2235 | db_bind_int(&q, ":rid", rid); |
| 2238 | 2236 | if( iLimit==0 ) iLimit = 1000000000; |
| 2239 | 2237 | while( rid && iLimit>cnt && db_step(&q)==SQLITE_ROW ){ |
| @@ -2310,11 +2308,11 @@ | ||
| 2310 | 2308 | void annotation_page(void){ |
| 2311 | 2309 | int mid; |
| 2312 | 2310 | int fnid; |
| 2313 | 2311 | int i; |
| 2314 | 2312 | int iLimit; /* Depth limit */ |
| 2315 | - u64 annFlags = (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR); | |
| 2313 | + u64 annFlags = DIFF_STRIP_EOLCR; | |
| 2316 | 2314 | int showLog = 0; /* True to display the log */ |
| 2317 | 2315 | int ignoreWs = 0; /* Ignore whitespace */ |
| 2318 | 2316 | const char *zFilename; /* Name of file to annotate */ |
| 2319 | 2317 | const char *zCI; /* The check-in containing zFilename */ |
| 2320 | 2318 | Annotator ann; |
| @@ -2590,11 +2588,11 @@ | ||
| 2590 | 2588 | if( mid==0 ){ |
| 2591 | 2589 | fossil_fatal("unable to find manifest"); |
| 2592 | 2590 | } |
| 2593 | 2591 | |
| 2594 | 2592 | if( iLimit<=0 ) iLimit = 1000000000; |
| 2595 | - annFlags |= (ANN_FILE_ANCEST|DIFF_STRIP_EOLCR); | |
| 2593 | + annFlags |= DIFF_STRIP_EOLCR; | |
| 2596 | 2594 | annotate_file(&ann, fnid, mid, iLimit, annFlags); |
| 2597 | 2595 | if( showLog ){ |
| 2598 | 2596 | struct AnnVers *p; |
| 2599 | 2597 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2600 | 2598 | fossil_print("version %3d: %s %S file %S\n", |
| 2601 | 2599 |
| --- 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 |