Fossil SCM
Add support for the -R option on several command-line subcommands.
Commit
4fe221411663c2f6d88340d17de2543ad70ec027
Parent
ce354d0a9f62cde…
2 files changed
+2
-2
+7
-10
+2
-2
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -273,11 +273,11 @@ | ||
| 273 | 273 | */ |
| 274 | 274 | void descendants_cmd(void){ |
| 275 | 275 | Stmt q; |
| 276 | 276 | int base; |
| 277 | 277 | |
| 278 | - db_must_be_within_tree(); | |
| 278 | + db_find_and_open_repository(0,0); | |
| 279 | 279 | if( g.argc==2 ){ |
| 280 | 280 | base = db_lget_int("checkout", 0); |
| 281 | 281 | }else{ |
| 282 | 282 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 283 | 283 | } |
| @@ -310,11 +310,11 @@ | ||
| 310 | 310 | Blob sql; |
| 311 | 311 | int showAll = find_option("all", 0, 0)!=0; |
| 312 | 312 | int showClosed = find_option("closed", 0, 0)!=0; |
| 313 | 313 | int recomputeFlag = find_option("recompute",0,0)!=0; |
| 314 | 314 | |
| 315 | - db_must_be_within_tree(); | |
| 315 | + db_find_and_open_repository(0,0); | |
| 316 | 316 | if( recomputeFlag ) leaf_rebuild(); |
| 317 | 317 | blob_zero(&sql); |
| 318 | 318 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 319 | 319 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 320 | 320 | if( showClosed ){ |
| 321 | 321 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | */ |
| 274 | void descendants_cmd(void){ |
| 275 | Stmt q; |
| 276 | int base; |
| 277 | |
| 278 | db_must_be_within_tree(); |
| 279 | if( g.argc==2 ){ |
| 280 | base = db_lget_int("checkout", 0); |
| 281 | }else{ |
| 282 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 283 | } |
| @@ -310,11 +310,11 @@ | |
| 310 | Blob sql; |
| 311 | int showAll = find_option("all", 0, 0)!=0; |
| 312 | int showClosed = find_option("closed", 0, 0)!=0; |
| 313 | int recomputeFlag = find_option("recompute",0,0)!=0; |
| 314 | |
| 315 | db_must_be_within_tree(); |
| 316 | if( recomputeFlag ) leaf_rebuild(); |
| 317 | blob_zero(&sql); |
| 318 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 319 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 320 | if( showClosed ){ |
| 321 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -273,11 +273,11 @@ | |
| 273 | */ |
| 274 | void descendants_cmd(void){ |
| 275 | Stmt q; |
| 276 | int base; |
| 277 | |
| 278 | db_find_and_open_repository(0,0); |
| 279 | if( g.argc==2 ){ |
| 280 | base = db_lget_int("checkout", 0); |
| 281 | }else{ |
| 282 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 283 | } |
| @@ -310,11 +310,11 @@ | |
| 310 | Blob sql; |
| 311 | int showAll = find_option("all", 0, 0)!=0; |
| 312 | int showClosed = find_option("closed", 0, 0)!=0; |
| 313 | int recomputeFlag = find_option("recompute",0,0)!=0; |
| 314 | |
| 315 | db_find_and_open_repository(0,0); |
| 316 | if( recomputeFlag ) leaf_rebuild(); |
| 317 | blob_zero(&sql); |
| 318 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 319 | blob_appendf(&sql, " AND blob.rid IN leaf"); |
| 320 | if( showClosed ){ |
| 321 |
+7
-10
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -134,41 +134,38 @@ | ||
| 134 | 134 | ** Use the "finfo" command to get information about a specific |
| 135 | 135 | ** file in a checkout. |
| 136 | 136 | */ |
| 137 | 137 | void info_cmd(void){ |
| 138 | 138 | i64 fsize; |
| 139 | - if( g.argc!=2 && g.argc!=3 ){ | |
| 140 | - usage("?FILENAME|ARTIFACT-ID?"); | |
| 141 | - } | |
| 142 | 139 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 143 | 140 | db_open_config(0); |
| 144 | 141 | db_record_repository_filename(g.argv[2]); |
| 145 | 142 | db_open_repository(g.argv[2]); |
| 146 | 143 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 147 | 144 | fossil_print("project-code: %s\n", db_get("project-code", "<none>")); |
| 148 | 145 | fossil_print("server-code: %s\n", db_get("server-code", "<none>")); |
| 149 | 146 | return; |
| 150 | 147 | } |
| 151 | - db_must_be_within_tree(); | |
| 148 | + db_find_and_open_repository(0,0); | |
| 152 | 149 | if( g.argc==2 ){ |
| 153 | 150 | int vid; |
| 154 | 151 | /* 012345678901234 */ |
| 155 | 152 | db_record_repository_filename(0); |
| 156 | 153 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 157 | - fossil_print("repository: %s\n", db_lget("repository", "")); | |
| 158 | - fossil_print("local-root: %s\n", g.zLocalRoot); | |
| 154 | + if( g.localOpen ){ | |
| 155 | + fossil_print("repository: %s\n", db_lget("repository", "")); | |
| 156 | + fossil_print("local-root: %s\n", g.zLocalRoot); | |
| 157 | + } | |
| 159 | 158 | #if defined(_WIN32) |
| 160 | 159 | if( g.zHome ){ |
| 161 | 160 | fossil_print("user-home: %s\n", g.zHome); |
| 162 | 161 | } |
| 163 | 162 | #endif |
| 164 | 163 | fossil_print("project-code: %s\n", db_get("project-code", "")); |
| 165 | 164 | fossil_print("server-code: %s\n", db_get("server-code", "")); |
| 166 | - vid = db_lget_int("checkout", 0); | |
| 167 | - if( vid==0 ){ | |
| 168 | - fossil_print("checkout: nil\n"); | |
| 169 | - }else{ | |
| 165 | + vid = g.localOpen ? db_lget_int("checkout", 0) : 0; | |
| 166 | + if( vid ){ | |
| 170 | 167 | show_common_info(vid, "checkout:", 1, 1); |
| 171 | 168 | } |
| 172 | 169 | }else{ |
| 173 | 170 | int rid; |
| 174 | 171 | rid = name_to_rid(g.argv[2]); |
| 175 | 172 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -134,41 +134,38 @@ | |
| 134 | ** Use the "finfo" command to get information about a specific |
| 135 | ** file in a checkout. |
| 136 | */ |
| 137 | void info_cmd(void){ |
| 138 | i64 fsize; |
| 139 | if( g.argc!=2 && g.argc!=3 ){ |
| 140 | usage("?FILENAME|ARTIFACT-ID?"); |
| 141 | } |
| 142 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 143 | db_open_config(0); |
| 144 | db_record_repository_filename(g.argv[2]); |
| 145 | db_open_repository(g.argv[2]); |
| 146 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 147 | fossil_print("project-code: %s\n", db_get("project-code", "<none>")); |
| 148 | fossil_print("server-code: %s\n", db_get("server-code", "<none>")); |
| 149 | return; |
| 150 | } |
| 151 | db_must_be_within_tree(); |
| 152 | if( g.argc==2 ){ |
| 153 | int vid; |
| 154 | /* 012345678901234 */ |
| 155 | db_record_repository_filename(0); |
| 156 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 157 | fossil_print("repository: %s\n", db_lget("repository", "")); |
| 158 | fossil_print("local-root: %s\n", g.zLocalRoot); |
| 159 | #if defined(_WIN32) |
| 160 | if( g.zHome ){ |
| 161 | fossil_print("user-home: %s\n", g.zHome); |
| 162 | } |
| 163 | #endif |
| 164 | fossil_print("project-code: %s\n", db_get("project-code", "")); |
| 165 | fossil_print("server-code: %s\n", db_get("server-code", "")); |
| 166 | vid = db_lget_int("checkout", 0); |
| 167 | if( vid==0 ){ |
| 168 | fossil_print("checkout: nil\n"); |
| 169 | }else{ |
| 170 | show_common_info(vid, "checkout:", 1, 1); |
| 171 | } |
| 172 | }else{ |
| 173 | int rid; |
| 174 | rid = name_to_rid(g.argv[2]); |
| 175 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -134,41 +134,38 @@ | |
| 134 | ** Use the "finfo" command to get information about a specific |
| 135 | ** file in a checkout. |
| 136 | */ |
| 137 | void info_cmd(void){ |
| 138 | i64 fsize; |
| 139 | if( g.argc==3 && (fsize = file_size(g.argv[2]))>0 && (fsize&0x1ff)==0 ){ |
| 140 | db_open_config(0); |
| 141 | db_record_repository_filename(g.argv[2]); |
| 142 | db_open_repository(g.argv[2]); |
| 143 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 144 | fossil_print("project-code: %s\n", db_get("project-code", "<none>")); |
| 145 | fossil_print("server-code: %s\n", db_get("server-code", "<none>")); |
| 146 | return; |
| 147 | } |
| 148 | db_find_and_open_repository(0,0); |
| 149 | if( g.argc==2 ){ |
| 150 | int vid; |
| 151 | /* 012345678901234 */ |
| 152 | db_record_repository_filename(0); |
| 153 | fossil_print("project-name: %s\n", db_get("project-name", "<unnamed>")); |
| 154 | if( g.localOpen ){ |
| 155 | fossil_print("repository: %s\n", db_lget("repository", "")); |
| 156 | fossil_print("local-root: %s\n", g.zLocalRoot); |
| 157 | } |
| 158 | #if defined(_WIN32) |
| 159 | if( g.zHome ){ |
| 160 | fossil_print("user-home: %s\n", g.zHome); |
| 161 | } |
| 162 | #endif |
| 163 | fossil_print("project-code: %s\n", db_get("project-code", "")); |
| 164 | fossil_print("server-code: %s\n", db_get("server-code", "")); |
| 165 | vid = g.localOpen ? db_lget_int("checkout", 0) : 0; |
| 166 | if( vid ){ |
| 167 | show_common_info(vid, "checkout:", 1, 1); |
| 168 | } |
| 169 | }else{ |
| 170 | int rid; |
| 171 | rid = name_to_rid(g.argv[2]); |
| 172 |