235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
int i;
int rc;
Blob content, fname;
const char *zRev;
db_find_and_open_repository(0, 0);
zRev = find_option("r","r",1);
for(i=2; i<g.argc; i++){
file_tree_name(g.argv[i], &fname, 1);
blob_zero(&content);
rc = historical_version_of_file(zRev, blob_str(&fname), &content, 0,0,0,0);
if( rc==0 ){
fossil_fatal("no such file: %s", g.argv[i]);
}
blob_write_to_file(&content, "-");
blob_reset(&fname);
|
>
>
>
>
>
>
>
>
>
>
>
|
>
|
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
int i;
int rc;
Blob content, fname;
const char *zRev;
db_find_and_open_repository(0, 0);
zRev = find_option("r","r",1);
for(i=2; i<g.argc; i++){
if( g.useRepositoryFromCmdArg ){
/* If specify -R <repository>, arguments should already be the tree-name */
blob_set(&fname, g.argv[i]);
/*
** if no rev specified, default to main-branch to don't let
** historical_version_of_file() get local checkout revision
*/
if( zRev==0 ){
zRev=db_get("main-branch", "trunk");
}
}else{
file_tree_name(g.argv[i], &fname, 1);
}
blob_zero(&content);
rc = historical_version_of_file(zRev, blob_str(&fname), &content, 0,0,0,0);
if( rc==0 ){
fossil_fatal("no such file: %s", g.argv[i]);
}
blob_write_to_file(&content, "-");
blob_reset(&fname);
|