Fossil

Changes On Branch uv-upload
Login

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

Changes In Branch uv-upload Excluding Merge-Ins

This is equivalent to a diff from bdc8b4a406 to 3aa57a20b7

2024-06-25
18:10
Add ability to upload unversioned files via the /uvlist page. check-in: 2d4fd55fee user: stephan tags: trunk
09:33
Ensure that the unversioned table exists if an upload is triggered via /uvlist. Closed-Leaf check-in: 3aa57a20b7 user: stephan tags: uv-upload
2024-06-24
20:44
Add a mention of the /uvlist file-upload feature to the change log. check-in: 77fb3d07a8 user: stephan tags: uv-upload
06:09
Ensure that the pattern string for search is all lower-case, so that FTS5 keywords like NOT and AND cannot cause confusion and errors. check-in: ec68aaf425 user: drh tags: trunk
2024-06-23
19:12
Initial sketch of the ability to upload a new /uv file via an HTML form, per off-list user request. The form is not yet handled. check-in: 152cc642e7 user: stephan tags: uv-upload
18:38
Small help text fix in the unversioned command. check-in: bdc8b4a406 user: stephan tags: trunk
2024-06-19
18:26
Fix a bug in git-export in which the \n at the end of manifest.uuid is omitted. check-in: fc8d476aca user: drh tags: trunk

Changes to src/main.mk.
269
270
271
272
273
274
275

276
277
278
279
280
281
282
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283







+







  $(SRCDIR)/sounds/d.wav \
  $(SRCDIR)/sounds/e.wav \
  $(SRCDIR)/sounds/f.wav \
  $(SRCDIR)/style.admin_log.css \
  $(SRCDIR)/style.chat.css \
  $(SRCDIR)/style.fileedit.css \
  $(SRCDIR)/style.pikchrshow.css \
  $(SRCDIR)/style.uvlist.css \
  $(SRCDIR)/style.wikiedit.css \
  $(SRCDIR)/tree.js \
  $(SRCDIR)/useredit.js \
  $(SRCDIR)/wiki.wiki

TRANS_SRC = \
  $(OBJDIR)/add_.c \
Added src/style.uvlist.css.







1
2
3
4
5
6
7
+
+
+
+
+
+
+
body.uvlist input {
  margin: 0.5em;
}

body.uvlist form {
  display: block;
}
Changes to src/unversioned.c.
518
519
520
521
522
523
524














































525
526
527
528
529
530
531
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







    }
    db_unset("uv-hash", 0);
    db_end_transaction(0);
  }else{
    usage("add|cat|edit|export|list|revert|remove|sync|touch");
  }
}

/*
** Emit an HTML form for uploading a new unversioned file if
** the current user has WrUnver permissions, else this is
** a no-op.
**
** If this function detects that the form it emits has been submitted,
** it will add the uploaded file to the unversioned file list before
** returning.
**
** Intended only for use by /uvlist, and its form's action is that
** page.
*/
static void uvlist_upload(void){
  const char * aContent;
  if( !g.perm.WrUnver ) return;
  aContent = P("f");
  if( aContent!=0 ){
    const char * const zName = P("f:filename");
    int const nContent = atoi(PD("f:bytes","0"));
    const char * zError = 0;
    Blob content;
    if( zName[0]==0 ){
      zError = "be an empty string";
    }else if( contains_whitespace(zName) ){
      zError = "contain spaces";
    }
    if( zError ){
      fossil_fatal("Unversioned filenames may not %s: %Q",
                   zError, zName);
    }
    unversioned_schema();
    db_begin_transaction();
    content_rcvid_init("#!fossil /uvlist upload");
    blob_init(&content, aContent, nContent);
    unversioned_write(zName, &content, time(0));
    blob_reset(&content);
    db_end_transaction(0);
    CX("<div>Added: %s</div>", zName);
  }
  form_begin("enctype='multipart/form-data'", "%R/uvlist");
  CX("<label for='uvupload'>Upload unversioned file:</label>");
  CX("<input type='file' id='uvupload' name='f'/>");
  CX("<input type='submit' value='Upload'/>");
  CX("</form>");
}

