Fossil

Diff
Login

Diff

Differences From Artifact [8d50d34cbb]:

To Artifact [a664fdc0f6]:


312
313
314
315
316
317
318

































    usage("UUID ZIPFILE");
  }
  db_must_be_within_tree();
  rid = name_to_rid(g.argv[2]);
  zip_of_baseline(rid, &zip);
  blob_write_to_file(&zip, g.argv[3]);
}








































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
    usage("UUID ZIPFILE");
  }
  db_must_be_within_tree();
  rid = name_to_rid(g.argv[2]);
  zip_of_baseline(rid, &zip);
  blob_write_to_file(&zip, g.argv[3]);
}

/*
** WEBPAGE: zip
**
** Generate a ZIP archive for the baseline specified by g.zExtra
** and return that ZIP archive as the HTTP reply content.
*/
void baseline_zip_page(void){
  int rid;
  char *zName;
  int i;
  Blob zip;

  login_check_credentials();
  if( !g.okRead || !g.okHistory ){ login_needed(); return; }
  zName = mprintf("%s", g.zExtra);
  i = strlen(zName);
  for(i=strlen(zName)-1; i>5; i--){
    if( zName[i]=='.' ){
      zName[i] = 0;
      break;
    }
  }
  rid = name_to_rid(zName);
  if( rid==0 ){
    @ Not found
    return;
  }
  zip_of_baseline(rid, &zip);
  cgi_set_content(&zip);
  cgi_set_content_type("application/zip");
  cgi_reply();
}