Fossil SCM

A better fix for reporting invalid names in the artifact command.

drh 2012-02-10 13:50 trunk
Commit da94a3b1c5f181a8b4959c36199890d67f2f1049
1 file changed +4 -4
+4 -4
--- src/content.c
+++ src/content.c
@@ -322,15 +322,15 @@
322322
const char *zFile;
323323
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
324324
if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
325325
zFile = g.argc==4 ? g.argv[3] : "-";
326326
rid = name_to_rid(g.argv[2]);
327
- if( content_get(rid, &content) ){
328
- blob_write_to_file(&content, zFile);
329
- }else{
330
- fossil_fatal("no such artifact: %s", g.argv[2]);
327
+ if( rid==0 ){
328
+ fossil_fatal("%s",g.zErrMsg);
331329
}
330
+ content_get(rid, &content);
331
+ blob_write_to_file(&content, zFile);
332332
}
333333
334334
/*
335335
** COMMAND: test-content-rawget
336336
**
337337
--- src/content.c
+++ src/content.c
@@ -322,15 +322,15 @@
322 const char *zFile;
323 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
324 if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
325 zFile = g.argc==4 ? g.argv[3] : "-";
326 rid = name_to_rid(g.argv[2]);
327 if( content_get(rid, &content) ){
328 blob_write_to_file(&content, zFile);
329 }else{
330 fossil_fatal("no such artifact: %s", g.argv[2]);
331 }
 
 
332 }
333
334 /*
335 ** COMMAND: test-content-rawget
336 **
337
--- src/content.c
+++ src/content.c
@@ -322,15 +322,15 @@
322 const char *zFile;
323 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
324 if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
325 zFile = g.argc==4 ? g.argv[3] : "-";
326 rid = name_to_rid(g.argv[2]);
327 if( rid==0 ){
328 fossil_fatal("%s",g.zErrMsg);
 
 
329 }
330 content_get(rid, &content);
331 blob_write_to_file(&content, zFile);
332 }
333
334 /*
335 ** COMMAND: test-content-rawget
336 **
337

Keyboard Shortcuts

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