Fossil SCM
Get the --latest option on the "co" command working when the current checkout is on a dead branch. Ticket [e42448edec1].
Commit
c98948242ea05e4c6918748c9b9af0dbcba1ff20
Parent
8fdac87b688c3ea…
1 file changed
+5
+5
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -181,10 +181,15 @@ | ||
| 181 | 181 | if( latestFlag ){ |
| 182 | 182 | compute_leaves(db_lget_int("checkout",0), 1); |
| 183 | 183 | zVers = db_text(0, "SELECT uuid FROM leaves, event, blob" |
| 184 | 184 | " WHERE event.objid=leaves.rid AND blob.rid=leaves.rid" |
| 185 | 185 | " ORDER BY event.mtime DESC"); |
| 186 | + if( zVers==0 ){ | |
| 187 | + zVers = db_text(0, "SELECT uuid FROM event, blob" | |
| 188 | + " WHERE event.objid=blob.rid AND event.type='ci'" | |
| 189 | + " ORDER BY event.mtime DESC"); | |
| 190 | + } | |
| 186 | 191 | if( zVers==0 ){ |
| 187 | 192 | fossil_fatal("cannot locate \"latest\" checkout"); |
| 188 | 193 | } |
| 189 | 194 | }else{ |
| 190 | 195 | zVers = g.argv[2]; |
| 191 | 196 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -181,10 +181,15 @@ | |
| 181 | if( latestFlag ){ |
| 182 | compute_leaves(db_lget_int("checkout",0), 1); |
| 183 | zVers = db_text(0, "SELECT uuid FROM leaves, event, blob" |
| 184 | " WHERE event.objid=leaves.rid AND blob.rid=leaves.rid" |
| 185 | " ORDER BY event.mtime DESC"); |
| 186 | if( zVers==0 ){ |
| 187 | fossil_fatal("cannot locate \"latest\" checkout"); |
| 188 | } |
| 189 | }else{ |
| 190 | zVers = g.argv[2]; |
| 191 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -181,10 +181,15 @@ | |
| 181 | if( latestFlag ){ |
| 182 | compute_leaves(db_lget_int("checkout",0), 1); |
| 183 | zVers = db_text(0, "SELECT uuid FROM leaves, event, blob" |
| 184 | " WHERE event.objid=leaves.rid AND blob.rid=leaves.rid" |
| 185 | " ORDER BY event.mtime DESC"); |
| 186 | if( zVers==0 ){ |
| 187 | zVers = db_text(0, "SELECT uuid FROM event, blob" |
| 188 | " WHERE event.objid=blob.rid AND event.type='ci'" |
| 189 | " ORDER BY event.mtime DESC"); |
| 190 | } |
| 191 | if( zVers==0 ){ |
| 192 | fossil_fatal("cannot locate \"latest\" checkout"); |
| 193 | } |
| 194 | }else{ |
| 195 | zVers = g.argv[2]; |
| 196 |