Fossil

Check-in [651c75c5]
Login

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

Overview
Comment:merge trunk into creole
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | creole
Files: files | file ages | folders
SHA1:651c75c5b77a8fbeeb2c483dc9ec2741922592a4
User & Date: robert 2009-10-05 10:08:05
Context
2009-10-05
20:05
add wiki-contents macro to creole parser, plus minor bug fix check-in: b99aa66d user: robert tags: creole
10:08
merge trunk into creole check-in: 651c75c5 user: robert tags: creole
2009-10-04
18:29
Remember the userid and password used to clone so that subsequent syncs work correctly. check-in: 4dbc8a6d user: drh tags: trunk
2009-09-26
14:33
Minor fixes to creole check-in: cacb8db3 user: robert tags: creole
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
#TCC = gcc -O6
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
TCC = gcc  -Os 

#### Extra arguments for linking the finished binary.  Fossil needs
#    to link against the Z-Lib compression library.  There are no
#    other dependencies.  We sometimes add the -static option here
#    so that we can build a static executable that will run in a
#    chroot jail.
#







|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.  This C compiler builds
#    the finished binary for fossil.  The BCC compiler above is used
#    for building intermediate code-generator tools.
#
#TCC = gcc -O6
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
TCC = gcc -g -Os -Wall

#### Extra arguments for linking the finished binary.  Fossil needs
#    to link against the Z-Lib compression library.  There are no
#    other dependencies.  We sometimes add the -static option here
#    so that we can build a static executable that will run in a
#    chroot jail.
#

Changes to src/clone.c.

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    db_open_repository(g.argv[3]);
    db_begin_transaction();
    db_record_repository_filename(g.argv[3]);
    db_initial_setup(0, 0);
    user_select();
    db_set("content-schema", CONTENT_SCHEMA, 0);
    db_set("aux-schema", AUX_SCHEMA, 0);
    db_set("last-sync-url", g.urlCanonical, 0);
    db_multi_exec(
      "REPLACE INTO config(name,value)"
      " VALUES('server-code', lower(hex(randomblob(20))));"
    );
    url_enable_proxy(0);
    g.xlinkClusterOnly = 1;
    client_sync(0,0,1,CONFIGSET_ALL,0);







|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
    db_open_repository(g.argv[3]);
    db_begin_transaction();
    db_record_repository_filename(g.argv[3]);
    db_initial_setup(0, 0);
    user_select();
    db_set("content-schema", CONTENT_SCHEMA, 0);
    db_set("aux-schema", AUX_SCHEMA, 0);
    db_set("last-sync-url", g.argv[2], 0);
    db_multi_exec(
      "REPLACE INTO config(name,value)"
      " VALUES('server-code', lower(hex(randomblob(20))));"
    );
    url_enable_proxy(0);
    g.xlinkClusterOnly = 1;
    client_sync(0,0,1,CONFIGSET_ALL,0);

Changes to src/diffcmd.c.

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
    }else{
      zExternalCommand = db_get("gdiff-command", 0);
    }
    if( zExternalCommand==0 ){
      internalDiff=1;
    }else{
      blob_zero(&cmd);
      shell_escape(&cmd, zExternalCommand);
      blob_append(&cmd, " ", 1);
    }
  }
  zFile = g.argv[g.argc-1];
  file_tree_name(zFile, &fname, 1);

  blob_zero(&vname);
  do{
................................................................................
    printf("--- %s\n+++ %s\n", blob_str(&fname), blob_str(&fname));
    printf("%s\n", blob_str(&out));
    blob_reset(&current);
    blob_reset(&out);
  }else{
    blob_write_to_file(&record, blob_str(&vname));
    blob_reset(&record);
    shell_escape(&cmd, blob_str(&vname));
    blob_appendf(&cmd, " ");
    shell_escape(&cmd, zFile);
    portable_system(blob_str(&cmd));
    unlink(blob_str(&vname));
    blob_reset(&vname);
    blob_reset(&cmd);
  }
  blob_reset(&fname);







|
<







 







<
|







169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
...
204
205
206
207
208
209
210

211
212
213
214
215
216
217
218
    }else{
      zExternalCommand = db_get("gdiff-command", 0);
    }
    if( zExternalCommand==0 ){
      internalDiff=1;
    }else{
      blob_zero(&cmd);
      blob_appendf(&cmd,"%s ",zExternalCommand);

    }
  }
  zFile = g.argv[g.argc-1];
  file_tree_name(zFile, &fname, 1);

  blob_zero(&vname);
  do{
................................................................................
    printf("--- %s\n+++ %s\n", blob_str(&fname), blob_str(&fname));
    printf("%s\n", blob_str(&out));
    blob_reset(&current);
    blob_reset(&out);
  }else{
    blob_write_to_file(&record, blob_str(&vname));
    blob_reset(&record);

    blob_appendf(&cmd, "%s ", blob_str(&vname));
    shell_escape(&cmd, zFile);
    portable_system(blob_str(&cmd));
    unlink(blob_str(&vname));
    blob_reset(&vname);
    blob_reset(&cmd);
  }
  blob_reset(&fname);

