Fossil SCM
Fix the /annotate webpage so that it works even if "fossil ui" is not launched from the root of the check-out.
Commit
48798bb1190660ddb343ec902f8e44f8f7b0a53e3655748d33eab05d86049328
Parent
a7d9598a0d0fda7…
1 file changed
+5
-4
+5
-4
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2207,11 +2207,10 @@ | ||
| 2207 | 2207 | const char *zOrigin, /* The origin check-in, or NULL for root-of-tree */ |
| 2208 | 2208 | u64 annFlags /* Flags to alter the annotation */ |
| 2209 | 2209 | ){ |
| 2210 | 2210 | Blob toAnnotate; /* Text of the final (mid) version of the file */ |
| 2211 | 2211 | Blob step; /* Text of previous revision */ |
| 2212 | - Blob treename; /* FILENAME translated to canonical form */ | |
| 2213 | 2212 | int cid; /* Selected check-in ID */ |
| 2214 | 2213 | int origid = 0; /* The origin ID or zero */ |
| 2215 | 2214 | int rid; /* Artifact ID of the file being annotated */ |
| 2216 | 2215 | int fnid; /* Filename ID */ |
| 2217 | 2216 | Stmt q; /* Query returning all ancestor versions */ |
| @@ -2254,12 +2253,10 @@ | ||
| 2254 | 2253 | }else{ |
| 2255 | 2254 | compute_direct_ancestors(cid); |
| 2256 | 2255 | } |
| 2257 | 2256 | |
| 2258 | 2257 | /* Get filename ID */ |
| 2259 | - file_tree_name(zFilename, &treename, 0, 1); | |
| 2260 | - zFilename = blob_str(&treename); | |
| 2261 | 2258 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 2262 | 2259 | if( fnid==0 ){ |
| 2263 | 2260 | fossil_fatal("no such file: %Q", zFilename); |
| 2264 | 2261 | } |
| 2265 | 2262 | |
| @@ -2572,10 +2569,12 @@ | ||
| 2572 | 2569 | int showLog; /* True to show the log */ |
| 2573 | 2570 | int fileVers; /* Show file version instead of check-in versions */ |
| 2574 | 2571 | u64 annFlags = 0; /* Flags to control annotation properties */ |
| 2575 | 2572 | int bBlame = 0; /* True for BLAME output. False for ANNOTATE. */ |
| 2576 | 2573 | int szHash; /* Display size of a version hash */ |
| 2574 | + Blob treename; /* Name of file to be annotated */ | |
| 2575 | + char *zFilename; /* Name of file to be annotated */ | |
| 2577 | 2576 | |
| 2578 | 2577 | bBlame = g.argv[1][0]!='a'; |
| 2579 | 2578 | zRevision = find_option("r","revision",1); |
| 2580 | 2579 | zLimit = find_option("limit","n",1); |
| 2581 | 2580 | zOrig = find_option("origin","o",1); |
| @@ -2595,11 +2594,13 @@ | ||
| 2595 | 2594 | if( g.argc<3 ) { |
| 2596 | 2595 | usage("FILENAME"); |
| 2597 | 2596 | } |
| 2598 | 2597 | |
| 2599 | 2598 | annFlags |= DIFF_STRIP_EOLCR; |
| 2600 | - annotate_file(&ann, g.argv[2], zRevision, zLimit, zOrig, annFlags); | |
| 2599 | + file_tree_name(g.argv[2], &treename, 0, 1); | |
| 2600 | + zFilename = blob_str(&treename); | |
| 2601 | + annotate_file(&ann, zFilename, zRevision, zLimit, zOrig, annFlags); | |
| 2601 | 2602 | if( showLog ){ |
| 2602 | 2603 | struct AnnVers *p; |
| 2603 | 2604 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2604 | 2605 | fossil_print("version %3d: %s %S file %S\n", |
| 2605 | 2606 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2606 | 2607 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2207,11 +2207,10 @@ | |
| 2207 | const char *zOrigin, /* The origin check-in, or NULL for root-of-tree */ |
| 2208 | u64 annFlags /* Flags to alter the annotation */ |
| 2209 | ){ |
| 2210 | Blob toAnnotate; /* Text of the final (mid) version of the file */ |
| 2211 | Blob step; /* Text of previous revision */ |
| 2212 | Blob treename; /* FILENAME translated to canonical form */ |
| 2213 | int cid; /* Selected check-in ID */ |
| 2214 | int origid = 0; /* The origin ID or zero */ |
| 2215 | int rid; /* Artifact ID of the file being annotated */ |
| 2216 | int fnid; /* Filename ID */ |
| 2217 | Stmt q; /* Query returning all ancestor versions */ |
| @@ -2254,12 +2253,10 @@ | |
| 2254 | }else{ |
| 2255 | compute_direct_ancestors(cid); |
| 2256 | } |
| 2257 | |
| 2258 | /* Get filename ID */ |
| 2259 | file_tree_name(zFilename, &treename, 0, 1); |
| 2260 | zFilename = blob_str(&treename); |
| 2261 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 2262 | if( fnid==0 ){ |
| 2263 | fossil_fatal("no such file: %Q", zFilename); |
| 2264 | } |
| 2265 | |
| @@ -2572,10 +2569,12 @@ | |
| 2572 | int showLog; /* True to show the log */ |
| 2573 | int fileVers; /* Show file version instead of check-in versions */ |
| 2574 | u64 annFlags = 0; /* Flags to control annotation properties */ |
| 2575 | int bBlame = 0; /* True for BLAME output. False for ANNOTATE. */ |
| 2576 | int szHash; /* Display size of a version hash */ |
| 2577 | |
| 2578 | bBlame = g.argv[1][0]!='a'; |
| 2579 | zRevision = find_option("r","revision",1); |
| 2580 | zLimit = find_option("limit","n",1); |
| 2581 | zOrig = find_option("origin","o",1); |
| @@ -2595,11 +2594,13 @@ | |
| 2595 | if( g.argc<3 ) { |
| 2596 | usage("FILENAME"); |
| 2597 | } |
| 2598 | |
| 2599 | annFlags |= DIFF_STRIP_EOLCR; |
| 2600 | annotate_file(&ann, g.argv[2], zRevision, zLimit, zOrig, annFlags); |
| 2601 | if( showLog ){ |
| 2602 | struct AnnVers *p; |
| 2603 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2604 | fossil_print("version %3d: %s %S file %S\n", |
| 2605 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2606 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2207,11 +2207,10 @@ | |
| 2207 | const char *zOrigin, /* The origin check-in, or NULL for root-of-tree */ |
| 2208 | u64 annFlags /* Flags to alter the annotation */ |
| 2209 | ){ |
| 2210 | Blob toAnnotate; /* Text of the final (mid) version of the file */ |
| 2211 | Blob step; /* Text of previous revision */ |
| 2212 | int cid; /* Selected check-in ID */ |
| 2213 | int origid = 0; /* The origin ID or zero */ |
| 2214 | int rid; /* Artifact ID of the file being annotated */ |
| 2215 | int fnid; /* Filename ID */ |
| 2216 | Stmt q; /* Query returning all ancestor versions */ |
| @@ -2254,12 +2253,10 @@ | |
| 2253 | }else{ |
| 2254 | compute_direct_ancestors(cid); |
| 2255 | } |
| 2256 | |
| 2257 | /* Get filename ID */ |
| 2258 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 2259 | if( fnid==0 ){ |
| 2260 | fossil_fatal("no such file: %Q", zFilename); |
| 2261 | } |
| 2262 | |
| @@ -2572,10 +2569,12 @@ | |
| 2569 | int showLog; /* True to show the log */ |
| 2570 | int fileVers; /* Show file version instead of check-in versions */ |
| 2571 | u64 annFlags = 0; /* Flags to control annotation properties */ |
| 2572 | int bBlame = 0; /* True for BLAME output. False for ANNOTATE. */ |
| 2573 | int szHash; /* Display size of a version hash */ |
| 2574 | Blob treename; /* Name of file to be annotated */ |
| 2575 | char *zFilename; /* Name of file to be annotated */ |
| 2576 | |
| 2577 | bBlame = g.argv[1][0]!='a'; |
| 2578 | zRevision = find_option("r","revision",1); |
| 2579 | zLimit = find_option("limit","n",1); |
| 2580 | zOrig = find_option("origin","o",1); |
| @@ -2595,11 +2594,13 @@ | |
| 2594 | if( g.argc<3 ) { |
| 2595 | usage("FILENAME"); |
| 2596 | } |
| 2597 | |
| 2598 | annFlags |= DIFF_STRIP_EOLCR; |
| 2599 | file_tree_name(g.argv[2], &treename, 0, 1); |
| 2600 | zFilename = blob_str(&treename); |
| 2601 | annotate_file(&ann, zFilename, zRevision, zLimit, zOrig, annFlags); |
| 2602 | if( showLog ){ |
| 2603 | struct AnnVers *p; |
| 2604 | for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){ |
| 2605 | fossil_print("version %3d: %s %S file %S\n", |
| 2606 | i+1, p->zDate, p->zMUuid, p->zFUuid); |
| 2607 |