Fossil

Check-in [57347e6e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add better usage and help to the "artifact" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:57347e6ee87ab62dc579b5b3102aade9e7ba928e
User & Date: drh 2010-10-26 21:37:16
References
2010-10-27
17:28 Ticket [a4a9f45b] core dump on attempted branch status still Open with 2 other changes artifact: 2f8f3907 user: bharder
2010-10-26
23:46 Ticket [ef48c60c] checkout/build failure status still Open with 1 other change artifact: 7f815fa9 user: drh
23:19 New ticket [ef48c60c]. artifact: 00a03e69 user: bharder
Context
2010-10-27
11:54
Use delta encoding between baseline manifests separated by delta manifests. check-in: e21ca81e user: drh tags: trunk
2010-10-26
21:37
Add better usage and help to the "artifact" command. check-in: 57347e6e user: drh tags: trunk
21:31
Update the makefile to enable USE_PREAD on the BSDs. check-in: b84b954f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/content.c.

281
282
283
284
285
286
287
288
289
290
291
292




293
294
295
296
297
298
299
300
301
302
303
304
305
306
  }
  return rc;
}

/*
** COMMAND: artifact
**
** Usage: %fossil artifact ARTIFACT-ID  ?OUTPUT-FILENAME?
**
** Extract an artifact by its SHA1 hash and write the results on
** standard output, or if the optional 4th argument is given, in
** the named output file.




*/
void artifact_cmd(void){
  int rid;
  Blob content;
  const char *zFile;
  db_find_and_open_repository(1);
  if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?");
  zFile = g.argc==4 ? g.argv[3] : "-";
  rid = name_to_rid(g.argv[2]);
  content_get(rid, &content);
  blob_write_to_file(&content, zFile);
}

/*







|




>
>
>
>






|







281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
  }
  return rc;
}

/*
** COMMAND: artifact
**
** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? ?OPTIONS?
**
** Extract an artifact by its SHA1 hash and write the results on
** standard output, or if the optional 4th argument is given, in
** the named output file.
**
** Options:
**
**    -R|--repository FILE       Extract artifacts from repository FILE
*/
void artifact_cmd(void){
  int rid;
  Blob content;
  const char *zFile;
  db_find_and_open_repository(1);
  if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
  zFile = g.argc==4 ? g.argv[3] : "-";
  rid = name_to_rid(g.argv[2]);
  content_get(rid, &content);
  blob_write_to_file(&content, zFile);
}

/*