Changes to src/sha1.c.

534
535
536
537
538
539
540
541

542
543
544
545
546
547
548
  SHA1Result(&ctx, zResult);
  DigestToBase16(zResult, blob_buffer(pCksum));
  return 0;
}


/*
** COMMAND: test-sha1sum

**
** Compute an SHA1 checksum of all files named on the command-line.
** If an file is named "-" then take its content from standard input.
*/
void sha1sum_test(void){
  int i;
  Blob in;







|
>







534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
  SHA1Result(&ctx, zResult);
  DigestToBase16(zResult, blob_buffer(pCksum));
  return 0;
}


/*
** COMMAND: sha1sum
** %fossil sha1sum FILE...
**
** Compute an SHA1 checksum of all files named on the command-line.
** If an file is named "-" then take its content from standard input.
*/
void sha1sum_test(void){
  int i;
  Blob in;

Changes to src/style.c.

189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
...
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
@       href="$baseurl/timeline.rss">
@ <link rel="stylesheet" href="$baseurl/style.css" type="text/css"
@       media="screen">
@ </head>
@ <body>
@ <div class="header">
@   <div class="logo">
@     <img src="/logo" alt="logo">
@     <br><nobr>$<project_name></nobr>
@   </div>
@   <div class="title">$<title></div>
@   <div class="status"><nobr><th1>
@      if {[info exists login]} {
@        puts "Logged in as $login"
@      } else {
................................................................................
@ .creole-noimage {
@   color:green;
@   border:1px solid green;
@ }
@ .creole-nomacro {
@   color:red;
@   border:1px solid red;
@ }
;

/*
** WEBPAGE: style.css
*/
void page_style_css(void){
  char *zCSS = 0;







|







 







|







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
...
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
@       href="$baseurl/timeline.rss">
@ <link rel="stylesheet" href="$baseurl/style.css" type="text/css"
@       media="screen">
@ </head>
@ <body>
@ <div class="header">
@   <div class="logo">
@     <img src="$baseurl/logo" alt="logo">
@     <br><nobr>$<project_name></nobr>
@   </div>
@   <div class="title">$<title></div>
@   <div class="status"><nobr><th1>
@      if {[info exists login]} {
@        puts "Logged in as $login"
@      } else {
................................................................................
@ .creole-noimage {
@   color:green;
@   border:1px solid green;
@ }
@ .creole-nomacro {
@   color:red;
@   border:1px solid red;
@ } 
;

/*
** WEBPAGE: style.css
*/
void page_style_css(void){
  char *zCSS = 0;

Changes to src/xfer.c.

656
657
658
659
660
661
662
663
664
665









666
667
668
669
670
671
672
673
674
675


676
677
678
679
680
681
682
    ** does not match.
    */
    if( xfer.nToken==3
     && (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
     && blob_is_uuid(&xfer.aToken[1])
     && blob_is_uuid(&xfer.aToken[2])
    ){
      const char *zSCode;
      const char *zPCode;










      zSCode = db_get("server-code", 0);
      if( zSCode==0 ){
        fossil_panic("missing server code");
      }
      if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
        cgi_reset_content();
        @ error server\sloop
        nErr++;
        break;
      }


      zPCode = db_get("project-code", 0);
      if( zPCode==0 ){
        fossil_panic("missing project code");
      }
      if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){
        cgi_reset_content();
        @ error wrong\sproject







<


>
>
>
>
>
>
>
>
>










>
>







656
657
658
659
660
661
662

663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
    ** does not match.
    */
    if( xfer.nToken==3
     && (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
     && blob_is_uuid(&xfer.aToken[1])
     && blob_is_uuid(&xfer.aToken[2])
    ){

      const char *zPCode;

#if 0
      /* This block checks to see if a server is trying to sync with itself.
      ** This used to be disallowed, but I cannot think of any significant
      ** harm, so I have disabled the check.
      **
      ** With this check disabled, it is sufficient to copy the repository
      ** database.  No need to run clone.
      */
      const char *zSCode;
      zSCode = db_get("server-code", 0);
      if( zSCode==0 ){
        fossil_panic("missing server code");
      }
      if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
        cgi_reset_content();
        @ error server\sloop
        nErr++;
        break;
      }
#endif

      zPCode = db_get("project-code", 0);
      if( zPCode==0 ){
        fossil_panic("missing project code");
      }
      if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){
        cgi_reset_content();
        @ error wrong\sproject