Fossil SCM
In contexts where only a check-out makes since, only resolve tags or branch names into check-outs, not events or other artifacts. Ticket [5f611295e3c2a8].
Commit
2a013f02282f36c9f53343534634d30b9f281dc4
Parent
e5e6ca46597a50d…
16 files changed
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+2
-2
+25
-17
+1
-1
+1
-1
+8
-8
+2
-2
+2
-2
+2
-2
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -137,11 +137,11 @@ | ||
| 137 | 137 | if( memcmp(zCmd, "bad", n)==0 ){ |
| 138 | 138 | int ridBad; |
| 139 | 139 | if( g.argc==3 ){ |
| 140 | 140 | ridBad = db_lget_int("checkout",0); |
| 141 | 141 | }else{ |
| 142 | - ridBad = name_to_rid(g.argv[3]); | |
| 142 | + ridBad = name_to_typed_rid(g.argv[3], "ci"); | |
| 143 | 143 | } |
| 144 | 144 | db_lset_int("bisect-bad", ridBad); |
| 145 | 145 | if( ridBad>0 |
| 146 | 146 | && bisect_option("auto-next") |
| 147 | 147 | && db_lget_int("bisect-good",0)>0 |
| @@ -154,11 +154,11 @@ | ||
| 154 | 154 | }else if( memcmp(zCmd, "good", n)==0 ){ |
| 155 | 155 | int ridGood; |
| 156 | 156 | if( g.argc==3 ){ |
| 157 | 157 | ridGood = db_lget_int("checkout",0); |
| 158 | 158 | }else{ |
| 159 | - ridGood = name_to_rid(g.argv[3]); | |
| 159 | + ridGood = name_to_typed_rid(g.argv[3], "ci"); | |
| 160 | 160 | } |
| 161 | 161 | db_lset_int("bisect-good", ridGood); |
| 162 | 162 | if( ridGood>0 |
| 163 | 163 | && bisect_option("auto-next") |
| 164 | 164 | && db_lget_int("bisect-bad",0)>0 |
| 165 | 165 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -137,11 +137,11 @@ | |
| 137 | if( memcmp(zCmd, "bad", n)==0 ){ |
| 138 | int ridBad; |
| 139 | if( g.argc==3 ){ |
| 140 | ridBad = db_lget_int("checkout",0); |
| 141 | }else{ |
| 142 | ridBad = name_to_rid(g.argv[3]); |
| 143 | } |
| 144 | db_lset_int("bisect-bad", ridBad); |
| 145 | if( ridBad>0 |
| 146 | && bisect_option("auto-next") |
| 147 | && db_lget_int("bisect-good",0)>0 |
| @@ -154,11 +154,11 @@ | |
| 154 | }else if( memcmp(zCmd, "good", n)==0 ){ |
| 155 | int ridGood; |
| 156 | if( g.argc==3 ){ |
| 157 | ridGood = db_lget_int("checkout",0); |
| 158 | }else{ |
| 159 | ridGood = name_to_rid(g.argv[3]); |
| 160 | } |
| 161 | db_lset_int("bisect-good", ridGood); |
| 162 | if( ridGood>0 |
| 163 | && bisect_option("auto-next") |
| 164 | && db_lget_int("bisect-bad",0)>0 |
| 165 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -137,11 +137,11 @@ | |
| 137 | if( memcmp(zCmd, "bad", n)==0 ){ |
| 138 | int ridBad; |
| 139 | if( g.argc==3 ){ |
| 140 | ridBad = db_lget_int("checkout",0); |
| 141 | }else{ |
| 142 | ridBad = name_to_typed_rid(g.argv[3], "ci"); |
| 143 | } |
| 144 | db_lset_int("bisect-bad", ridBad); |
| 145 | if( ridBad>0 |
| 146 | && bisect_option("auto-next") |
| 147 | && db_lget_int("bisect-good",0)>0 |
| @@ -154,11 +154,11 @@ | |
| 154 | }else if( memcmp(zCmd, "good", n)==0 ){ |
| 155 | int ridGood; |
| 156 | if( g.argc==3 ){ |
| 157 | ridGood = db_lget_int("checkout",0); |
| 158 | }else{ |
| 159 | ridGood = name_to_typed_rid(g.argv[3], "ci"); |
| 160 | } |
| 161 | db_lset_int("bisect-good", ridGood); |
| 162 | if( ridGood>0 |
| 163 | && bisect_option("auto-next") |
| 164 | && db_lget_int("bisect-bad",0)>0 |
| 165 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -68,11 +68,11 @@ | ||
| 68 | 68 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | user_select(); |
| 72 | 72 | db_begin_transaction(); |
| 73 | - rootid = name_to_rid(g.argv[4]); | |
| 73 | + rootid = name_to_typed_rid(g.argv[4], "ci"); | |
| 74 | 74 | if( rootid==0 ){ |
| 75 | 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | pParent = manifest_get(rootid, CFTYPE_MANIFEST); |
| 79 | 79 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -68,11 +68,11 @@ | |
| 68 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 69 | } |
| 70 | |
| 71 | user_select(); |
| 72 | db_begin_transaction(); |
| 73 | rootid = name_to_rid(g.argv[4]); |
| 74 | if( rootid==0 ){ |
| 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | } |
| 77 | |
| 78 | pParent = manifest_get(rootid, CFTYPE_MANIFEST); |
| 79 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -68,11 +68,11 @@ | |
| 68 | fossil_fatal("branch \"%s\" already exists", zBranch); |
| 69 | } |
| 70 | |
| 71 | user_select(); |
| 72 | db_begin_transaction(); |
| 73 | rootid = name_to_typed_rid(g.argv[4], "ci"); |
| 74 | if( rootid==0 ){ |
| 75 | fossil_fatal("unable to locate check-in off of which to branch"); |
| 76 | } |
| 77 | |
| 78 | pParent = manifest_get(rootid, CFTYPE_MANIFEST); |
| 79 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | int load_vfile(const char *zName){ |
| 61 | 61 | Blob uuid; |
| 62 | 62 | int vid; |
| 63 | 63 | |
| 64 | 64 | blob_init(&uuid, zName, -1); |
| 65 | - if( name_to_uuid(&uuid, 1) ){ | |
| 65 | + if( name_to_uuid(&uuid, 1, "ci") ){ | |
| 66 | 66 | fossil_panic(g.zErrMsg); |
| 67 | 67 | } |
| 68 | 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | 69 | if( vid==0 ){ |
| 70 | 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 | 71 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | int load_vfile(const char *zName){ |
| 61 | Blob uuid; |
| 62 | int vid; |
| 63 | |
| 64 | blob_init(&uuid, zName, -1); |
| 65 | if( name_to_uuid(&uuid, 1) ){ |
| 66 | fossil_panic(g.zErrMsg); |
| 67 | } |
| 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | if( vid==0 ){ |
| 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -60,11 +60,11 @@ | |
| 60 | int load_vfile(const char *zName){ |
| 61 | Blob uuid; |
| 62 | int vid; |
| 63 | |
| 64 | blob_init(&uuid, zName, -1); |
| 65 | if( name_to_uuid(&uuid, 1, "ci") ){ |
| 66 | fossil_panic(g.zErrMsg); |
| 67 | } |
| 68 | vid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 69 | if( vid==0 ){ |
| 70 | fossil_fatal("no such check-in: %s", g.argv[2]); |
| 71 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -242,11 +242,11 @@ | ||
| 242 | 242 | |
| 243 | 243 | db_must_be_within_tree(); |
| 244 | 244 | if( g.argc==2 ){ |
| 245 | 245 | base = db_lget_int("checkout", 0); |
| 246 | 246 | }else{ |
| 247 | - base = name_to_rid(g.argv[2]); | |
| 247 | + base = name_to_typed_rid(g.argv[2], "ci"); | |
| 248 | 248 | } |
| 249 | 249 | if( base==0 ) return; |
| 250 | 250 | compute_leaves(base, 0); |
| 251 | 251 | db_prepare(&q, |
| 252 | 252 | "%s" |
| 253 | 253 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -242,11 +242,11 @@ | |
| 242 | |
| 243 | db_must_be_within_tree(); |
| 244 | if( g.argc==2 ){ |
| 245 | base = db_lget_int("checkout", 0); |
| 246 | }else{ |
| 247 | base = name_to_rid(g.argv[2]); |
| 248 | } |
| 249 | if( base==0 ) return; |
| 250 | compute_leaves(base, 0); |
| 251 | db_prepare(&q, |
| 252 | "%s" |
| 253 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -242,11 +242,11 @@ | |
| 242 | |
| 243 | db_must_be_within_tree(); |
| 244 | if( g.argc==2 ){ |
| 245 | base = db_lget_int("checkout", 0); |
| 246 | }else{ |
| 247 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 248 | } |
| 249 | if( base==0 ) return; |
| 250 | compute_leaves(base, 0); |
| 251 | db_prepare(&q, |
| 252 | "%s" |
| 253 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -837,11 +837,11 @@ | ||
| 837 | 837 | int annFlags = 0; |
| 838 | 838 | Annotator ann; |
| 839 | 839 | |
| 840 | 840 | login_check_credentials(); |
| 841 | 841 | if( !g.okRead ){ login_needed(); return; } |
| 842 | - mid = name_to_rid(PD("checkin","0")); | |
| 842 | + mid = name_to_typed_rid(PD("checkin","0"),"ci"); | |
| 843 | 843 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename")); |
| 844 | 844 | if( mid==0 || fnid==0 ){ fossil_redirect_home(); } |
| 845 | 845 | iLimit = atoi(PD("limit","-1")); |
| 846 | 846 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){ |
| 847 | 847 | fossil_redirect_home(); |
| 848 | 848 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -837,11 +837,11 @@ | |
| 837 | int annFlags = 0; |
| 838 | Annotator ann; |
| 839 | |
| 840 | login_check_credentials(); |
| 841 | if( !g.okRead ){ login_needed(); return; } |
| 842 | mid = name_to_rid(PD("checkin","0")); |
| 843 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename")); |
| 844 | if( mid==0 || fnid==0 ){ fossil_redirect_home(); } |
| 845 | iLimit = atoi(PD("limit","-1")); |
| 846 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){ |
| 847 | fossil_redirect_home(); |
| 848 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -837,11 +837,11 @@ | |
| 837 | int annFlags = 0; |
| 838 | Annotator ann; |
| 839 | |
| 840 | login_check_credentials(); |
| 841 | if( !g.okRead ){ login_needed(); return; } |
| 842 | mid = name_to_typed_rid(PD("checkin","0"),"ci"); |
| 843 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename")); |
| 844 | if( mid==0 || fnid==0 ){ fossil_redirect_home(); } |
| 845 | iLimit = atoi(PD("limit","-1")); |
| 846 | if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){ |
| 847 | fossil_redirect_home(); |
| 848 |
+1
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -215,11 +215,11 @@ | ||
| 215 | 215 | vid = db_lget_int("checkout", 0); |
| 216 | 216 | vfile_check_signature(vid, 1, 0); |
| 217 | 217 | blob_zero(&sql); |
| 218 | 218 | db_begin_transaction(); |
| 219 | 219 | if( zFrom ){ |
| 220 | - int rid = name_to_rid(zFrom); | |
| 220 | + int rid = name_to_typed_rid(zFrom, "ci"); | |
| 221 | 221 | if( !is_a_version(rid) ){ |
| 222 | 222 | fossil_fatal("no such check-in: %s", zFrom); |
| 223 | 223 | } |
| 224 | 224 | load_vfile_from_rid(rid); |
| 225 | 225 | blob_appendf(&sql, |
| 226 | 226 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | vid = db_lget_int("checkout", 0); |
| 216 | vfile_check_signature(vid, 1, 0); |
| 217 | blob_zero(&sql); |
| 218 | db_begin_transaction(); |
| 219 | if( zFrom ){ |
| 220 | int rid = name_to_rid(zFrom); |
| 221 | if( !is_a_version(rid) ){ |
| 222 | fossil_fatal("no such check-in: %s", zFrom); |
| 223 | } |
| 224 | load_vfile_from_rid(rid); |
| 225 | blob_appendf(&sql, |
| 226 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -215,11 +215,11 @@ | |
| 215 | vid = db_lget_int("checkout", 0); |
| 216 | vfile_check_signature(vid, 1, 0); |
| 217 | blob_zero(&sql); |
| 218 | db_begin_transaction(); |
| 219 | if( zFrom ){ |
| 220 | int rid = name_to_typed_rid(zFrom, "ci"); |
| 221 | if( !is_a_version(rid) ){ |
| 222 | fossil_fatal("no such check-in: %s", zFrom); |
| 223 | } |
| 224 | load_vfile_from_rid(rid); |
| 225 | blob_appendf(&sql, |
| 226 |
+1
-1
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -396,11 +396,11 @@ | ||
| 396 | 396 | db_begin_transaction(); |
| 397 | 397 | if( fossil_strcmp(zBaseline,"tip")==0 ){ |
| 398 | 398 | vid = db_int(0, "SELECT objid FROM event WHERE type='ci'" |
| 399 | 399 | " ORDER BY mtime DESC LIMIT 1"); |
| 400 | 400 | }else{ |
| 401 | - vid = name_to_rid(zBaseline); | |
| 401 | + vid = name_to_typed_rid(zBaseline, "ci"); | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /* Create the baseline cache if it does not already exist */ |
| 405 | 405 | db_multi_exec( |
| 406 | 406 | "CREATE TABLE IF NOT EXISTS vcache(\n" |
| 407 | 407 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | db_begin_transaction(); |
| 397 | if( fossil_strcmp(zBaseline,"tip")==0 ){ |
| 398 | vid = db_int(0, "SELECT objid FROM event WHERE type='ci'" |
| 399 | " ORDER BY mtime DESC LIMIT 1"); |
| 400 | }else{ |
| 401 | vid = name_to_rid(zBaseline); |
| 402 | } |
| 403 | |
| 404 | /* Create the baseline cache if it does not already exist */ |
| 405 | db_multi_exec( |
| 406 | "CREATE TABLE IF NOT EXISTS vcache(\n" |
| 407 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -396,11 +396,11 @@ | |
| 396 | db_begin_transaction(); |
| 397 | if( fossil_strcmp(zBaseline,"tip")==0 ){ |
| 398 | vid = db_int(0, "SELECT objid FROM event WHERE type='ci'" |
| 399 | " ORDER BY mtime DESC LIMIT 1"); |
| 400 | }else{ |
| 401 | vid = name_to_typed_rid(zBaseline, "ci"); |
| 402 | } |
| 403 | |
| 404 | /* Create the baseline cache if it does not already exist */ |
| 405 | db_multi_exec( |
| 406 | "CREATE TABLE IF NOT EXISTS vcache(\n" |
| 407 |
+2
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1386,11 +1386,11 @@ | ||
| 1386 | 1386 | event_page(); |
| 1387 | 1387 | return; |
| 1388 | 1388 | } |
| 1389 | 1389 | } |
| 1390 | 1390 | blob_set(&uuid, zName); |
| 1391 | - rc = name_to_uuid(&uuid, -1); | |
| 1391 | + rc = name_to_uuid(&uuid, -1, "*"); | |
| 1392 | 1392 | if( rc==1 ){ |
| 1393 | 1393 | style_header("No Such Object"); |
| 1394 | 1394 | @ <p>No such object: %h(zName)</p> |
| 1395 | 1395 | style_footer(); |
| 1396 | 1396 | return; |
| @@ -1576,11 +1576,11 @@ | ||
| 1576 | 1576 | Blob comment; |
| 1577 | 1577 | Stmt q; |
| 1578 | 1578 | |
| 1579 | 1579 | login_check_credentials(); |
| 1580 | 1580 | if( !g.okWrite ){ login_needed(); return; } |
| 1581 | - rid = name_to_rid(P("r")); | |
| 1581 | + rid = name_to_typed_rid(P("r"), "ci"); | |
| 1582 | 1582 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1583 | 1583 | zComment = db_text(0, "SELECT coalesce(ecomment,comment)" |
| 1584 | 1584 | " FROM event WHERE objid=%d", rid); |
| 1585 | 1585 | if( zComment==0 ) fossil_redirect_home(); |
| 1586 | 1586 | if( P("cancel") ){ |
| 1587 | 1587 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1386,11 +1386,11 @@ | |
| 1386 | event_page(); |
| 1387 | return; |
| 1388 | } |
| 1389 | } |
| 1390 | blob_set(&uuid, zName); |
| 1391 | rc = name_to_uuid(&uuid, -1); |
| 1392 | if( rc==1 ){ |
| 1393 | style_header("No Such Object"); |
| 1394 | @ <p>No such object: %h(zName)</p> |
| 1395 | style_footer(); |
| 1396 | return; |
| @@ -1576,11 +1576,11 @@ | |
| 1576 | Blob comment; |
| 1577 | Stmt q; |
| 1578 | |
| 1579 | login_check_credentials(); |
| 1580 | if( !g.okWrite ){ login_needed(); return; } |
| 1581 | rid = name_to_rid(P("r")); |
| 1582 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1583 | zComment = db_text(0, "SELECT coalesce(ecomment,comment)" |
| 1584 | " FROM event WHERE objid=%d", rid); |
| 1585 | if( zComment==0 ) fossil_redirect_home(); |
| 1586 | if( P("cancel") ){ |
| 1587 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1386,11 +1386,11 @@ | |
| 1386 | event_page(); |
| 1387 | return; |
| 1388 | } |
| 1389 | } |
| 1390 | blob_set(&uuid, zName); |
| 1391 | rc = name_to_uuid(&uuid, -1, "*"); |
| 1392 | if( rc==1 ){ |
| 1393 | style_header("No Such Object"); |
| 1394 | @ <p>No such object: %h(zName)</p> |
| 1395 | style_footer(); |
| 1396 | return; |
| @@ -1576,11 +1576,11 @@ | |
| 1576 | Blob comment; |
| 1577 | Stmt q; |
| 1578 | |
| 1579 | login_check_credentials(); |
| 1580 | if( !g.okWrite ){ login_needed(); return; } |
| 1581 | rid = name_to_typed_rid(P("r"), "ci"); |
| 1582 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 1583 | zComment = db_text(0, "SELECT coalesce(ecomment,comment)" |
| 1584 | " FROM event WHERE objid=%d", rid); |
| 1585 | if( zComment==0 ) fossil_redirect_home(); |
| 1586 | if( P("cancel") ){ |
| 1587 |
+1
-1
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -920,11 +920,11 @@ | ||
| 920 | 920 | */ |
| 921 | 921 | Manifest *manifest_get_by_name(const char *zName, int *pRid){ |
| 922 | 922 | int rid; |
| 923 | 923 | Manifest *p; |
| 924 | 924 | |
| 925 | - rid = name_to_rid(zName); | |
| 925 | + rid = name_to_typed_rid(zName, "ci"); | |
| 926 | 926 | if( !is_a_version(rid) ){ |
| 927 | 927 | fossil_fatal("no such checkin: %s", zName); |
| 928 | 928 | } |
| 929 | 929 | if( pRid ) *pRid = rid; |
| 930 | 930 | p = manifest_get(rid, CFTYPE_MANIFEST); |
| 931 | 931 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -920,11 +920,11 @@ | |
| 920 | */ |
| 921 | Manifest *manifest_get_by_name(const char *zName, int *pRid){ |
| 922 | int rid; |
| 923 | Manifest *p; |
| 924 | |
| 925 | rid = name_to_rid(zName); |
| 926 | if( !is_a_version(rid) ){ |
| 927 | fossil_fatal("no such checkin: %s", zName); |
| 928 | } |
| 929 | if( pRid ) *pRid = rid; |
| 930 | p = manifest_get(rid, CFTYPE_MANIFEST); |
| 931 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -920,11 +920,11 @@ | |
| 920 | */ |
| 921 | Manifest *manifest_get_by_name(const char *zName, int *pRid){ |
| 922 | int rid; |
| 923 | Manifest *p; |
| 924 | |
| 925 | rid = name_to_typed_rid(zName, "ci"); |
| 926 | if( !is_a_version(rid) ){ |
| 927 | fossil_fatal("no such checkin: %s", zName); |
| 928 | } |
| 929 | if( pRid ) *pRid = rid; |
| 930 | p = manifest_get(rid, CFTYPE_MANIFEST); |
| 931 |
+2
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -96,16 +96,16 @@ | ||
| 96 | 96 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 97 | 97 | vid = db_lget_int("checkout", 0); |
| 98 | 98 | if( vid==0 ){ |
| 99 | 99 | fossil_fatal("nothing is checked out"); |
| 100 | 100 | } |
| 101 | - mid = name_to_rid(g.argv[2]); | |
| 101 | + mid = name_to_typed_rid(g.argv[2], "ci"); | |
| 102 | 102 | if( mid==0 || !is_a_version(mid) ){ |
| 103 | 103 | fossil_fatal("not a version: %s", g.argv[2]); |
| 104 | 104 | } |
| 105 | 105 | if( zPivot ){ |
| 106 | - pid = name_to_rid(zPivot); | |
| 106 | + pid = name_to_typed_rid(zPivot, "ci"); | |
| 107 | 107 | if( pid==0 || !is_a_version(pid) ){ |
| 108 | 108 | fossil_fatal("not a version: %s", zPivot); |
| 109 | 109 | } |
| 110 | 110 | if( pickFlag ){ |
| 111 | 111 | fossil_fatal("incompatible options: --cherrypick & --baseline"); |
| 112 | 112 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -96,16 +96,16 @@ | |
| 96 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 97 | vid = db_lget_int("checkout", 0); |
| 98 | if( vid==0 ){ |
| 99 | fossil_fatal("nothing is checked out"); |
| 100 | } |
| 101 | mid = name_to_rid(g.argv[2]); |
| 102 | if( mid==0 || !is_a_version(mid) ){ |
| 103 | fossil_fatal("not a version: %s", g.argv[2]); |
| 104 | } |
| 105 | if( zPivot ){ |
| 106 | pid = name_to_rid(zPivot); |
| 107 | if( pid==0 || !is_a_version(pid) ){ |
| 108 | fossil_fatal("not a version: %s", zPivot); |
| 109 | } |
| 110 | if( pickFlag ){ |
| 111 | fossil_fatal("incompatible options: --cherrypick & --baseline"); |
| 112 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -96,16 +96,16 @@ | |
| 96 | if( zBinGlob==0 ) zBinGlob = db_get("binary-glob",0); |
| 97 | vid = db_lget_int("checkout", 0); |
| 98 | if( vid==0 ){ |
| 99 | fossil_fatal("nothing is checked out"); |
| 100 | } |
| 101 | mid = name_to_typed_rid(g.argv[2], "ci"); |
| 102 | if( mid==0 || !is_a_version(mid) ){ |
| 103 | fossil_fatal("not a version: %s", g.argv[2]); |
| 104 | } |
| 105 | if( zPivot ){ |
| 106 | pid = name_to_typed_rid(zPivot, "ci"); |
| 107 | if( pid==0 || !is_a_version(pid) ){ |
| 108 | fossil_fatal("not a version: %s", zPivot); |
| 109 | } |
| 110 | if( pickFlag ){ |
| 111 | fossil_fatal("incompatible options: --cherrypick & --baseline"); |
| 112 |
+25
-17
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -40,24 +40,24 @@ | ||
| 40 | 40 | ** always resolve the name as a date. |
| 41 | 41 | ** |
| 42 | 42 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 43 | 43 | ** Return 2 name is ambiguous. |
| 44 | 44 | */ |
| 45 | -int name_to_uuid(Blob *pName, int iErrPriority){ | |
| 45 | +int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){ | |
| 46 | 46 | int rc; |
| 47 | 47 | int sz; |
| 48 | 48 | sz = blob_size(pName); |
| 49 | 49 | if( sz>UUID_SIZE || sz<4 || !validate16(blob_buffer(pName), sz) ){ |
| 50 | 50 | char *zUuid; |
| 51 | 51 | const char *zName = blob_str(pName); |
| 52 | 52 | if( memcmp(zName, "tag:", 4)==0 ){ |
| 53 | 53 | zName += 4; |
| 54 | - zUuid = tag_to_uuid(zName); | |
| 54 | + zUuid = tag_to_uuid(zName, zType); | |
| 55 | 55 | }else{ |
| 56 | - zUuid = tag_to_uuid(zName); | |
| 56 | + zUuid = tag_to_uuid(zName, zType); | |
| 57 | 57 | if( zUuid==0 ){ |
| 58 | - zUuid = date_to_uuid(zName); | |
| 58 | + zUuid = date_to_uuid(zName, zType); | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | if( zUuid ){ |
| 62 | 62 | blob_reset(pName); |
| 63 | 63 | blob_append(pName, zUuid, -1); |
| @@ -79,11 +79,11 @@ | ||
| 79 | 79 | Stmt q; |
| 80 | 80 | db_prepare(&q, "SELECT uuid FROM blob WHERE uuid GLOB '%b*'", pName); |
| 81 | 81 | if( db_step(&q)!=SQLITE_ROW ){ |
| 82 | 82 | char *zUuid; |
| 83 | 83 | db_finalize(&q); |
| 84 | - zUuid = tag_to_uuid(blob_str(pName)); | |
| 84 | + zUuid = tag_to_uuid(blob_str(pName), "*"); | |
| 85 | 85 | if( zUuid ){ |
| 86 | 86 | blob_reset(pName); |
| 87 | 87 | blob_append(pName, zUuid, -1); |
| 88 | 88 | free(zUuid); |
| 89 | 89 | return 0; |
| @@ -141,22 +141,25 @@ | ||
| 141 | 141 | ** An input of "tip" returns the most recent check-in. |
| 142 | 142 | ** |
| 143 | 143 | ** Memory to hold the returned string comes from malloc() and needs to |
| 144 | 144 | ** be freed by the caller. |
| 145 | 145 | */ |
| 146 | -char *tag_to_uuid(const char *zTag){ | |
| 146 | +char *tag_to_uuid(const char *zTag, const char *zType){ | |
| 147 | 147 | int vid; |
| 148 | - char *zUuid = | |
| 149 | - db_text(0, | |
| 148 | + char *zUuid; | |
| 149 | + | |
| 150 | + if( zType==0 || zType[0]==0 ) zType = "*"; | |
| 151 | + zUuid = db_text(0, | |
| 150 | 152 | "SELECT blob.uuid" |
| 151 | 153 | " FROM tag, tagxref, event, blob" |
| 152 | 154 | " WHERE tag.tagname='sym-%q' " |
| 153 | 155 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 154 | 156 | " AND event.objid=tagxref.rid " |
| 155 | 157 | " AND blob.rid=event.objid " |
| 158 | + " AND event.type GLOB '%q'" | |
| 156 | 159 | " ORDER BY event.mtime DESC ", |
| 157 | - zTag | |
| 160 | + zTag, zType | |
| 158 | 161 | ); |
| 159 | 162 | if( zUuid==0 ){ |
| 160 | 163 | int nTag = strlen(zTag); |
| 161 | 164 | int i; |
| 162 | 165 | for(i=0; i<nTag-10; i++){ |
| @@ -176,12 +179,13 @@ | ||
| 176 | 179 | " WHERE tag.tagname='sym-%q' " |
| 177 | 180 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 178 | 181 | " AND event.objid=tagxref.rid " |
| 179 | 182 | " AND blob.rid=event.objid " |
| 180 | 183 | " AND event.mtime<=julianday(%Q %s)" |
| 184 | + " AND event.type GLOB '%q'" | |
| 181 | 185 | " ORDER BY event.mtime DESC ", |
| 182 | - zTagBase, zDate, (useUtc ? "" : ",'utc'") | |
| 186 | + zTagBase, zDate, (useUtc ? "" : ",'utc'"), zType | |
| 183 | 187 | ); |
| 184 | 188 | break; |
| 185 | 189 | } |
| 186 | 190 | } |
| 187 | 191 | if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){ |
| @@ -222,11 +226,11 @@ | ||
| 222 | 226 | ** utc:DATE |
| 223 | 227 | ** |
| 224 | 228 | ** The DATE is interpreted as localtime unless the "utc:" prefix is used |
| 225 | 229 | ** or a "utc" string appears at the end of the DATE string. |
| 226 | 230 | */ |
| 227 | -char *date_to_uuid(const char *zDate){ | |
| 231 | +char *date_to_uuid(const char *zDate, const char *zType){ | |
| 228 | 232 | int useUtc = 0; |
| 229 | 233 | int n; |
| 230 | 234 | char *zCopy = 0; |
| 231 | 235 | char *zUuid; |
| 232 | 236 | |
| @@ -245,16 +249,17 @@ | ||
| 245 | 249 | zCopy[n-3] = 0; |
| 246 | 250 | zDate = zCopy; |
| 247 | 251 | n -= 3; |
| 248 | 252 | useUtc = 1; |
| 249 | 253 | } |
| 254 | + if( zType==0 || zType[0]==0 ) zType = "*"; | |
| 250 | 255 | zUuid = db_text(0, |
| 251 | 256 | "SELECT (SELECT uuid FROM blob WHERE rid=event.objid)" |
| 252 | 257 | " FROM event" |
| 253 | - " WHERE mtime<=julianday(%Q %s) AND type='ci'" | |
| 258 | + " WHERE mtime<=julianday(%Q %s) AND type GLOB '%q'" | |
| 254 | 259 | " ORDER BY mtime DESC LIMIT 1", |
| 255 | - zDate, useUtc ? "" : ",'utc'" | |
| 260 | + zDate, useUtc ? "" : ",'utc'", zType | |
| 256 | 261 | ); |
| 257 | 262 | free(zCopy); |
| 258 | 263 | return zUuid; |
| 259 | 264 | } |
| 260 | 265 | |
| @@ -268,11 +273,11 @@ | ||
| 268 | 273 | Blob name; |
| 269 | 274 | db_must_be_within_tree(); |
| 270 | 275 | for(i=2; i<g.argc; i++){ |
| 271 | 276 | blob_init(&name, g.argv[i], -1); |
| 272 | 277 | fossil_print("%s -> ", g.argv[i]); |
| 273 | - if( name_to_uuid(&name, 1) ){ | |
| 278 | + if( name_to_uuid(&name, 1, "*") ){ | |
| 274 | 279 | fossil_print("ERROR: %s\n", g.zErrMsg); |
| 275 | 280 | fossil_error_reset(); |
| 276 | 281 | }else{ |
| 277 | 282 | fossil_print("%s\n", blob_buffer(&name)); |
| 278 | 283 | } |
| @@ -287,18 +292,18 @@ | ||
| 287 | 292 | ** convert the uuid to a rid. |
| 288 | 293 | ** |
| 289 | 294 | ** This routine is used by command-line routines to resolve command-line inputs |
| 290 | 295 | ** into a rid. |
| 291 | 296 | */ |
| 292 | -int name_to_rid(const char *zName){ | |
| 297 | +int name_to_typed_rid(const char *zName, const char *zType){ | |
| 293 | 298 | int i; |
| 294 | 299 | int rid; |
| 295 | 300 | Blob name; |
| 296 | 301 | |
| 297 | 302 | if( zName==0 || zName[0]==0 ) return 0; |
| 298 | 303 | blob_init(&name, zName, -1); |
| 299 | - if( name_to_uuid(&name, -1) ){ | |
| 304 | + if( name_to_uuid(&name, -1, zType) ){ | |
| 300 | 305 | blob_reset(&name); |
| 301 | 306 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 302 | 307 | if( zName[i]==0 ){ |
| 303 | 308 | rid = atoi(zName); |
| 304 | 309 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| @@ -311,10 +316,13 @@ | ||
| 311 | 316 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name); |
| 312 | 317 | blob_reset(&name); |
| 313 | 318 | } |
| 314 | 319 | return rid; |
| 315 | 320 | } |
| 321 | +int name_to_rid(const char *zName){ | |
| 322 | + return name_to_typed_rid(zName, "*"); | |
| 323 | +} | |
| 316 | 324 | |
| 317 | 325 | /* |
| 318 | 326 | ** WEBPAGE: ambiguous |
| 319 | 327 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 320 | 328 | ** |
| @@ -361,11 +369,11 @@ | ||
| 361 | 369 | const char *zName = P(zParamName); |
| 362 | 370 | Blob name; |
| 363 | 371 | |
| 364 | 372 | if( zName==0 || zName[0]==0 ) return 0; |
| 365 | 373 | blob_init(&name, zName, -1); |
| 366 | - rc = name_to_uuid(&name, -1); | |
| 374 | + rc = name_to_uuid(&name, -1, "*"); | |
| 367 | 375 | if( rc==1 ){ |
| 368 | 376 | blob_reset(&name); |
| 369 | 377 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 370 | 378 | if( zName[i]==0 ){ |
| 371 | 379 | rid = atoi(zName); |
| 372 | 380 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -40,24 +40,24 @@ | |
| 40 | ** always resolve the name as a date. |
| 41 | ** |
| 42 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 43 | ** Return 2 name is ambiguous. |
| 44 | */ |
| 45 | int name_to_uuid(Blob *pName, int iErrPriority){ |
| 46 | int rc; |
| 47 | int sz; |
| 48 | sz = blob_size(pName); |
| 49 | if( sz>UUID_SIZE || sz<4 || !validate16(blob_buffer(pName), sz) ){ |
| 50 | char *zUuid; |
| 51 | const char *zName = blob_str(pName); |
| 52 | if( memcmp(zName, "tag:", 4)==0 ){ |
| 53 | zName += 4; |
| 54 | zUuid = tag_to_uuid(zName); |
| 55 | }else{ |
| 56 | zUuid = tag_to_uuid(zName); |
| 57 | if( zUuid==0 ){ |
| 58 | zUuid = date_to_uuid(zName); |
| 59 | } |
| 60 | } |
| 61 | if( zUuid ){ |
| 62 | blob_reset(pName); |
| 63 | blob_append(pName, zUuid, -1); |
| @@ -79,11 +79,11 @@ | |
| 79 | Stmt q; |
| 80 | db_prepare(&q, "SELECT uuid FROM blob WHERE uuid GLOB '%b*'", pName); |
| 81 | if( db_step(&q)!=SQLITE_ROW ){ |
| 82 | char *zUuid; |
| 83 | db_finalize(&q); |
| 84 | zUuid = tag_to_uuid(blob_str(pName)); |
| 85 | if( zUuid ){ |
| 86 | blob_reset(pName); |
| 87 | blob_append(pName, zUuid, -1); |
| 88 | free(zUuid); |
| 89 | return 0; |
| @@ -141,22 +141,25 @@ | |
| 141 | ** An input of "tip" returns the most recent check-in. |
| 142 | ** |
| 143 | ** Memory to hold the returned string comes from malloc() and needs to |
| 144 | ** be freed by the caller. |
| 145 | */ |
| 146 | char *tag_to_uuid(const char *zTag){ |
| 147 | int vid; |
| 148 | char *zUuid = |
| 149 | db_text(0, |
| 150 | "SELECT blob.uuid" |
| 151 | " FROM tag, tagxref, event, blob" |
| 152 | " WHERE tag.tagname='sym-%q' " |
| 153 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 154 | " AND event.objid=tagxref.rid " |
| 155 | " AND blob.rid=event.objid " |
| 156 | " ORDER BY event.mtime DESC ", |
| 157 | zTag |
| 158 | ); |
| 159 | if( zUuid==0 ){ |
| 160 | int nTag = strlen(zTag); |
| 161 | int i; |
| 162 | for(i=0; i<nTag-10; i++){ |
| @@ -176,12 +179,13 @@ | |
| 176 | " WHERE tag.tagname='sym-%q' " |
| 177 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 178 | " AND event.objid=tagxref.rid " |
| 179 | " AND blob.rid=event.objid " |
| 180 | " AND event.mtime<=julianday(%Q %s)" |
| 181 | " ORDER BY event.mtime DESC ", |
| 182 | zTagBase, zDate, (useUtc ? "" : ",'utc'") |
| 183 | ); |
| 184 | break; |
| 185 | } |
| 186 | } |
| 187 | if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){ |
| @@ -222,11 +226,11 @@ | |
| 222 | ** utc:DATE |
| 223 | ** |
| 224 | ** The DATE is interpreted as localtime unless the "utc:" prefix is used |
| 225 | ** or a "utc" string appears at the end of the DATE string. |
| 226 | */ |
| 227 | char *date_to_uuid(const char *zDate){ |
| 228 | int useUtc = 0; |
| 229 | int n; |
| 230 | char *zCopy = 0; |
| 231 | char *zUuid; |
| 232 | |
| @@ -245,16 +249,17 @@ | |
| 245 | zCopy[n-3] = 0; |
| 246 | zDate = zCopy; |
| 247 | n -= 3; |
| 248 | useUtc = 1; |
| 249 | } |
| 250 | zUuid = db_text(0, |
| 251 | "SELECT (SELECT uuid FROM blob WHERE rid=event.objid)" |
| 252 | " FROM event" |
| 253 | " WHERE mtime<=julianday(%Q %s) AND type='ci'" |
| 254 | " ORDER BY mtime DESC LIMIT 1", |
| 255 | zDate, useUtc ? "" : ",'utc'" |
| 256 | ); |
| 257 | free(zCopy); |
| 258 | return zUuid; |
| 259 | } |
| 260 | |
| @@ -268,11 +273,11 @@ | |
| 268 | Blob name; |
| 269 | db_must_be_within_tree(); |
| 270 | for(i=2; i<g.argc; i++){ |
| 271 | blob_init(&name, g.argv[i], -1); |
| 272 | fossil_print("%s -> ", g.argv[i]); |
| 273 | if( name_to_uuid(&name, 1) ){ |
| 274 | fossil_print("ERROR: %s\n", g.zErrMsg); |
| 275 | fossil_error_reset(); |
| 276 | }else{ |
| 277 | fossil_print("%s\n", blob_buffer(&name)); |
| 278 | } |
| @@ -287,18 +292,18 @@ | |
| 287 | ** convert the uuid to a rid. |
| 288 | ** |
| 289 | ** This routine is used by command-line routines to resolve command-line inputs |
| 290 | ** into a rid. |
| 291 | */ |
| 292 | int name_to_rid(const char *zName){ |
| 293 | int i; |
| 294 | int rid; |
| 295 | Blob name; |
| 296 | |
| 297 | if( zName==0 || zName[0]==0 ) return 0; |
| 298 | blob_init(&name, zName, -1); |
| 299 | if( name_to_uuid(&name, -1) ){ |
| 300 | blob_reset(&name); |
| 301 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 302 | if( zName[i]==0 ){ |
| 303 | rid = atoi(zName); |
| 304 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| @@ -311,10 +316,13 @@ | |
| 311 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name); |
| 312 | blob_reset(&name); |
| 313 | } |
| 314 | return rid; |
| 315 | } |
| 316 | |
| 317 | /* |
| 318 | ** WEBPAGE: ambiguous |
| 319 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 320 | ** |
| @@ -361,11 +369,11 @@ | |
| 361 | const char *zName = P(zParamName); |
| 362 | Blob name; |
| 363 | |
| 364 | if( zName==0 || zName[0]==0 ) return 0; |
| 365 | blob_init(&name, zName, -1); |
| 366 | rc = name_to_uuid(&name, -1); |
| 367 | if( rc==1 ){ |
| 368 | blob_reset(&name); |
| 369 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 370 | if( zName[i]==0 ){ |
| 371 | rid = atoi(zName); |
| 372 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -40,24 +40,24 @@ | |
| 40 | ** always resolve the name as a date. |
| 41 | ** |
| 42 | ** Return 0 on success. Return 1 if the name cannot be resolved. |
| 43 | ** Return 2 name is ambiguous. |
| 44 | */ |
| 45 | int name_to_uuid(Blob *pName, int iErrPriority, const char *zType){ |
| 46 | int rc; |
| 47 | int sz; |
| 48 | sz = blob_size(pName); |
| 49 | if( sz>UUID_SIZE || sz<4 || !validate16(blob_buffer(pName), sz) ){ |
| 50 | char *zUuid; |
| 51 | const char *zName = blob_str(pName); |
| 52 | if( memcmp(zName, "tag:", 4)==0 ){ |
| 53 | zName += 4; |
| 54 | zUuid = tag_to_uuid(zName, zType); |
| 55 | }else{ |
| 56 | zUuid = tag_to_uuid(zName, zType); |
| 57 | if( zUuid==0 ){ |
| 58 | zUuid = date_to_uuid(zName, zType); |
| 59 | } |
| 60 | } |
| 61 | if( zUuid ){ |
| 62 | blob_reset(pName); |
| 63 | blob_append(pName, zUuid, -1); |
| @@ -79,11 +79,11 @@ | |
| 79 | Stmt q; |
| 80 | db_prepare(&q, "SELECT uuid FROM blob WHERE uuid GLOB '%b*'", pName); |
| 81 | if( db_step(&q)!=SQLITE_ROW ){ |
| 82 | char *zUuid; |
| 83 | db_finalize(&q); |
| 84 | zUuid = tag_to_uuid(blob_str(pName), "*"); |
| 85 | if( zUuid ){ |
| 86 | blob_reset(pName); |
| 87 | blob_append(pName, zUuid, -1); |
| 88 | free(zUuid); |
| 89 | return 0; |
| @@ -141,22 +141,25 @@ | |
| 141 | ** An input of "tip" returns the most recent check-in. |
| 142 | ** |
| 143 | ** Memory to hold the returned string comes from malloc() and needs to |
| 144 | ** be freed by the caller. |
| 145 | */ |
| 146 | char *tag_to_uuid(const char *zTag, const char *zType){ |
| 147 | int vid; |
| 148 | char *zUuid; |
| 149 | |
| 150 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 151 | zUuid = db_text(0, |
| 152 | "SELECT blob.uuid" |
| 153 | " FROM tag, tagxref, event, blob" |
| 154 | " WHERE tag.tagname='sym-%q' " |
| 155 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 156 | " AND event.objid=tagxref.rid " |
| 157 | " AND blob.rid=event.objid " |
| 158 | " AND event.type GLOB '%q'" |
| 159 | " ORDER BY event.mtime DESC ", |
| 160 | zTag, zType |
| 161 | ); |
| 162 | if( zUuid==0 ){ |
| 163 | int nTag = strlen(zTag); |
| 164 | int i; |
| 165 | for(i=0; i<nTag-10; i++){ |
| @@ -176,12 +179,13 @@ | |
| 179 | " WHERE tag.tagname='sym-%q' " |
| 180 | " AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 " |
| 181 | " AND event.objid=tagxref.rid " |
| 182 | " AND blob.rid=event.objid " |
| 183 | " AND event.mtime<=julianday(%Q %s)" |
| 184 | " AND event.type GLOB '%q'" |
| 185 | " ORDER BY event.mtime DESC ", |
| 186 | zTagBase, zDate, (useUtc ? "" : ",'utc'"), zType |
| 187 | ); |
| 188 | break; |
| 189 | } |
| 190 | } |
| 191 | if( zUuid==0 && fossil_strcmp(zTag, "tip")==0 ){ |
| @@ -222,11 +226,11 @@ | |
| 226 | ** utc:DATE |
| 227 | ** |
| 228 | ** The DATE is interpreted as localtime unless the "utc:" prefix is used |
| 229 | ** or a "utc" string appears at the end of the DATE string. |
| 230 | */ |
| 231 | char *date_to_uuid(const char *zDate, const char *zType){ |
| 232 | int useUtc = 0; |
| 233 | int n; |
| 234 | char *zCopy = 0; |
| 235 | char *zUuid; |
| 236 | |
| @@ -245,16 +249,17 @@ | |
| 249 | zCopy[n-3] = 0; |
| 250 | zDate = zCopy; |
| 251 | n -= 3; |
| 252 | useUtc = 1; |
| 253 | } |
| 254 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 255 | zUuid = db_text(0, |
| 256 | "SELECT (SELECT uuid FROM blob WHERE rid=event.objid)" |
| 257 | " FROM event" |
| 258 | " WHERE mtime<=julianday(%Q %s) AND type GLOB '%q'" |
| 259 | " ORDER BY mtime DESC LIMIT 1", |
| 260 | zDate, useUtc ? "" : ",'utc'", zType |
| 261 | ); |
| 262 | free(zCopy); |
| 263 | return zUuid; |
| 264 | } |
| 265 | |
| @@ -268,11 +273,11 @@ | |
| 273 | Blob name; |
| 274 | db_must_be_within_tree(); |
| 275 | for(i=2; i<g.argc; i++){ |
| 276 | blob_init(&name, g.argv[i], -1); |
| 277 | fossil_print("%s -> ", g.argv[i]); |
| 278 | if( name_to_uuid(&name, 1, "*") ){ |
| 279 | fossil_print("ERROR: %s\n", g.zErrMsg); |
| 280 | fossil_error_reset(); |
| 281 | }else{ |
| 282 | fossil_print("%s\n", blob_buffer(&name)); |
| 283 | } |
| @@ -287,18 +292,18 @@ | |
| 292 | ** convert the uuid to a rid. |
| 293 | ** |
| 294 | ** This routine is used by command-line routines to resolve command-line inputs |
| 295 | ** into a rid. |
| 296 | */ |
| 297 | int name_to_typed_rid(const char *zName, const char *zType){ |
| 298 | int i; |
| 299 | int rid; |
| 300 | Blob name; |
| 301 | |
| 302 | if( zName==0 || zName[0]==0 ) return 0; |
| 303 | blob_init(&name, zName, -1); |
| 304 | if( name_to_uuid(&name, -1, zType) ){ |
| 305 | blob_reset(&name); |
| 306 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 307 | if( zName[i]==0 ){ |
| 308 | rid = atoi(zName); |
| 309 | if( db_exists("SELECT 1 FROM blob WHERE rid=%d", rid) ){ |
| @@ -311,10 +316,13 @@ | |
| 316 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &name); |
| 317 | blob_reset(&name); |
| 318 | } |
| 319 | return rid; |
| 320 | } |
| 321 | int name_to_rid(const char *zName){ |
| 322 | return name_to_typed_rid(zName, "*"); |
| 323 | } |
| 324 | |
| 325 | /* |
| 326 | ** WEBPAGE: ambiguous |
| 327 | ** URL: /ambiguous?name=UUID&src=WEBPAGE |
| 328 | ** |
| @@ -361,11 +369,11 @@ | |
| 369 | const char *zName = P(zParamName); |
| 370 | Blob name; |
| 371 | |
| 372 | if( zName==0 || zName[0]==0 ) return 0; |
| 373 | blob_init(&name, zName, -1); |
| 374 | rc = name_to_uuid(&name, -1, "*"); |
| 375 | if( rc==1 ){ |
| 376 | blob_reset(&name); |
| 377 | for(i=0; zName[i] && fossil_isdigit(zName[i]); i++){} |
| 378 | if( zName[i]==0 ){ |
| 379 | rid = atoi(zName); |
| 380 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -296,11 +296,11 @@ | ||
| 296 | 296 | |
| 297 | 297 | assert( tagtype>=0 && tagtype<=2 ); |
| 298 | 298 | user_select(); |
| 299 | 299 | blob_zero(&uuid); |
| 300 | 300 | blob_append(&uuid, zObjName, -1); |
| 301 | - if( name_to_uuid(&uuid, 9) ){ | |
| 301 | + if( name_to_uuid(&uuid, 9, "*") ){ | |
| 302 | 302 | fossil_fatal("%s", g.zErrMsg); |
| 303 | 303 | return; |
| 304 | 304 | } |
| 305 | 305 | rid = name_to_rid(blob_str(&uuid)); |
| 306 | 306 | g.markPrivate = content_is_private(rid); |
| 307 | 307 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -296,11 +296,11 @@ | |
| 296 | |
| 297 | assert( tagtype>=0 && tagtype<=2 ); |
| 298 | user_select(); |
| 299 | blob_zero(&uuid); |
| 300 | blob_append(&uuid, zObjName, -1); |
| 301 | if( name_to_uuid(&uuid, 9) ){ |
| 302 | fossil_fatal("%s", g.zErrMsg); |
| 303 | return; |
| 304 | } |
| 305 | rid = name_to_rid(blob_str(&uuid)); |
| 306 | g.markPrivate = content_is_private(rid); |
| 307 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -296,11 +296,11 @@ | |
| 296 | |
| 297 | assert( tagtype>=0 && tagtype<=2 ); |
| 298 | user_select(); |
| 299 | blob_zero(&uuid); |
| 300 | blob_append(&uuid, zObjName, -1); |
| 301 | if( name_to_uuid(&uuid, 9, "*") ){ |
| 302 | fossil_fatal("%s", g.zErrMsg); |
| 303 | return; |
| 304 | } |
| 305 | rid = name_to_rid(blob_str(&uuid)); |
| 306 | g.markPrivate = content_is_private(rid); |
| 307 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -273,11 +273,11 @@ | ||
| 273 | 273 | zName = find_option("name", 0, 1); |
| 274 | 274 | db_find_and_open_repository(0, 0); |
| 275 | 275 | if( g.argc!=4 ){ |
| 276 | 276 | usage("VERSION OUTPUTFILE"); |
| 277 | 277 | } |
| 278 | - rid = name_to_rid(g.argv[2]); | |
| 278 | + rid = name_to_typed_rid(g.argv[2], "ci"); | |
| 279 | 279 | if( zName==0 ){ |
| 280 | 280 | zName = db_text("default-name", |
| 281 | 281 | "SELECT replace(%Q,' ','_') " |
| 282 | 282 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 283 | 283 | " || substr(blob.uuid, 1, 10)" |
| 284 | 284 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | zName = find_option("name", 0, 1); |
| 274 | db_find_and_open_repository(0, 0); |
| 275 | if( g.argc!=4 ){ |
| 276 | usage("VERSION OUTPUTFILE"); |
| 277 | } |
| 278 | rid = name_to_rid(g.argv[2]); |
| 279 | if( zName==0 ){ |
| 280 | zName = db_text("default-name", |
| 281 | "SELECT replace(%Q,' ','_') " |
| 282 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 283 | " || substr(blob.uuid, 1, 10)" |
| 284 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | zName = find_option("name", 0, 1); |
| 274 | db_find_and_open_repository(0, 0); |
| 275 | if( g.argc!=4 ){ |
| 276 | usage("VERSION OUTPUTFILE"); |
| 277 | } |
| 278 | rid = name_to_typed_rid(g.argv[2], "ci"); |
| 279 | if( zName==0 ){ |
| 280 | zName = db_text("default-name", |
| 281 | "SELECT replace(%Q,' ','_') " |
| 282 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 283 | " || substr(blob.uuid, 1, 10)" |
| 284 |
+8
-8
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -782,13 +782,13 @@ | ||
| 782 | 782 | void page_timeline(void){ |
| 783 | 783 | Stmt q; /* Query used to generate the timeline */ |
| 784 | 784 | Blob sql; /* text of SQL used to generate timeline */ |
| 785 | 785 | Blob desc; /* Description of the timeline */ |
| 786 | 786 | int nEntry = atoi(PD("n","20")); /* Max number of entries on timeline */ |
| 787 | - int p_rid = name_to_rid(P("p")); /* artifact p and its parents */ | |
| 788 | - int d_rid = name_to_rid(P("d")); /* artifact d and its descendants */ | |
| 789 | - int f_rid = name_to_rid(P("f")); /* artifact f and immediate family */ | |
| 787 | + int p_rid = name_to_typed_rid(P("p"),"ci"); /* artifact p and its parents */ | |
| 788 | + int d_rid = name_to_typed_rid(P("d"),"ci"); /* artifact d and descendants */ | |
| 789 | + int f_rid = name_to_typed_rid(P("f"),"ci"); /* artifact f and close family */ | |
| 790 | 790 | const char *zUser = P("u"); /* All entries by this user if not NULL */ |
| 791 | 791 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 792 | 792 | const char *zAfter = P("a"); /* Events after this time */ |
| 793 | 793 | const char *zBefore = P("b"); /* Events before this time */ |
| 794 | 794 | const char *zCirca = P("c"); /* Events near this time */ |
| @@ -799,15 +799,15 @@ | ||
| 799 | 799 | int tagid; /* Tag ID */ |
| 800 | 800 | int tmFlags; /* Timeline flags */ |
| 801 | 801 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 802 | 802 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 803 | 803 | HQuery url; /* URL for various branch links */ |
| 804 | - int from_rid = name_to_rid(P("from")); /* from= for path timelines */ | |
| 805 | - int to_rid = name_to_rid(P("to")); /* to= for path timelines */ | |
| 804 | + int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ | |
| 805 | + int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */ | |
| 806 | 806 | int noMerge = P("nomerge")!=0; /* Do not follow merge links */ |
| 807 | - int me_rid = name_to_rid(P("me")); /* me= for common ancestory path */ | |
| 808 | - int you_rid = name_to_rid(P("you"));/* you= for common ancst path */ | |
| 807 | + int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ | |
| 808 | + int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ | |
| 809 | 809 | |
| 810 | 810 | /* To view the timeline, must have permission to read project data. |
| 811 | 811 | */ |
| 812 | 812 | login_check_credentials(); |
| 813 | 813 | if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; } |
| @@ -1361,11 +1361,11 @@ | ||
| 1361 | 1361 | if( !g.localOpen ){ |
| 1362 | 1362 | fossil_fatal("must be within a local checkout to use 'current'"); |
| 1363 | 1363 | } |
| 1364 | 1364 | objid = db_lget_int("checkout",0); |
| 1365 | 1365 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1366 | - }else if( name_to_uuid(&uuid, 0)==0 ){ | |
| 1366 | + }else if( name_to_uuid(&uuid, 0, "*")==0 ){ | |
| 1367 | 1367 | objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 1368 | 1368 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1369 | 1369 | }else{ |
| 1370 | 1370 | const char *zShift = ""; |
| 1371 | 1371 | if( mode==3 || mode==4 ){ |
| 1372 | 1372 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -782,13 +782,13 @@ | |
| 782 | void page_timeline(void){ |
| 783 | Stmt q; /* Query used to generate the timeline */ |
| 784 | Blob sql; /* text of SQL used to generate timeline */ |
| 785 | Blob desc; /* Description of the timeline */ |
| 786 | int nEntry = atoi(PD("n","20")); /* Max number of entries on timeline */ |
| 787 | int p_rid = name_to_rid(P("p")); /* artifact p and its parents */ |
| 788 | int d_rid = name_to_rid(P("d")); /* artifact d and its descendants */ |
| 789 | int f_rid = name_to_rid(P("f")); /* artifact f and immediate family */ |
| 790 | const char *zUser = P("u"); /* All entries by this user if not NULL */ |
| 791 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 792 | const char *zAfter = P("a"); /* Events after this time */ |
| 793 | const char *zBefore = P("b"); /* Events before this time */ |
| 794 | const char *zCirca = P("c"); /* Events near this time */ |
| @@ -799,15 +799,15 @@ | |
| 799 | int tagid; /* Tag ID */ |
| 800 | int tmFlags; /* Timeline flags */ |
| 801 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 802 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 803 | HQuery url; /* URL for various branch links */ |
| 804 | int from_rid = name_to_rid(P("from")); /* from= for path timelines */ |
| 805 | int to_rid = name_to_rid(P("to")); /* to= for path timelines */ |
| 806 | int noMerge = P("nomerge")!=0; /* Do not follow merge links */ |
| 807 | int me_rid = name_to_rid(P("me")); /* me= for common ancestory path */ |
| 808 | int you_rid = name_to_rid(P("you"));/* you= for common ancst path */ |
| 809 | |
| 810 | /* To view the timeline, must have permission to read project data. |
| 811 | */ |
| 812 | login_check_credentials(); |
| 813 | if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; } |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | if( !g.localOpen ){ |
| 1362 | fossil_fatal("must be within a local checkout to use 'current'"); |
| 1363 | } |
| 1364 | objid = db_lget_int("checkout",0); |
| 1365 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1366 | }else if( name_to_uuid(&uuid, 0)==0 ){ |
| 1367 | objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 1368 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1369 | }else{ |
| 1370 | const char *zShift = ""; |
| 1371 | if( mode==3 || mode==4 ){ |
| 1372 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -782,13 +782,13 @@ | |
| 782 | void page_timeline(void){ |
| 783 | Stmt q; /* Query used to generate the timeline */ |
| 784 | Blob sql; /* text of SQL used to generate timeline */ |
| 785 | Blob desc; /* Description of the timeline */ |
| 786 | int nEntry = atoi(PD("n","20")); /* Max number of entries on timeline */ |
| 787 | int p_rid = name_to_typed_rid(P("p"),"ci"); /* artifact p and its parents */ |
| 788 | int d_rid = name_to_typed_rid(P("d"),"ci"); /* artifact d and descendants */ |
| 789 | int f_rid = name_to_typed_rid(P("f"),"ci"); /* artifact f and close family */ |
| 790 | const char *zUser = P("u"); /* All entries by this user if not NULL */ |
| 791 | const char *zType = PD("y","all"); /* Type of events. All if NULL */ |
| 792 | const char *zAfter = P("a"); /* Events after this time */ |
| 793 | const char *zBefore = P("b"); /* Events before this time */ |
| 794 | const char *zCirca = P("c"); /* Events near this time */ |
| @@ -799,15 +799,15 @@ | |
| 799 | int tagid; /* Tag ID */ |
| 800 | int tmFlags; /* Timeline flags */ |
| 801 | const char *zThisTag = 0; /* Suppress links to this tag */ |
| 802 | const char *zThisUser = 0; /* Suppress links to this user */ |
| 803 | HQuery url; /* URL for various branch links */ |
| 804 | int from_rid = name_to_typed_rid(P("from"),"ci"); /* from= for paths */ |
| 805 | int to_rid = name_to_typed_rid(P("to"),"ci"); /* to= for path timelines */ |
| 806 | int noMerge = P("nomerge")!=0; /* Do not follow merge links */ |
| 807 | int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ |
| 808 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 809 | |
| 810 | /* To view the timeline, must have permission to read project data. |
| 811 | */ |
| 812 | login_check_credentials(); |
| 813 | if( !g.okRead && !g.okRdTkt && !g.okRdWiki ){ login_needed(); return; } |
| @@ -1361,11 +1361,11 @@ | |
| 1361 | if( !g.localOpen ){ |
| 1362 | fossil_fatal("must be within a local checkout to use 'current'"); |
| 1363 | } |
| 1364 | objid = db_lget_int("checkout",0); |
| 1365 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1366 | }else if( name_to_uuid(&uuid, 0, "*")==0 ){ |
| 1367 | objid = db_int(0, "SELECT rid FROM blob WHERE uuid=%B", &uuid); |
| 1368 | zDate = mprintf("(SELECT mtime FROM plink WHERE cid=%d)", objid); |
| 1369 | }else{ |
| 1370 | const char *zShift = ""; |
| 1371 | if( mode==3 || mode==4 ){ |
| 1372 |
+2
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -128,11 +128,11 @@ | ||
| 128 | 128 | /* If VERSION is "latest", then use the same algorithm to find the |
| 129 | 129 | ** target as if VERSION were omitted and the --latest flag is present. |
| 130 | 130 | */ |
| 131 | 131 | latestFlag = 1; |
| 132 | 132 | }else{ |
| 133 | - tid = name_to_rid(g.argv[2]); | |
| 133 | + tid = name_to_typed_rid(g.argv[2],"ci"); | |
| 134 | 134 | if( tid==0 ){ |
| 135 | 135 | fossil_fatal("no such version: %s", g.argv[2]); |
| 136 | 136 | }else if( !is_a_version(tid) ){ |
| 137 | 137 | fossil_fatal("no such version: %s", g.argv[2]); |
| 138 | 138 | } |
| @@ -473,11 +473,11 @@ | ||
| 473 | 473 | Manifest *pManifest; |
| 474 | 474 | ManifestFile *pFile; |
| 475 | 475 | int rid=0; |
| 476 | 476 | |
| 477 | 477 | if( revision ){ |
| 478 | - rid = name_to_rid(revision); | |
| 478 | + rid = name_to_typed_rid(revision,"ci"); | |
| 479 | 479 | }else{ |
| 480 | 480 | rid = db_lget_int("checkout", 0); |
| 481 | 481 | } |
| 482 | 482 | if( !is_a_version(rid) ){ |
| 483 | 483 | if( errCode>0 ) return errCode; |
| 484 | 484 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | /* If VERSION is "latest", then use the same algorithm to find the |
| 129 | ** target as if VERSION were omitted and the --latest flag is present. |
| 130 | */ |
| 131 | latestFlag = 1; |
| 132 | }else{ |
| 133 | tid = name_to_rid(g.argv[2]); |
| 134 | if( tid==0 ){ |
| 135 | fossil_fatal("no such version: %s", g.argv[2]); |
| 136 | }else if( !is_a_version(tid) ){ |
| 137 | fossil_fatal("no such version: %s", g.argv[2]); |
| 138 | } |
| @@ -473,11 +473,11 @@ | |
| 473 | Manifest *pManifest; |
| 474 | ManifestFile *pFile; |
| 475 | int rid=0; |
| 476 | |
| 477 | if( revision ){ |
| 478 | rid = name_to_rid(revision); |
| 479 | }else{ |
| 480 | rid = db_lget_int("checkout", 0); |
| 481 | } |
| 482 | if( !is_a_version(rid) ){ |
| 483 | if( errCode>0 ) return errCode; |
| 484 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | /* If VERSION is "latest", then use the same algorithm to find the |
| 129 | ** target as if VERSION were omitted and the --latest flag is present. |
| 130 | */ |
| 131 | latestFlag = 1; |
| 132 | }else{ |
| 133 | tid = name_to_typed_rid(g.argv[2],"ci"); |
| 134 | if( tid==0 ){ |
| 135 | fossil_fatal("no such version: %s", g.argv[2]); |
| 136 | }else if( !is_a_version(tid) ){ |
| 137 | fossil_fatal("no such version: %s", g.argv[2]); |
| 138 | } |
| @@ -473,11 +473,11 @@ | |
| 473 | Manifest *pManifest; |
| 474 | ManifestFile *pFile; |
| 475 | int rid=0; |
| 476 | |
| 477 | if( revision ){ |
| 478 | rid = name_to_typed_rid(revision,"ci"); |
| 479 | }else{ |
| 480 | rid = db_lget_int("checkout", 0); |
| 481 | } |
| 482 | if( !is_a_version(rid) ){ |
| 483 | if( errCode>0 ) return errCode; |
| 484 |
+2
-2
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -392,11 +392,11 @@ | ||
| 392 | 392 | zName = find_option("name", 0, 1); |
| 393 | 393 | db_find_and_open_repository(0, 0); |
| 394 | 394 | if( g.argc!=4 ){ |
| 395 | 395 | usage("VERSION OUTPUTFILE"); |
| 396 | 396 | } |
| 397 | - rid = name_to_rid(g.argv[2]); | |
| 397 | + rid = name_to_typed_rid(g.argv[2],"ci"); | |
| 398 | 398 | if( zName==0 ){ |
| 399 | 399 | zName = db_text("default-name", |
| 400 | 400 | "SELECT replace(%Q,' ','_') " |
| 401 | 401 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 402 | 402 | " || substr(blob.uuid, 1, 10)" |
| @@ -433,11 +433,11 @@ | ||
| 433 | 433 | if( zName[nName]=='.' ){ |
| 434 | 434 | zName[nName] = 0; |
| 435 | 435 | break; |
| 436 | 436 | } |
| 437 | 437 | } |
| 438 | - rid = name_to_rid(nRid?zRid:zName); | |
| 438 | + rid = name_to_typed_rid(nRid?zRid:zName,"ci"); | |
| 439 | 439 | if( rid==0 ){ |
| 440 | 440 | @ Not found |
| 441 | 441 | return; |
| 442 | 442 | } |
| 443 | 443 | if( nRid==0 && nName>10 ) zName[10] = 0; |
| 444 | 444 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -392,11 +392,11 @@ | |
| 392 | zName = find_option("name", 0, 1); |
| 393 | db_find_and_open_repository(0, 0); |
| 394 | if( g.argc!=4 ){ |
| 395 | usage("VERSION OUTPUTFILE"); |
| 396 | } |
| 397 | rid = name_to_rid(g.argv[2]); |
| 398 | if( zName==0 ){ |
| 399 | zName = db_text("default-name", |
| 400 | "SELECT replace(%Q,' ','_') " |
| 401 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 402 | " || substr(blob.uuid, 1, 10)" |
| @@ -433,11 +433,11 @@ | |
| 433 | if( zName[nName]=='.' ){ |
| 434 | zName[nName] = 0; |
| 435 | break; |
| 436 | } |
| 437 | } |
| 438 | rid = name_to_rid(nRid?zRid:zName); |
| 439 | if( rid==0 ){ |
| 440 | @ Not found |
| 441 | return; |
| 442 | } |
| 443 | if( nRid==0 && nName>10 ) zName[10] = 0; |
| 444 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -392,11 +392,11 @@ | |
| 392 | zName = find_option("name", 0, 1); |
| 393 | db_find_and_open_repository(0, 0); |
| 394 | if( g.argc!=4 ){ |
| 395 | usage("VERSION OUTPUTFILE"); |
| 396 | } |
| 397 | rid = name_to_typed_rid(g.argv[2],"ci"); |
| 398 | if( zName==0 ){ |
| 399 | zName = db_text("default-name", |
| 400 | "SELECT replace(%Q,' ','_') " |
| 401 | " || strftime('_%%Y-%%m-%%d_%%H%%M%%S_', event.mtime) " |
| 402 | " || substr(blob.uuid, 1, 10)" |
| @@ -433,11 +433,11 @@ | |
| 433 | if( zName[nName]=='.' ){ |
| 434 | zName[nName] = 0; |
| 435 | break; |
| 436 | } |
| 437 | } |
| 438 | rid = name_to_typed_rid(nRid?zRid:zName,"ci"); |
| 439 | if( rid==0 ){ |
| 440 | @ Not found |
| 441 | return; |
| 442 | } |
| 443 | if( nRid==0 && nName>10 ) zName[10] = 0; |
| 444 |