Fossil SCM

Change the "artifact" command to accept the -R or --repository command-line options. Ticket [d3ab7965c636275e51].

drh 2010-10-26 18:29 trunk
Commit d6e21fddd3fb8cfba278aedb8faf3afba9da3e88
1 file changed +2 -2
+2 -2
--- src/content.c
+++ src/content.c
@@ -281,11 +281,11 @@
281281
}
282282
return rc;
283283
}
284284
285285
/*
286
-** COMMAND: artifact
286
+** COMMAND: artifact
287287
**
288288
** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME?
289289
**
290290
** Extract an artifact by its SHA1 hash and write the results on
291291
** standard output, or if the optional 4th argument is given, in
@@ -293,13 +293,13 @@
293293
*/
294294
void artifact_cmd(void){
295295
int rid;
296296
Blob content;
297297
const char *zFile;
298
+ db_find_and_open_repository(1);
298299
if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?");
299300
zFile = g.argc==4 ? g.argv[3] : "-";
300
- db_must_be_within_tree();
301301
rid = name_to_rid(g.argv[2]);
302302
content_get(rid, &content);
303303
blob_write_to_file(&content, zFile);
304304
}
305305
306306
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button