/*
** WEBPAGE: uvlist
**
** Display a list of all unversioned files in the repository.
** Query parameters:
**
543
544
545
546
547
548
549

550
551
552
553
554
555
556
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603







+







  char zSzName[100];

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  cgi_check_for_malice();
  etag_check(ETAG_DATA,0);
  style_header("Unversioned Files");
  uvlist_upload();
  if( !db_table_exists("repository","unversioned") ){
    @ No unversioned files on this server
    style_finish_page();
    return;
  }
  if( PB("byage") ) zOrderBy = "mtime DESC";
  if( PB("showdel") ) showDel = 1;
Changes to win/Makefile.mingw.
655
656
657
658
659
660
661

662
663
664
665
666
667
668
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669







+







  $(SRCDIR)/sounds/d.wav \
  $(SRCDIR)/sounds/e.wav \
  $(SRCDIR)/sounds/f.wav \
  $(SRCDIR)/style.admin_log.css \
  $(SRCDIR)/style.chat.css \
  $(SRCDIR)/style.fileedit.css \
  $(SRCDIR)/style.pikchrshow.css \
  $(SRCDIR)/style.uvlist.css \
  $(SRCDIR)/style.wikiedit.css \
  $(SRCDIR)/tree.js \
  $(SRCDIR)/useredit.js \
  $(SRCDIR)/wiki.wiki

TRANS_SRC = \
  $(OBJDIR)/add_.c \
Changes to win/Makefile.msc.
613
614
615
616
617
618
619

620
621
622
623
624
625
626
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627







+







        "$(SRCDIR)\sounds\d.wav" \
        "$(SRCDIR)\sounds\e.wav" \
        "$(SRCDIR)\sounds\f.wav" \
        "$(SRCDIR)\style.admin_log.css" \
        "$(SRCDIR)\style.chat.css" \
        "$(SRCDIR)\style.fileedit.css" \
        "$(SRCDIR)\style.pikchrshow.css" \
        "$(SRCDIR)\style.uvlist.css" \
        "$(SRCDIR)\style.wikiedit.css" \
        "$(SRCDIR)\tree.js" \
        "$(SRCDIR)\useredit.js" \
        "$(SRCDIR)\wiki.wiki"

OBJ   = "$(OX)\add$O" \
        "$(OX)\ajax$O" \
1242
1243
1244
1245
1246
1247
1248

1249
1250
1251
1252
1253
1254
1255
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257







+







	echo "$(SRCDIR)\sounds/d.wav" >> $@
	echo "$(SRCDIR)\sounds/e.wav" >> $@
	echo "$(SRCDIR)\sounds/f.wav" >> $@
	echo "$(SRCDIR)\style.admin_log.css" >> $@
	echo "$(SRCDIR)\style.chat.css" >> $@
	echo "$(SRCDIR)\style.fileedit.css" >> $@
	echo "$(SRCDIR)\style.pikchrshow.css" >> $@
	echo "$(SRCDIR)\style.uvlist.css" >> $@
	echo "$(SRCDIR)\style.wikiedit.css" >> $@
	echo "$(SRCDIR)\tree.js" >> $@
	echo "$(SRCDIR)\useredit.js" >> $@
	echo "$(SRCDIR)\wiki.wiki" >> $@

"$(OX)\add$O" : "$(OX)\add_.c" "$(OX)\add.h"
	$(TCC) /Fo$@ /Fd$(@D)\ -c "$(OX)\add_.c"
Changes to www/changes.wiki.
9
10
11
12
13
14
15

16

17
18
19
20
21
22
23
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24







+
-
+







     preferred case rather than the case typed in by the user.
  *  Change the name "fossil cherry-pick" command to "fossil cherrypick",
     which is more familiar to Git users.  Retain the legacy name for
     compatibility.
  *  Add new query parameters to the [/help?cmd=/timeline|/timeline page]:
     d2=, p2=, and dp2=.
  *  Add options to the [/help?cmd=tag|fossil tag] command that will list tag values
  *  Add ability to upload unversioned files via the [/help?cmd=/uvlist|/uvlist page].
     


<h2 id='v2_24'>Changes for version 2.24 (2024-04-23)</h2>

  *  Apache change work-around &rarr; As part of a security fix, the Apache webserver
     mod_cgi module has stopped relaying the Content-Length field of the HTTP
     reply header from the CGI programs back to the client in cases where the
     connection is to be closed and the client is able to read until end-of-file.