Fossil SCM

Fix the /annotate webpage so that it works even if "fossil ui" is not launched from the root of the check-out.

drh 2018-01-21 23:45 trunk
Commit 48798bb1190660ddb343ec902f8e44f8f7b0a53e3655748d33eab05d86049328
1 file changed +5 -4
+5 -4
--- src/diff.c
+++ src/diff.c
@@ -2207,11 +2207,10 @@
22072207
const char *zOrigin, /* The origin check-in, or NULL for root-of-tree */
22082208
u64 annFlags /* Flags to alter the annotation */
22092209
){
22102210
Blob toAnnotate; /* Text of the final (mid) version of the file */
22112211
Blob step; /* Text of previous revision */
2212
- Blob treename; /* FILENAME translated to canonical form */
22132212
int cid; /* Selected check-in ID */
22142213
int origid = 0; /* The origin ID or zero */
22152214
int rid; /* Artifact ID of the file being annotated */
22162215
int fnid; /* Filename ID */
22172216
Stmt q; /* Query returning all ancestor versions */
@@ -2254,12 +2253,10 @@
22542253
}else{
22552254
compute_direct_ancestors(cid);
22562255
}
22572256
22582257
/* Get filename ID */
2259
- file_tree_name(zFilename, &treename, 0, 1);
2260
- zFilename = blob_str(&treename);
22612258
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
22622259
if( fnid==0 ){
22632260
fossil_fatal("no such file: %Q", zFilename);
22642261
}
22652262
@@ -2572,10 +2569,12 @@
25722569
int showLog; /* True to show the log */
25732570
int fileVers; /* Show file version instead of check-in versions */
25742571
u64 annFlags = 0; /* Flags to control annotation properties */
25752572
int bBlame = 0; /* True for BLAME output. False for ANNOTATE. */
25762573
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 */
25772576
25782577
bBlame = g.argv[1][0]!='a';
25792578
zRevision = find_option("r","revision",1);
25802579
zLimit = find_option("limit","n",1);
25812580
zOrig = find_option("origin","o",1);
@@ -2595,11 +2594,13 @@
25952594
if( g.argc<3 ) {
25962595
usage("FILENAME");
25972596
}
25982597
25992598
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);
26012602
if( showLog ){
26022603
struct AnnVers *p;
26032604
for(p=ann.aVers, i=0; i<ann.nVers; i++, p++){
26042605
fossil_print("version %3d: %s %S file %S\n",
26052606
i+1, p->zDate, p->zMUuid, p->zFUuid);
26062607
--- 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

Keyboard Shortcuts

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