Fossil SCM
Better handling of /dir pages with unknown checkins. Rework of check-in [872f6a45e3338b77ed10ec49598343ff2ae7741d] for ticket [cc4cd990165317f38618f5b784befd3e9ff3fe61].
Commit
e01f7e6db20270f8ce68920265fe2f2abf63ece4
Parent
528c58115437f39…
1 file changed
+12
-11
+12
-11
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -121,23 +121,24 @@ | ||
| 121 | 121 | pathelementFunc, 0, 0); |
| 122 | 122 | |
| 123 | 123 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 124 | 124 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 125 | 125 | |
| 126 | - /* If a specific check-in is requested, fetch and parse it. */ | |
| 127 | - if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){ | |
| 128 | - if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){ | |
| 129 | - zCI = 0; | |
| 130 | - } | |
| 131 | - } | |
| 132 | - /* check existing checkin */ | |
| 133 | - if (zCI){ | |
| 134 | - zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); | |
| 135 | - if (!zUuid){ | |
| 136 | - zCI = 0; | |
| 126 | + /* If a specific check-in is requested, fetch and parse it. If the | |
| 127 | + ** specific check-in does not exist, clear zCI. zCI==0 will cause all | |
| 128 | + ** files from all check-ins to be displayed. | |
| 129 | + */ | |
| 130 | + if( zCI ){ | |
| 131 | + if( (rid = name_to_rid(zCI))==0 || content_get(rid, &content)==0 ){ | |
| 132 | + zCI = 0; /* No artifact named zCI exists */ | |
| 133 | + }else if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){ | |
| 134 | + zCI = 0; /* The artifact exists but is not a manifest */ | |
| 135 | + }else{ | |
| 136 | + zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); | |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | + | |
| 139 | 140 | |
| 140 | 141 | /* Compute the title of the page */ |
| 141 | 142 | blob_zero(&dirname); |
| 142 | 143 | if( zD ){ |
| 143 | 144 | blob_append(&dirname, "in directory ", -1); |
| 144 | 145 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -121,23 +121,24 @@ | |
| 121 | pathelementFunc, 0, 0); |
| 122 | |
| 123 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 124 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 125 | |
| 126 | /* If a specific check-in is requested, fetch and parse it. */ |
| 127 | if( zCI && (rid = name_to_rid(zCI))!=0 && content_get(rid, &content) ){ |
| 128 | if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){ |
| 129 | zCI = 0; |
| 130 | } |
| 131 | } |
| 132 | /* check existing checkin */ |
| 133 | if (zCI){ |
| 134 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 135 | if (!zUuid){ |
| 136 | zCI = 0; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /* Compute the title of the page */ |
| 141 | blob_zero(&dirname); |
| 142 | if( zD ){ |
| 143 | blob_append(&dirname, "in directory ", -1); |
| 144 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -121,23 +121,24 @@ | |
| 121 | pathelementFunc, 0, 0); |
| 122 | |
| 123 | /* If the name= parameter is an empty string, make it a NULL pointer */ |
| 124 | if( zD && strlen(zD)==0 ){ zD = 0; } |
| 125 | |
| 126 | /* If a specific check-in is requested, fetch and parse it. If the |
| 127 | ** specific check-in does not exist, clear zCI. zCI==0 will cause all |
| 128 | ** files from all check-ins to be displayed. |
| 129 | */ |
| 130 | if( zCI ){ |
| 131 | if( (rid = name_to_rid(zCI))==0 || content_get(rid, &content)==0 ){ |
| 132 | zCI = 0; /* No artifact named zCI exists */ |
| 133 | }else if( !manifest_parse(&m, &content) || m.type!=CFTYPE_MANIFEST ){ |
| 134 | zCI = 0; /* The artifact exists but is not a manifest */ |
| 135 | }else{ |
| 136 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | |
| 141 | /* Compute the title of the page */ |
| 142 | blob_zero(&dirname); |
| 143 | if( zD ){ |
| 144 | blob_append(&dirname, "in directory ", -1); |
| 145 |