Fossil SCM
Change the "artifact" command to accept the -R or --repository command-line options. Ticket [d3ab7965c636275e51].
Commit
d6e21fddd3fb8cfba278aedb8faf3afba9da3e88
Parent
d13054ce84eaa95…
1 file changed
+2
-2
+2
-2
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -281,11 +281,11 @@ | ||
| 281 | 281 | } |
| 282 | 282 | return rc; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /* |
| 286 | -** COMMAND: artifact | |
| 286 | +** COMMAND: artifact | |
| 287 | 287 | ** |
| 288 | 288 | ** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? |
| 289 | 289 | ** |
| 290 | 290 | ** Extract an artifact by its SHA1 hash and write the results on |
| 291 | 291 | ** standard output, or if the optional 4th argument is given, in |
| @@ -293,13 +293,13 @@ | ||
| 293 | 293 | */ |
| 294 | 294 | void artifact_cmd(void){ |
| 295 | 295 | int rid; |
| 296 | 296 | Blob content; |
| 297 | 297 | const char *zFile; |
| 298 | + db_find_and_open_repository(1); | |
| 298 | 299 | if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?"); |
| 299 | 300 | zFile = g.argc==4 ? g.argv[3] : "-"; |
| 300 | - db_must_be_within_tree(); | |
| 301 | 301 | rid = name_to_rid(g.argv[2]); |
| 302 | 302 | content_get(rid, &content); |
| 303 | 303 | blob_write_to_file(&content, zFile); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -281,11 +281,11 @@ | |
| 281 | } |
| 282 | return rc; |
| 283 | } |
| 284 | |
| 285 | /* |
| 286 | ** COMMAND: artifact |
| 287 | ** |
| 288 | ** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? |
| 289 | ** |
| 290 | ** Extract an artifact by its SHA1 hash and write the results on |
| 291 | ** standard output, or if the optional 4th argument is given, in |
| @@ -293,13 +293,13 @@ | |
| 293 | */ |
| 294 | void artifact_cmd(void){ |
| 295 | int rid; |
| 296 | Blob content; |
| 297 | const char *zFile; |
| 298 | if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?"); |
| 299 | zFile = g.argc==4 ? g.argv[3] : "-"; |
| 300 | db_must_be_within_tree(); |
| 301 | rid = name_to_rid(g.argv[2]); |
| 302 | content_get(rid, &content); |
| 303 | blob_write_to_file(&content, zFile); |
| 304 | } |
| 305 | |
| 306 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -281,11 +281,11 @@ | |
| 281 | } |
| 282 | return rc; |
| 283 | } |
| 284 | |
| 285 | /* |
| 286 | ** COMMAND: artifact |
| 287 | ** |
| 288 | ** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? |
| 289 | ** |
| 290 | ** Extract an artifact by its SHA1 hash and write the results on |
| 291 | ** standard output, or if the optional 4th argument is given, in |
| @@ -293,13 +293,13 @@ | |
| 293 | */ |
| 294 | void artifact_cmd(void){ |
| 295 | int rid; |
| 296 | Blob content; |
| 297 | const char *zFile; |
| 298 | db_find_and_open_repository(1); |
| 299 | if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?"); |
| 300 | zFile = g.argc==4 ? g.argv[3] : "-"; |
| 301 | rid = name_to_rid(g.argv[2]); |
| 302 | content_get(rid, &content); |
| 303 | blob_write_to_file(&content, zFile); |
| 304 | } |
| 305 | |
| 306 |