Changes On Branch wolfgangHelpCmd
Not logged in

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

Changes In Branch wolfgangHelpCmd Excluding Merge-Ins

This is equivalent to a diff from 7954ccba68 to f88368742d

2010-10-26
12:51
Merge the delta-manifest enhancement into the trunk. check-in: d13054ce84 user: drh tags: trunk
2010-10-22
01:04
Add some explanatory text to the update command to make it easier for new users to learn fossil. check-in: 858940c68e user: bcsmith tags: ui-improvements
2010-10-17
16:37
merge from old hook branch check-in: 9cf288de27 user: wolfgang tags: StvPrivateHook2
2010-10-16
19:07
PellesC doesn't have pgmptr, update Makefile Leaf check-in: f88368742d user: wolfgang tags: wolfgangHelpCmd
17:33
merge from trunk check-in: 586b0eb144 user: wolfgang tags: wolfgangHelpCmd
16:32
Bring over the latest bug fixes from trunk. check-in: b2175857cc user: drh tags: experimental
16:24
Do not attempt to parse control artifacts that do not end with a '\n' character. Ticket [be56c89def7f86bcbd] check-in: 7954ccba68 user: drh tags: trunk
12:13
Do not free memory not obtained from malloc in the "fossil diff" command. Ticket [38d7bb8cf044219c2eff8]. check-in: ddb975e2be user: drh tags: trunk

Changes to src/add.c.

269
270
271
272
273
274
275





























































































276
277
278
279
280
281
282
...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
      blob_reset(&pathname);
    }
    free(zName);
  }
  db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
  db_end_transaction(0);
}






























































































/*
** Rename a single file.
**
** The original name of the file is zOrig.  The new filename is zNew.
*/
static void mv_one_file(int vid, const char *zOrig, const char *zNew){
................................................................................
**
** Usage: %fossil mv|rename OLDNAME NEWNAME
**    or: %fossil mv|rename OLDNAME... DIR
**
** Move or rename one or more files within the tree
**
** This command does not rename the files on disk.  This command merely
** records the fact that filenames have changed so that appropriate notations
** can be made at the next commit/checkin.
*/
void mv_cmd(void){
  int i;
  int vid;
  char *zDest;
  Blob dest;
  Stmt q;






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
|







269
270
271
272
273
274
275
276
277
278
279
280
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
311
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
...
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
      blob_reset(&pathname);
    }
    free(zName);
  }
  db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
  db_end_transaction(0);
}

/*
** COMMAND: addremove ?--dotfiles? ?--ignore GLOBPATTERN?
**
** Usage: %fossil addremove
**
** If used in a checkout, the current checkout file tree is synchronized
** with the repository:
**  * all files, existing in the file tree but not in the repository
**    (files displayed using the <a>extra</a> command)
**    are added to the repository - see also <a>add</a>
**  * all files, existing in the repository, not existing in the file tree
**    (files displayed as MISSING using the <a>status</a> command)
**    are removed from the repository - see also <a>rm</a>
** The command does not <a>commit</a>!
**
** This command can be used to track third party software.
*/
void import_cmd(void){
  Blob path;
  const char *zIgnoreFlag = find_option("ignore",0,1);
  int allFlag = find_option("dotfiles",0,0)!=0;
  int n;
  Stmt q;
  int vid;
  Blob repo;
  int addons = 0;
  int deletes = 0;

  if( zIgnoreFlag==0 ){
    zIgnoreFlag = db_get("ignore-glob", 0);
  }
  db_must_be_within_tree();
  vid = db_lget_int("checkout",0);
  if( vid==0 ){
    fossil_panic("no checkout to add to");
  }
  db_begin_transaction();
  db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
  n = strlen(g.zLocalRoot);
  blob_init(&path, g.zLocalRoot, n-1);
  /* now we read the complete file structure into a temp table */
  vfile_scan(0, &path, blob_size(&path), allFlag);
  if( file_tree_name(g.zRepositoryName, &repo, 0) ){
    db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
  }
  printf("importing checkout root '%s'\ninto repository '%s':\n",
          g.zLocalRoot,g.zRepositoryName);
  /* step 1: search for extra files */
  db_prepare(&q, 
      "SELECT x, %Q || x FROM sfile"
      " WHERE x NOT IN ('manifest','manifest.uuid','_FOSSIL_',"
                       "'_FOSSIL_-journal','.fos','.fos-journal',"
                       "'_FOSSIL_-wal','_FOSSIL_-shm','.fos-wal',"
                       "'.fos-shm')"
      "   AND NOT %s"
      " ORDER BY 1",
      g.zLocalRoot,
      glob_expr("x", zIgnoreFlag)
  );
  while( db_step(&q)==SQLITE_ROW ){
    Blob omit;

    blob_zero(&omit);
    add_one_file(db_column_text(&q, 1), vid, &omit);
    addons++;
  }
  db_finalize(&q);
  /* step 2: search for missing files */
  db_prepare(&q, 
      "SELECT pathname,%Q || pathname,deleted FROM vfile"
      " WHERE deleted!=1"
      " ORDER BY 1",
      g.zLocalRoot
  );
  while( db_step(&q)==SQLITE_ROW ){
    const char * zFile;
    const char * zPath;

    zFile = db_column_text(&q, 0);
    zPath = db_column_text(&q, 1);
    if( !file_isfile(zPath) ){
      db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zFile);
      printf("DELETED  %s\n", zFile);
      deletes--;
    }
  }
  db_finalize(&q);
  /* show cmmand summary */
  printf("added %d files, deleted %d files\n",addons,deletes);

  db_end_transaction(0);
}

/*
** Rename a single file.
**
** The original name of the file is zOrig.  The new filename is zNew.
*/
static void mv_one_file(int vid, const char *zOrig, const char *zNew){
................................................................................
**
** Usage: %fossil mv|rename OLDNAME NEWNAME
**    or: %fossil mv|rename OLDNAME... DIR
**
** Move or rename one or more files within the tree
**
** This command does not rename the files on disk.  This command merely
** records the fact that filenames have changed so that appropriate
** notations can be made at the next <a>commit</a>/checkin.
*/
void mv_cmd(void){
  int i;
  int vid;
  char *zDest;
  Blob dest;
  Stmt q;

Changes to src/allrepo.c.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

/*
** COMMAND: all
**
** Usage: %fossil all (list|ls|pull|push|rebuild|sync)
**
** The ~/.fossil file records the location of all repositories for a
** user.  This command performs certain operations on all repositories
** that can be useful before or after a period of disconnected operation.
**
** On Win32 systems, the file is named "_fossil" and is located in
** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
**
** Available operations are:
**
**    list | ls  Display the location of all repositories
................................................................................
**    push       Run a "push" on all repositories
**
**    rebuild    Rebuild on all repositories
**
**    sync       Run a "sync" on all repositories
**
** Respositories are automatically added to the set of known repositories
** when one of the following commands against the repository: clone, info,
** pull, push, or sync
*/
void all_cmd(void){
  int n;
  Stmt q;
  const char *zCmd;
  char *zSyscmd;
  char *zFossil;






|
|
|







 







|
|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

/*
** COMMAND: all
**
** Usage: %fossil all (list|ls|pull|push|rebuild|sync)
**
** The ~/.fossil file records the location of all repositories for a user.
** This command performs certain operations on all repositories that can
** be useful before or after a period of disconnected operation.
**
** On Win32 systems, the file is named "_fossil" and is located in
** %LOCALAPPDATA%, %APPDATA% or %HOMEPATH%.
**
** Available operations are:
**
**    list | ls  Display the location of all repositories
................................................................................
**    push       Run a "push" on all repositories
**
**    rebuild    Rebuild on all repositories
**
**    sync       Run a "sync" on all repositories
**
** Respositories are automatically added to the set of known repositories
** when one of the following commands against the repository:
**   <a>clone</a>, <a>info</a>, <a>pull</a>, <a>push</a>, or <a>sync</a>
*/
void all_cmd(void){
  int n;
  Stmt q;
  const char *zCmd;
  char *zSyscmd;
  char *zFossil;

Changes to src/browse.c.

245
246
247
248
249
250
251
252
253
    }else{
      @ <li><a href="%s(g.zBaseURL)/finfo?name=%T(zPrefix)%T(zFN)">%h(zFN)
      @     </a></li>
    }
  }
  db_finalize(&q);
  @ </ul></td></tr></table>
  style_footer();
}






|

245
246
247
248
249
250
251
252
253
    }else{
      @ <li><a href="%s(g.zBaseURL)/finfo?name=%T(zPrefix)%T(zFN)">%h(zFN)
      @     </a></li>
    }
  }
  db_finalize(&q);
  @ </ul></td></tr></table>
  style_footer_cmdref("ls",0);
}

Changes to src/checkin.c.

99
100
101
102
103
104
105
106

107
108
109
110
111
112
113
...
118
119
120
121
122
123
124


125
126
127
128
129
130
131
...
245
246
247
248
249
250
251
252
253
254
255


256
257
258
259
260
261
262
...
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
/*
** COMMAND: changes
**
** Usage: %fossil changes
**
** Report on the edit status of all files in the current checkout.
** See also the "status" and "extra" commands.

*/
void changes_cmd(void){
  Blob report;
  int vid;
  db_must_be_within_tree();
  blob_zero(&report);
  vid = db_lget_int("checkout", 0);
................................................................................

/*
** COMMAND: status
**
** Usage: %fossil status
**
** Report on the status of the current checkout.


*/
void status_cmd(void){
  int vid;
  db_must_be_within_tree();
       /* 012345678901234 */
  printf("repository:   %s\n", db_lget("repository",""));
  printf("local-root:   %s\n", g.zLocalRoot);
................................................................................
}

/*
** COMMAND: extras
** Usage: %fossil extras ?--dotfiles? ?--ignore GLOBPATTERN?
**
** Print a list of all files in the source tree that are not part of
** the current checkout.  See also the "clean" command.
**
** Files and subdirectories whose names begin with "." are normally
** ignored but can be included by adding the --dotfiles option.


*/
void extra_cmd(void){
  Blob path;
  Blob repo;
  Stmt q;
  int n;
  const char *zIgnoreFlag = find_option("ignore",0,1);
................................................................................

/*
** COMMAND: clean
** Usage: %fossil clean ?--force? ?--dotfiles?
**
** Delete all "extra" files in the source tree.  "Extra" files are
** files that are not officially part of the checkout.  See also
** the "extra" command. This operation cannot be undone. 
**
** You will be prompted before removing each file. If you are
** sure you wish to remove all "extra" files you can specify the
** optional --force flag and no prompts will be issued.
**
** Files and subdirectories whose names begin with "." are
** normally ignored.  They are included if the "--dotfiles" option
** is used.
*/
void clean_cmd(void){
  int allFlag;
  int dotfilesFlag;
  Blob path, repo;
  Stmt q;
  int n;
................................................................................
** COMMAND: ci
** COMMAND: commit
**
** Usage: %fossil commit ?OPTIONS? ?FILE...?
**
** Create a new version containing all of the changes in the current
** checkout.  You will be prompted to enter a check-in comment unless
** the comment has been specified on the command-line using "-m".
** The editor defined in the "editor" fossil option (see %fossil help set)
** will be used, or from the "VISUAL" or "EDITOR" environment variables
** (in that order) if no editor is set.
**
** You will be prompted for your GPG passphrase in order to sign the
** new manifest unless the "--nosign" option is used.  All files that
** have changed will be committed unless some subset of files is
** specified on the command line.
**
** The --branch option followed by a branch name cases the new check-in
** to be placed in the named branch.  The --bgcolor option can be followed
** by a color name (ex:  '#ffc0c0') to specify the background color of
** entries in the new branch when shown in the web timeline interface.
**
** A check-in is not permitted to fork unless the --force or -f
** option appears.  A check-in is not allowed against a closed check-in.
**
** The --private option creates a private check-in that is never synced.
** Children of private check-ins are automatically private.
**
** Options:
**
**    --comment|-m COMMENT-TEXT






|
>







 







>
>







 







|



>
>







 







|

|
|
|

|
|
<







 







|
|









|



|
|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
...
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
...
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310

311
312
313
314
315
316
317
...
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
/*
** COMMAND: changes
**
** Usage: %fossil changes
**
** Report on the edit status of all files in the current checkout.
**
** See also the <a>status</a>, <a>extra</a> and <a>addremove</a> commands.
*/
void changes_cmd(void){
  Blob report;
  int vid;
  db_must_be_within_tree();
  blob_zero(&report);
  vid = db_lget_int("checkout", 0);
................................................................................

/*
** COMMAND: status
**
** Usage: %fossil status
**
** Report on the status of the current checkout.
**
** See also <a>addremove</a>
*/
void status_cmd(void){
  int vid;
  db_must_be_within_tree();
       /* 012345678901234 */
  printf("repository:   %s\n", db_lget("repository",""));
  printf("local-root:   %s\n", g.zLocalRoot);
................................................................................
}

/*
** COMMAND: extras
** Usage: %fossil extras ?--dotfiles? ?--ignore GLOBPATTERN?
**
** Print a list of all files in the source tree that are not part of
** the current checkout.  See also the <a>clean</a> command.
**
** Files and subdirectories whose names begin with "." are normally
** ignored but can be included by adding the --dotfiles option.
**
** See also <a>addremove</a>
*/
void extra_cmd(void){
  Blob path;
  Blob repo;
  Stmt q;
  int n;
  const char *zIgnoreFlag = find_option("ignore",0,1);
................................................................................

/*
** COMMAND: clean
** Usage: %fossil clean ?--force? ?--dotfiles?
**
** Delete all "extra" files in the source tree.  "Extra" files are
** files that are not officially part of the checkout.  See also
** the <a>extras</a> command. This operation cannot be undone. 
**
** You will be prompted before removing each file. If you are sure
** you wish to remove all "extra" files you can specify the optional
** --force flag and no prompts will be issued.
**
** Files and subdirectories whose names begin with "." are normally
** ignored.  They are included if the "--dotfiles" option is used.

*/
void clean_cmd(void){
  int allFlag;
  int dotfilesFlag;
  Blob path, repo;
  Stmt q;
  int n;
................................................................................
** COMMAND: ci
** COMMAND: commit
**
** Usage: %fossil commit ?OPTIONS? ?FILE...?
**
** Create a new version containing all of the changes in the current
** checkout.  You will be prompted to enter a check-in comment unless
** the comment has been specified on the command-line using "-m". The
** editor defined in the "editor" fossil option (see %fossil help set)
** will be used, or from the "VISUAL" or "EDITOR" environment variables
** (in that order) if no editor is set.
**
** You will be prompted for your GPG passphrase in order to sign the
** new manifest unless the "--nosign" option is used.  All files that
** have changed will be committed unless some subset of files is
** specified on the command line.
**
** The --branch option followed by a branch name cases the new check-in
** to be placed in the named branch. The --bgcolor option can be followed
** by a color name (ex:  '#ffc0c0') to specify the background color of
** entries in the new branch when shown in the web timeline interface.
**
** A check-in is not permitted to fork unless the --force or -f option
** appears.  A check-in is not allowed against a closed check-in.
**
** The --private option creates a private check-in that is never synced.
** Children of private check-ins are automatically private.
**
** Options:
**
**    --comment|-m COMMENT-TEXT

Changes to src/checkout.c.

170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
** the --force option appears on the command-line.  The --keep option
** leaves files on disk unchanged, except the manifest and manifest.uuid
** files.
**
** The --latest flag can be used in place of VERSION to checkout the
** latest version in the repository.
**
** See also the "update" command.
*/
void checkout_cmd(void){
  int forceFlag;                 /* Force checkout even if edits exist */
  int keepFlag;                  /* Do not change any files on disk */
  int latestFlag;                /* Checkout the latest version */
  char *zVers;                   /* Version to checkout */
  int promptFlag;                /* True to prompt before overwriting */
................................................................................
}

/*
** COMMAND: close
**
** Usage: %fossil close ?-f|--force?
**
** The opposite of "open".  Close the current database connection.
** Require a -f or --force flag if there are unsaved changed in the
** current check-out.
*/
void close_cmd(void){
  int forceFlag = find_option("force","f",0)!=0;
  db_must_be_within_tree();
  if( !forceFlag && unsaved_changes()==1 ){
    fossil_fatal("there are unsaved changes in the current checkout");
  }
  db_close();
  unlink_local_database();
}






|







 







|












170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
** the --force option appears on the command-line.  The --keep option
** leaves files on disk unchanged, except the manifest and manifest.uuid
** files.
**
** The --latest flag can be used in place of VERSION to checkout the
** latest version in the repository.
**
** See also the <a>update</a> command.
*/
void checkout_cmd(void){
  int forceFlag;                 /* Force checkout even if edits exist */
  int keepFlag;                  /* Do not change any files on disk */
  int latestFlag;                /* Checkout the latest version */
  char *zVers;                   /* Version to checkout */
  int promptFlag;                /* True to prompt before overwriting */
................................................................................
}

/*
** COMMAND: close
**
** Usage: %fossil close ?-f|--force?
**
** The opposite of <a>open</a>.  Close the current database connection.
** Require a -f or --force flag if there are unsaved changed in the
** current check-out.
*/
void close_cmd(void){
  int forceFlag = find_option("force","f",0)!=0;
  db_must_be_within_tree();
  if( !forceFlag && unsaved_changes()==1 ){
    fossil_fatal("there are unsaved changes in the current checkout");
  }
  db_close();
  unlink_local_database();
}

Changes to src/clone.c.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48

/*
** COMMAND: clone
**
** Usage: %fossil clone ?OPTIONS? URL FILENAME
**
** Make a clone of a repository specified by URL in the local
** file named FILENAME.  
**
** By default, your current login name is used to create the default
** admin user. This can be overridden using the -A|--admin-user
** parameter.
**
** Options:
**
**    --admin-user|-A USERNAME
**

*/
void clone_cmd(void){
  char *zPassword;
  const char *zDefaultUser;   /* Optional name of the default user */

  url_proxy_options();
  if( g.argc < 4 ){






|
|









>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

/*
** COMMAND: clone
**
** Usage: %fossil clone ?OPTIONS? URL FILENAME
**
** Make a clone of a repository specified by URL in the local file
** named FILENAME.  
**
** By default, your current login name is used to create the default
** admin user. This can be overridden using the -A|--admin-user
** parameter.
**
** Options:
**
**    --admin-user|-A USERNAME
**
** See also:  <a>push</a>, <a>pull</a>, <a>remote-url</a>, <a>sync</a>
*/
void clone_cmd(void){
  char *zPassword;
  const char *zDefaultUser;   /* Optional name of the default user */

  url_proxy_options();
  if( g.argc < 4 ){

Changes to src/configure.c.

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411





412
413
414
415
416
417
418

/*
** COMMAND: configuration
**
** Usage: %fossil configure METHOD ... ?-R|--repository REPOSITORY?
**
** Where METHOD is one of: export import merge pull push reset.  All methods
** accept the -R or --repository option to specific a repository.
**
**    %fossil configuration export AREA FILENAME
**
**         Write to FILENAME exported configuraton information for AREA.
**         AREA can be one of:  all email project shun skin ticket user
**
**    %fossil configuration import FILENAME
**
**         Read a configuration from FILENAME, overwriting the current
**         configuration.
**
**    %fossil configuration merge FILENAME
**
**         Read a configuration from FILENAME and merge its values into
**         the current configuration.  Existing values take priority over
**         values read from FILENAME.
**
**    %fossil configuration pull AREA ?URL?
**
**         Pull and install the configuration from a different server
**         identified by URL.  If no URL is specified, then the default
**         server is used. 
**
**    %fossil configuration push AREA ?URL?
**
**         Push the local configuration into the remote server identified
**         by URL.  Admin privilege is required on the remote server for
**         this to work.
**
**    %fossil configuration reset AREA
**
**         Restore the configuration to the default.  AREA as above.
**
** WARNING: Do not import, merge, or pull configurations from an untrusted
** source.  The inbound configuration is not checked for safety and can
** introduce security vulnerabilities.





*/
void configuration_cmd(void){
  int n;
  const char *zMethod;
  if( g.argc<3 ){
    usage("export|import|merge|pull|reset ...");
  }






|
|



|
|



|
|



|
|
|



|
|
|



|
|
|



|

|
|
|
>
>
>
>
>







367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423

/*
** COMMAND: configuration
**
** Usage: %fossil configure METHOD ... ?-R|--repository REPOSITORY?
**
** Where METHOD is one of: export import merge pull push reset.  All
** methods accept the -R or --repository option to specify a repository.
**
**    %fossil configuration export AREA FILENAME
**
**        Write to FILENAME exported configuraton information for AREA.
**        AREA can be one of:  all email project shun skin ticket user
**
**    %fossil configuration import FILENAME
**
**        Read a configuration from FILENAME, overwriting the current
**        configuration.
**
**    %fossil configuration merge FILENAME
**
**        Read a configuration from FILENAME and merge its values into
**        the current configuration.  Existing values take priority
**        over values read from FILENAME.
**
**    %fossil configuration pull AREA ?URL?
**
**        Pull and install the configuration from a different server
**        identified by URL.  If no URL is specified, then the default
**        server is used. 
**
**    %fossil configuration push AREA ?URL?
**
**        Push the local configuration into the remote server identified
**        by URL.  Admin privilege is required on the remote server for
**        this to work.
**
**    %fossil configuration reset AREA
**
**        Restore the configuration to the default.  AREA as above.
**
** WARNING: Do not import or merge or pull configurations from an
** untrusted source.  The inbound configuration is not checked for
** safety and can introduce security vulnerabilities.
**
** The different parts of this configuration can also be controlled
** using the gui:
**  *  Go to page <a href="setup">Admin</a> and use the subcommands
**
*/
void configuration_cmd(void){
  int n;
  const char *zMethod;
  if( g.argc<3 ){
    usage("export|import|merge|pull|reset ...");
  }

Changes to src/db.c.

1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
....
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
....
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543

1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607




1608
1609
1610
1611
1612
1613
1614
/*
** COMMAND: new
**
** Usage: %fossil new ?OPTIONS? FILENAME
**
** Create a repository for a new project in the file named FILENAME.
** This command is distinct from "clone".  The "clone" command makes
** a copy of an existing project.  This command starts a new project.
**
** By default, your current login name is used to create the default
** admin user. This can be overridden using the -A|--admin-user
** parameter.
**
** Options:
................................................................................
**
** Open a connection to the local repository in FILENAME.  A checkout
** for the repository is created with its root at the working directory.
** If VERSION is specified then that version is checked out.  Otherwise
** the latest version is checked out.  No files other than "manifest"
** and "manifest.uuid" are modified if the --keep option is present.
**
** See also the "close" command.
*/
void cmd_open(void){
  Blob path;
  int vid;
  int keepFlag;
  static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 };
  url_proxy_options();
................................................................................

/*
** COMMAND: settings
** COMMAND: unset
** %fossil settings ?PROPERTY? ?VALUE? ?-global?
** %fossil unset PROPERTY ?-global?
**
** The "settings" command with no arguments lists all properties and their
** values.  With just a property name it shows the value of that property.
** With a value argument it changes the property for the current repository.

**
** The "unset" command clears a property setting.
**
**
**    auto-captcha     If enabled, the Login page provides a button to
**                     fill in the captcha password.  Default: on
**
**    auto-shun        If enabled, automatically pull the shunning list
**                     from a server to which the client autosyncs.
**
**    autosync         If enabled, automatically pull prior to commit
**                     or update and automatically push after commit or
**                     tag or branch creation.  If the value is "pullonly"
**                     then only pull operations occur automatically.
**
**    binary-glob      The VALUE is a comma-separated list of GLOB patterns
**                     that should be treated as binary files for merging
**                     purposes.  Example:   *.xml
**
**    clearsign        When enabled, fossil will attempt to sign all commits
**                     with gpg.  When disabled (the default), commits will
**                     be unsigned.
**
**    diff-command     External command to run when performing a diff.
**                     If undefined, the internal text diff will be used.
**
**    dont-push        Prevent this repository from pushing from client to
**                     server.  Useful when setting up a private branch.
**
**    editor           Text editor command used for check-in comments.
**
**    gdiff-command    External command to run when performing a graphical
**                     diff. If undefined, text diff will be used.
**
**    http-port        The TCP/IP port number to use by the "server"
**                     and "ui" commands.  Default: 8080
**
**    ignore-glob      The VALUE is a comma-separated list of GLOB patterns
**                     specifying files that the "extra" command will ignore.
**                     Example:  *.o,*.obj,*.exe
**
**    localauth        If enabled, require that HTTP connections from
**                     127.0.0.1 be authenticated by password.  If
**                     false, all HTTP requests from localhost have
**                     unrestricted access to the repository.
**
**    mtime-changes    Use file modification times (mtimes) to detect when
**                     files have been modified.  (Default "on".)
**
**    pgp-command      Command used to clear-sign manifests at check-in.
**                     The default is "gpg --clearsign -o ".
**
**    proxy            URL of the HTTP proxy.  If undefined or "off" then
**                     the "http_proxy" environment variable is consulted.
**                     If the http_proxy environment variable is undefined
**                     then a direct HTTP connection is used.
**
**    ssh-command      Command used to talk to a remote machine with
**                     the "ssh://" protocol.
**
**    web-browser      A shell command used to launch your preferred
**                     web browser when given a URL as an argument.
**                     Defaults to "start" on windows, "open" on Mac,
**                     and "firefox" on Unix.




*/
void setting_cmd(void){
  int i;
  int globalFlag = find_option("global","g",0)!=0;
  int unsetFlag = g.argv[1][0]=='u';
  db_open_config(1);
  db_find_and_open_repository(0);






|







 







|







 







|
|
|
>




|
|

|
|

|
|
|
|

|
|
|

|
|
|

|
|

|
|

|

|
|

|
|

|
|
|

|
|
|
|

|
|

|
|

|
|
|
|

|
|

|
|
|
|
>
>
>
>







1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
....
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
....
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
/*
** COMMAND: new
**
** Usage: %fossil new ?OPTIONS? FILENAME
**
** Create a repository for a new project in the file named FILENAME.
** This command is distinct from "clone".  The <a>clone</a> command makes
** a copy of an existing project.  This command starts a new project.
**
** By default, your current login name is used to create the default
** admin user. This can be overridden using the -A|--admin-user
** parameter.
**
** Options:
................................................................................
**
** Open a connection to the local repository in FILENAME.  A checkout
** for the repository is created with its root at the working directory.
** If VERSION is specified then that version is checked out.  Otherwise
** the latest version is checked out.  No files other than "manifest"
** and "manifest.uuid" are modified if the --keep option is present.
**
** See also the <a>close</a> command.
*/
void cmd_open(void){
  Blob path;
  int vid;
  int keepFlag;
  static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 };
  url_proxy_options();
................................................................................

/*
** COMMAND: settings
** COMMAND: unset
** %fossil settings ?PROPERTY? ?VALUE? ?-global?
** %fossil unset PROPERTY ?-global?
**
** The "settings" command with no arguments lists all properties and
** their values.  With just a property name it shows the value of that
** property. With a value argument it changes the property for the
** current repository.
**
** The "unset" command clears a property setting.
**
**
**    auto-captcha  If enabled, the Login page provides a button to
**                  fill in the captcha password.  Default: on
**
**    auto-shun     If enabled, automatically pull the shunning list
**                  from a server to which the client autosyncs.
**
**    autosync      If enabled, automatically pull prior to commit
**                  or update and automatically push after commit or
**                  tag or branch creation.  If the value is "pullonly"
**                  then only pull operations occur automatically.
**
**    binary-glob   The VALUE is a comma-separated list of GLOB patterns
**                  that should be treated as binary files for merging
**                  purposes.  Example:   *.xml
**
**    clearsign     When enabled, fossil will attempt to sign all commits
**                  with gpg.  When disabled (the default), commits will
**                  be unsigned.
**
**    diff-command  External command to run when performing a diff.
**                  If undefined, the internal text diff will be used.
**
**    dont-push     Prevent this repository from pushing from client to
**                  server.  Useful when setting up a private branch.
**
**    editor        Text editor command used for check-in comments.
**
**    gdiff-command External command to run when performing a graphical
**                  diff. If undefined, text diff will be used.
**
**    http-port     The TCP/IP port number to use by the "server"
**                  and "ui" commands.  Default: 8080
**
**    ignore-glob   The VALUE is a comma-separated list of GLOB patterns
**                  specifying files that the "extra" command will ignore.
**                  Example:  *.o,*.obj,*.exe
**
**    localauth     If enabled, require that HTTP connections from
**                  127.0.0.1 be authenticated by password.  If
**                  false, all HTTP requests from localhost have
**                  unrestricted access to the repository.
**
**    mtime-changes Use file modification times (mtimes) to detect when
**                  files have been modified.  (Default "on".)
**
**    pgp-command   Command used to clear-sign manifests at check-in.
**                  The default is "gpg --clearsign -o ".
**
**    proxy         URL of the HTTP proxy.  If undefined or "off" then
**                  the "http_proxy" environment variable is consulted.
**                  If the http_proxy environment variable is undefined
**                  then a direct HTTP connection is used.
**
**    ssh-command   Command used to talk to a remote machine with
**                  the "ssh://" protocol.
**
**    web-browser   A shell command used to launch your preferred
**                  web browser when given a URL as an argument.
**                  Defaults to "start" on windows, "open" on Mac,
**                  and "firefox" on Unix.
**
** There is a simple form in the administration gui for these settings:
**  *  Go to the <a href="setup">Admin</a> page
**  ** and click <a href="setup_settings">Settings</a>
*/
void setting_cmd(void){
  int i;
  int globalFlag = find_option("global","g",0)!=0;
  int unsetFlag = g.argv[1][0]=='u';
  db_open_config(1);
  db_find_and_open_repository(0);

Changes to src/descendants.c.

253
254
255
256
257
258
259
260
261
262
263
264
265
266



267
268
269
270
271
272
273
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
...
349
350
351
352
353
354
355
356
357
    timeline_query_for_tty()
  );
  print_timeline(&q, 20);
  db_finalize(&q);
}

/*
** COMMAND:  leaves
**
** Usage: %fossil leaves ?--all? ?--closed?
**
** Find leaves of all branches.  By default show only open leaves.
** The --all flag causes all leaves (closed and open) to be shown.
** The --closed flag shows only closed leaves.



*/
void leaves_cmd(void){
  Stmt q;
  int showAll = find_option("all", 0, 0)!=0;
  int showClosed = find_option("closed", 0, 0)!=0;

  db_must_be_within_tree();
................................................................................
static void leaves_extra(int rid){
  if( g.okHistory ){
    @ <a href="%s(g.zBaseURL)/timeline?p=%d(rid)">[timeline]</a>
  }
}

/*
** WEBPAGE:  leaves
**
** Find leaves of all branches.
*/
void leaves_page(void){
  Stmt q;
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
................................................................................
  @ <br />
  @ <script  type="text/JavaScript">
  @ function xin(id){
  @ }
  @ function xout(id){
  @ }
  @ </script>
  style_footer();
}






|






>
>
>







 







|







 







|

253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
...
352
353
354
355
356
357
358
359
360
    timeline_query_for_tty()
  );
  print_timeline(&q, 20);
  db_finalize(&q);
}

/*
** COMMAND: leaves
**
** Usage: %fossil leaves ?--all? ?--closed?
**
** Find leaves of all branches.  By default show only open leaves.
** The --all flag causes all leaves (closed and open) to be shown.
** The --closed flag shows only closed leaves.
**
** This information can also be viewed in the gui:
**  * Go the <a href="leaves">leaves</a> page
*/
void leaves_cmd(void){
  Stmt q;
  int showAll = find_option("all", 0, 0)!=0;
  int showClosed = find_option("closed", 0, 0)!=0;

  db_must_be_within_tree();
................................................................................
static void leaves_extra(int rid){
  if( g.okHistory ){
    @ <a href="%s(g.zBaseURL)/timeline?p=%d(rid)">[timeline]</a>
  }
}

/*
** WEBPAGE: leaves
**
** Find leaves of all branches.
*/
void leaves_page(void){
  Stmt q;
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
................................................................................
  @ <br />
  @ <script  type="text/JavaScript">
  @ function xin(id){
  @ }
  @ function xout(id){
  @ }
  @ </script>
  style_footer_cmdref("leaves",0);
}

Changes to src/diff.c.

808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824



825
826
827
828
829
830
831
  annotate_file(&ann, fnid, mid, g.okHistory);
  @ <pre>
  for(i=0; i<ann.nOrig; i++){
    ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
    @ %s(ann.aOrig[i].zSrc): %h(ann.aOrig[i].z)
  }
  @ </pre>
  style_footer();
}

/*
** COMMAND: annotate
**
** %fossil annotate FILENAME
**
** Output the text of a file with markings to show when each line of
** the file was last modified.



*/
void annotate_cmd(void){
  int fnid;         /* Filename ID */
  int fid;          /* File instance ID */
  int mid;          /* Manifest where file was checked in */
  Blob treename;    /* FILENAME translated to canonical form */
  char *zFilename;  /* Cannonical filename */






|









>
>
>







808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
  annotate_file(&ann, fnid, mid, g.okHistory);
  @ <pre>
  for(i=0; i<ann.nOrig; i++){
    ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
    @ %s(ann.aOrig[i].zSrc): %h(ann.aOrig[i].z)
  }
  @ </pre>
  style_footer_cmdref("annotate",0);
}

/*
** COMMAND: annotate
**
** %fossil annotate FILENAME
**
** Output the text of a file with markings to show when each line of
** the file was last modified.
**
** This can also be viewed in the gui, if you click the "annotate" link
** on the "File History" page of files.
*/
void annotate_cmd(void){
  int fnid;         /* Filename ID */
  int fid;          /* File instance ID */
  int mid;          /* Manifest where file was checked in */
  Blob treename;    /* FILENAME translated to canonical form */
  char *zFilename;  /* Cannonical filename */

Changes to src/diffcmd.c.

415
416
417
418
419
420
421
422
423
424
425
426
427
428





429
430
431
432
433
434
435
**
** If the "--from VERSION" or "-r VERSION" option is used it specifies
** the source check-in for the diff operation.  If not specified, the 
** source check-in is the base check-in for the current check-out.
**
** If the "--to VERSION" option appears, it specifies the check-in from
** which the second version of the file or files is taken.  If there is
** no "--to" option then the (possibly edited) files in the current check-out
** are used.
**
** The "-i" command-line option forces the use of the internal diff logic
** rather than any external diff program that might be configured using
** the "setting" command.  If no external diff program is configured, then
** the "-i" option is a no-op.  The "-i" option converts "gdiff" into "diff".





*/
void diff_cmd(void){
  int isGDiff;               /* True for gdiff.  False for normal diff */
  int isInternDiff;          /* True for internal diff */
  int hasNFlag;              /* True if -N or --new-file flag is used */
  const char *zFrom;         /* Source version number */
  const char *zTo;           /* Target version number */






|
|



|
|
>
>
>
>
>







415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
**
** If the "--from VERSION" or "-r VERSION" option is used it specifies
** the source check-in for the diff operation.  If not specified, the 
** source check-in is the base check-in for the current check-out.
**
** If the "--to VERSION" option appears, it specifies the check-in from
** which the second version of the file or files is taken.  If there is
** no "--to" option then the (possibly edited) files in the current
** check-out are used.
**
** The "-i" command-line option forces the use of the internal diff logic
** rather than any external diff program that might be configured using
** the <a>setting</a> command. If no external diff program is configured, then
** the "-i" option is a no-op.  The "-i" option converts "gdiff" into
** "diff".
**
** The results of the internal diff command can also be seen in the gui:
**  1. Go to the <a href="vdiff">vdiff</a> page
**  2. use the "diff against another version" link on the Check-in detail view.
*/
void diff_cmd(void){
  int isGDiff;               /* True for gdiff.  False for normal diff */
  int isInternDiff;          /* True for internal diff */
  int hasNFlag;              /* True if -N or --new-file flag is used */
  const char *zFrom;         /* Source version number */
  const char *zTo;           /* Target version number */

Changes to src/event.c.

438
439
440
441
442
443
444
445
446
  @ <tr><td colspan="2">
  @ <input type="submit" name="preview" value="Preview Your Changes" />
  @ <input type="submit" name="submit" value="Apply These Changes" />
  @ <input type="submit" name="cancel" value="Cancel" />
  @ </td></tr></table>
  @ </div></form>
  style_footer();
}






|

438
439
440
441
442
443
444
445
446
  @ <tr><td colspan="2">
  @ <input type="submit" name="preview" value="Preview Your Changes" />
  @ <input type="submit" name="submit" value="Apply These Changes" />
  @ <input type="submit" name="cancel" value="Cancel" />
  @ </td></tr></table>
  @ </div></form>
  style_footer_cmdref(0,"<a href=\"wiki_rules\">wiki format</a>");
}

Changes to src/finfo.c.

25
26
27
28
29
30
31



32
33
34
35
36
37
38
...
207
208
209
210
211
212
213
214
215
** 
** Usage: %fossil finfo FILENAME
**
** Print the change history for a single file.
**
** The "--limit N" and "--offset P" options limit the output to the first
** N changes after skipping P changes.



*/
void finfo_cmd(void){
  Stmt q;
  int vid;
  Blob dest;
  const char *zFilename;
  const char *zLimit;
................................................................................
    }else{
      @ <tr><td></td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div>
      @     </td></tr>
    }
  }
  @ </table>
  timeline_output_graph_javascript(pGraph);
  style_footer();
}






>
>
>







 







|

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
...
210
211
212
213
214
215
216
217
218
** 
** Usage: %fossil finfo FILENAME
**
** Print the change history for a single file.
**
** The "--limit N" and "--offset P" options limit the output to the first
** N changes after skipping P changes.
**
** The history of a file can also be viewed in the gui:
**  * Go to the <a href="dir">file browser</a> and drill down to the file
*/
void finfo_cmd(void){
  Stmt q;
  int vid;
  Blob dest;
  const char *zFilename;
  const char *zLimit;
................................................................................
    }else{
      @ <tr><td></td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div>
      @     </td></tr>
    }
  }
  @ </table>
  timeline_output_graph_javascript(pGraph);
  style_footer_cmdref("finfo",0);
}

Changes to src/info.c.

431
432
433
434
435
436
437


438
439
440
441
442
443
444
...
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
...
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
...
632
633
634
635
636
637
638
639


640
641
642
643
644
645
646




















647
648
649



650
651
652
653
654
655
656
...
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
...
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
....
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
....
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
        @ | <a href="%s(g.zTop)/zip/%s(zProjName)-%S(zUuid).zip?uuid=%s(zUuid)">
        @         ZIP archive</a>
      }
      @   | <a href="%s(g.zTop)/artifact/%S(zUuid)">manifest</a>
      if( g.okWrite ){
        @   | <a href="%s(g.zTop)/ci_edit?r=%S(zUuid)">edit</a>
      }


      @   </td>
      @ </tr>
    }
    @ </table>
  }else{
    style_header("Check-in Information");
    login_anonymous_available();
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q,0);
    const char *zOld = db_column_text(&q,1);
    const char *zNew = db_column_text(&q,2);
    append_file_change_line(zName, zOld, zNew, showDiff);
  }
  db_finalize(&q);
  style_footer();
}

/*
** WEBPAGE: winfo
** URL:  /winfo?name=RID
**
** Return information about a wiki page.
................................................................................
      blob_init(&wiki, m.zWiki, -1);
      @ <div class="section">Content</div>
      wiki_convert(&wiki, 0, 0);
      blob_reset(&wiki);
    }
    manifest_clear(&m);
  }
  style_footer();
}

/*
** Show a webpage error message
*/
void webpage_error(const char *zFormat, ...){
  va_list ap;
................................................................................
** WEBPAGE: vdiff
** URL: /vdiff?from=UUID&amp;to=UUID&amp;detail=BOOLEAN
**
** Show all differences between two checkins.  
*/
void vdiff_page(void){
  int ridFrom, ridTo;
  int showDetail = 0;


  int iFrom, iTo;
  Manifest mFrom, mTo;

  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }
  login_anonymous_available();





















  if( vdiff_parse_manifest("from", &ridFrom, &mFrom) ) return;
  if( vdiff_parse_manifest("to", &ridTo, &mTo) ) return;
  showDetail = atoi(PD("detail","0"));



  style_header("Check-in Differences");
  @ <h2>Difference From:</h2><blockquote>
  checkin_description(ridFrom);
  @ </blockquote><h2>To:</h2><blockquote>
  checkin_description(ridTo);
  @ </blockquote><hr /><p>

................................................................................
      iFrom++;
      iTo++;
    }
  }
  manifest_clear(&mFrom);
  manifest_clear(&mTo);

  style_footer();
}

/*
** Write a description of an object to the www reply.
**
** If the object is a file then mention:
**
................................................................................
  blob_zero(&diff);
  text_diff(&c1, &c2, &diff, 4, 1);
  blob_reset(&c1);
  blob_reset(&c2);
  @ %h(blob_str(&diff))
  @ </pre></blockquote>
  blob_reset(&diff);
  style_footer();
}

/*
** WEBPAGE: raw
** URL: /raw?name=ARTIFACTID&m=TYPE
** 
** Return the uninterpreted content of an artifact.  Used primarily
................................................................................
    }else{
      @ <pre>
      hexdump(&content);
      @ </pre>
    }
    @ </blockquote>
  }
  style_footer();
}  

/*
** WEBPAGE: tinfo
** URL: /tinfo?name=ARTIFACTID
**
** Show the details of a ticket change control artifact.
................................................................................
    @ </p>
  }
  @
  @ <ol>
  free(zDate);
  ticket_output_change_artifact(&m);
  manifest_clear(&m);
  style_footer();
}


/*
** WEBPAGE: info
** URL: info/ARTIFACTID
**






>
>







 







|







 







|







 







|
>
>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
<
>
>
>







 







|







 







|







 







|







 







|







431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
...
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
...
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
...
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
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
...
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
...
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
....
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
....
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
        @ | <a href="%s(g.zTop)/zip/%s(zProjName)-%S(zUuid).zip?uuid=%s(zUuid)">
        @         ZIP archive</a>
      }
      @   | <a href="%s(g.zTop)/artifact/%S(zUuid)">manifest</a>
      if( g.okWrite ){
        @   | <a href="%s(g.zTop)/ci_edit?r=%S(zUuid)">edit</a>
      }
      @   | <a href="%s(g.zTop)/vdiff?from=%S(zUuid)">
      @      diff against another version</a>
      @   </td>
      @ </tr>
    }
    @ </table>
  }else{
    style_header("Check-in Information");
    login_anonymous_available();
................................................................................
  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q,0);
    const char *zOld = db_column_text(&q,1);
    const char *zNew = db_column_text(&q,2);
    append_file_change_line(zName, zOld, zNew, showDiff);
  }
  db_finalize(&q);
  style_footer_cmdref("info",0);
}

/*
** WEBPAGE: winfo
** URL:  /winfo?name=RID
**
** Return information about a wiki page.
................................................................................
      blob_init(&wiki, m.zWiki, -1);
      @ <div class="section">Content</div>
      wiki_convert(&wiki, 0, 0);
      blob_reset(&wiki);
    }
    manifest_clear(&m);
  }
  style_footer_cmdref("info",0);
}

/*
** Show a webpage error message
*/
void webpage_error(const char *zFormat, ...){
  va_list ap;
................................................................................
** WEBPAGE: vdiff
** URL: /vdiff?from=UUID&amp;to=UUID&amp;detail=BOOLEAN
**
** Show all differences between two checkins.  
*/
void vdiff_page(void){
  int ridFrom, ridTo;
  int showDetail = atoi(PD("detail","0"));
  const char *zFrom = P("from");
  const char *zTo = P("to");
  int iFrom, iTo;
  Manifest mFrom, mTo;

  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }
  login_anonymous_available();

  if( !zFrom || !zFrom[0] || !zTo || !zTo[0] ){
    /* if from or to or both are bissing, show a form to enter
    ** the query parameters by hand
    */
    style_header("Check-in Differences");
    @ <p><br/>
    @ Enter below the UUIDs, branch- or tag-names, you wish to diff:
    @ <br/></p>
    @ <form action="%s(g.zBaseURL)/vdiff" method="post"><div>
    @ <table><tr><td>from:</td><td><input type="text" size="40"
    @  name="from" value="%s(zFrom?zFrom:"")" /></td><td></td></tr>
    @ <tr><td>to:</td><td><input type="text" size="40"
    @  name="to" value="%s(zTo?zTo:"")" /></td><td></td></tr>
    @ <tr><td>details:</td><td><input type="checkbox" name="detail"
    @  checked="checked" value="1" /></td></tr>
    @ <tr><td></td><td></td><td>
    @  <input type="submit" name="diff" value="diff" /></td></tr></table>
    @ </div></form>
    style_footer_cmdref("diff",0);
    return;
  }else if(    vdiff_parse_manifest("from", &ridFrom, &mFrom) 
            || vdiff_parse_manifest("to", &ridTo, &mTo)

  ){
    return;
  }
  style_header("Check-in Differences");
  @ <h2>Difference From:</h2><blockquote>
  checkin_description(ridFrom);
  @ </blockquote><h2>To:</h2><blockquote>
  checkin_description(ridTo);
  @ </blockquote><hr /><p>

................................................................................
      iFrom++;
      iTo++;
    }
  }
  manifest_clear(&mFrom);
  manifest_clear(&mTo);

  style_footer_cmdref("diff",0);
}

/*
** Write a description of an object to the www reply.
**
** If the object is a file then mention:
**
................................................................................
  blob_zero(&diff);
  text_diff(&c1, &c2, &diff, 4, 1);
  blob_reset(&c1);
  blob_reset(&c2);
  @ %h(blob_str(&diff))
  @ </pre></blockquote>
  blob_reset(&diff);
  style_footer_cmdref("diff",0);
}

/*
** WEBPAGE: raw
** URL: /raw?name=ARTIFACTID&m=TYPE
** 
** Return the uninterpreted content of an artifact.  Used primarily
................................................................................
    }else{
      @ <pre>
      hexdump(&content);
      @ </pre>
    }
    @ </blockquote>
  }
  style_footer_cmdref( "artifact",0 );
}  

/*
** WEBPAGE: tinfo
** URL: /tinfo?name=ARTIFACTID
**
** Show the details of a ticket change control artifact.
................................................................................
    @ </p>
  }
  @
  @ <ol>
  free(zDate);
  ticket_output_change_artifact(&m);
  manifest_clear(&m);
  style_footer_cmdref("info",0);
}


/*
** WEBPAGE: info
** URL: info/ARTIFACTID
**

Changes to src/main.c.

574
575
576
577
578
579
580
581




582
583
584
585
586
587
588
...
600
601
602
603
604
605
606










607
608
609
610
611
612
613
...
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633




634
635

636
637
638
639



640
641




















































642
643

644
645
646
647

648



649
650

651
652
653
654

655







656

657




658
659
660







661
662
663
664
665
666
667
...
867
868
869
870
871
872
873


874
875
876
877
878
879
880
...
980
981
982
983
984
985
986


987
988
989
990
991
992
993
....
1068
1069
1070
1071
1072
1073
1074


1075
1076
1077
1078
1079
1080
1081

/*
** COMMAND: help
**
** Usage: %fossil help COMMAND
**
** Display information on how to use COMMAND




*/
void help_cmd(void){
  int rc, idx;
  const char *z;
  if( g.argc!=3 ){
    printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
    cmd_cmd_list();
................................................................................
    fossil_fatal("no help available for the %s command",
       aCommand[idx].zName);
  }
  while( *z ){
    if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
      printf("%s", g.argv[0]);
      z += 7;










    }else{
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
}
................................................................................
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
    const char * zCmd = P("cmd");
    
    style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
    if( zCmd ){
      int rc, idx;
      char *z, *s, *d;

      @ <h1>%s(zCmd)</h1>
      rc = name_search(zCmd, aCommand, count(aCommand), &idx);
      if( rc==1 ){
        @ unknown command: %s(zCmd)
      }else if( rc==2 ){
        @ ambiguous command prefix: %s(zCmd)
      }else{




        z = (char*)aCmdHelp[idx];
        if( z==0 ){

          @ no help available for the %s(aCommand[idx].zName) command
        }else{
          z=s=d=mprintf("%s",z);
	  while( *s ){



	    if( *s=='%' && strncmp(s, "%fossil", 7)==0 ){
	      s++;




















































	    }else{
	      *d++ = *s++;

	    }
	  }
	  *d = 0;
	  @ <pre>%s(z)</pre>

	  free(z);



	}
      }

      @ <hr/><a href="help">available commands</a> in fossil
      @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }else{
      int i;

      







      @ <h1>Available commands</h1>

      for(i=0; i<count(aCommand); i++){




        if( strncmp(aCommand[i].zName,"test",4)==0 ) continue;
        @ <kbd><a href="help?cmd=%s(aCommand[i].zName)">
        @ %s(aCommand[i].zName)</a></kbd>







      }
      @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }
    style_footer();
}

/*
................................................................................
**
**      #!/usr/bin/fossil
**      repository: /home/somebody/project.db
**
** The second line defines the name of the repository.  After locating
** the repository, fossil will generate a webpage on stdout based on
** the values of standard CGI environment variables.


*/
void cmd_cgi(void){
  const char *zFile;
  const char *zNotFound = 0;
  Blob config, line, key, value;
  if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
    zFile = g.argv[2];
................................................................................
** repository.
**
** If REPOSITORY is a directory that contains one or more respositories
** with names of the form "*.fossil" then the first element of the URL
** pathname selects among the various repositories.  If the pathname does
** not select a valid repository and the --notfound option is available,
** then the server redirects (HTTP code 302) to the URL of --notfound.


*/
void cmd_http(void){
  const char *zIpAddr;
  const char *zNotFound;
  zNotFound = find_option("notfound", 0, 1);
  g.cgiOutput = 1;
  if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){
................................................................................
** the web server.  The "ui" command also binds to 127.0.0.1 and so will
** only process HTTP traffic from the local machine.
**
** In the "server" command, the REPOSITORY can be a directory (aka folder)
** that contains one or more respositories with names ending in ".fossil".
** In that case, the first element of the URL is used to select among the
** various repositories.


*/
void cmd_webserver(void){
  int iPort, mxPort;        /* Range of TCP ports allowed */
  const char *zPort;        /* Value of the --port option */
  char *zBrowser;           /* Name of web browser program */
  char *zBrowserCmd = 0;    /* Command to launch the web browser */
  int isUiCmd;              /* True if command is "ui", not "server' */






|
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







|

<

<


|

|

>
>
>
>
|
<
>


<
<
>
>
>
|
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
|
|
|
<
>
|
>
>
>
|

>
|


<
>

>
>
>
>
>
>
>

>
|
>
>
>
>
|
|
|
>
>
>
>
>
>
>







 







>
>







 







>
>







 







>
>







574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
...
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
...
630
631
632
633
634
635
636
637
638

639

640
641
642
643
644
645
646
647
648
649
650

651
652
653


654
655
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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710

711
712
713
714

715
716
717
718
719
720
721
722
723
724
725

726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
...
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
....
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
....
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178

/*
** COMMAND: help
**
** Usage: %fossil help COMMAND
**
** Display information on how to use COMMAND. If COMMAND is
** omitted, a list of available commands is displayed.
**
** This can also be viewed in the gui:
**  * Go to the <a href="help">help</a> page and click COMMAND
*/
void help_cmd(void){
  int rc, idx;
  const char *z;
  if( g.argc!=3 ){
    printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
    cmd_cmd_list();
................................................................................
    fossil_fatal("no help available for the %s command",
       aCommand[idx].zName);
  }
  while( *z ){
    if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
      printf("%s", g.argv[0]);
      z += 7;
    }else if( *z=='<' && strncmp(z,"<a ",3)==0 ){
      putchar('"');
      while( *z && *z!='>') z++;
      if( *z ) z++;
    }else if( *z=='<' && strncmp(z,"<a>",3)==0 ){
      putchar('"');
      z += 3;
    }else if( *z=='<' && strncmp(z,"</a>",4)==0 ){
      putchar('"');
      z += 4;
    }else{
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
}
................................................................................
** WEBPAGE: help
** URL: /help?cmd=CMD
*/
void help_page(void){
    const char * zCmd = P("cmd");
    
    style_header("Command line help %s%s",zCmd?" - ":"",zCmd?zCmd:"");
    if( zCmd  && zCmd[0] && strcmp(zCmd,"test") ){
      int rc, idx;



      rc = name_search(zCmd, aCommand, count(aCommand), &idx);
      if( rc==1 ){
        @ <h1>unknown command: %s(zCmd)</h1>
      }else if( rc==2 ){
        @ <h1>ambiguous command prefix: %s(zCmd)</h1>
      }else{
        char *zSrc, *zDest;
        int src,dest,len;

        @ <h1>%s(aCommand[idx].zName)</h1>
        zSrc = (char*)aCmdHelp[idx];

        if( zSrc==0 || *zSrc==0 ){
          @ no help available for the %s(aCommand[idx].zName) command
        }else{


          len = strlen(zSrc);
          zDest = malloc(len+1);
          for(src=dest=0;zSrc[src];){
            if( zSrc[src]=='%' && strncmp(zSrc+src, "%fossil", 7)==0 ){

              src++; /* skip % for fossil argv[0] expansion */
            }else if( zSrc[src]=='<' && strncmp(zSrc+src, "</a>", 3)==0 ){
              src += 4;
              zDest[dest++]='<';
              zDest[dest++]='/';
              zDest[dest++]='a';
              zDest[dest++]='>';
              zDest[dest++]='"';
            }else if( zSrc[src]=='<' && strncmp(zSrc+src, "<a ", 3)==0 ){
              len += 2;
	      zDest=realloc(zDest,len);
              zDest[dest++]='"';
              while( zSrc[src] && zSrc[src]!='>' ){
                zDest[dest++]=zSrc[src++];
              }
              if( zSrc[src] ) zDest[dest++]=zSrc[src++];
            }else if( zSrc[src]=='<' && strncmp(zSrc+src, "<a>", 3)==0 ){
              /* found an internal command cross reference,
              ** create an additional link
              */
              int start;

              len+=80;
              zDest=realloc(zDest,len);
              zDest[dest++]='"';
              zDest[dest++]=zSrc[src++]; /* < */
              zDest[dest++]=zSrc[src++]; /* a */
              zDest[dest++]=' ';
              zDest[dest++]='h';
              zDest[dest++]='r';
              zDest[dest++]='e';
              zDest[dest++]='f';
              zDest[dest++]='=';
              zDest[dest++]='"';
              zDest[dest++]='h';
              zDest[dest++]='e';
              zDest[dest++]='l';
              zDest[dest++]='p';
              zDest[dest++]='?';
              zDest[dest++]='c';
              zDest[dest++]='m';
              zDest[dest++]='d';
              zDest[dest++]='=';
              start = src+1;
              for( src=start; zSrc[src] && zSrc[src]!='<'; ){
                zDest[dest++]=zSrc[src++]; /* command name */
              }
              zDest[dest++]='"';
              zDest[dest++]='>';
              for( src=start; zSrc[src] && zSrc[src]!='<'; ){
                zDest[dest++]=zSrc[src++]; /* command name */
              }
            }else{

              zDest[dest++] = zSrc[src++];
            }
          }
          zDest[dest] = 0;

          @ <div class="cmdhelp">%s(zDest)</div>
          free(zDest);
          @ <hr/>additional information may be found in the web documentation:
          @ <a href="http://www.fossil-scm.org/fossil/doc/tip/www/cmd_%s(aCommand[idx].zName).wiki">
          @ cmd_%s(aCommand[idx].zName)</a>, 
        }
      }
      @ see also the list of
      @ <a href="help">available commands</a> in fossil
      @ version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }else{

      int nCol, nRow, i, ignored, cnt, showTest;
      
      /* detect, if we show normal or test commands */
      showTest = ( zCmd  && !strncmp(zCmd,"test",4) );
      for( i=0,ignored=0; i<count(aCommand); i++){
        if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) ignored++;
      }
      nCol = 4;
      nRow = (count(aCommand)-ignored+nCol-1)/nCol;
      @ <h1>Available commands</h1>
      @ <table class="browser"><tr><td class="browser"><ul class="browser">
      for( i=cnt=0; i<count(aCommand); i++ ){
        if( cnt==nRow ){
          @ </ul></td><td class="browser"><ul class="browser">
          cnt=0;
        }
        if( (strncmp(aCommand[i].zName,"test",4)==0) ^ showTest ) continue;
        @ <li><kbd><a href="help?cmd=%s(aCommand[i].zName)">
        @ %s(aCommand[i].zName)</a></kbd></li>
        cnt++;
      }
      @ </ul></td></tr></table>
      if( showTest ){
        @ <a href="help">show standard commands</a>
      }else{
        @ <a class="hidden" href="help?cmd=test">show test commands</a>
      }
      @ <hr/>fossil version %s(MANIFEST_VERSION" "MANIFEST_DATE) UTC
    }
    style_footer();
}

/*
................................................................................
**
**      #!/usr/bin/fossil
**      repository: /home/somebody/project.db
**
** The second line defines the name of the repository.  After locating
** the repository, fossil will generate a webpage on stdout based on
** the values of standard CGI environment variables.
**
** See also the <a>http</a>, <a>server</a> and <a>ui</a> commands.
*/
void cmd_cgi(void){
  const char *zFile;
  const char *zNotFound = 0;
  Blob config, line, key, value;
  if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
    zFile = g.argv[2];
................................................................................
** repository.
**
** If REPOSITORY is a directory that contains one or more respositories
** with names of the form "*.fossil" then the first element of the URL
** pathname selects among the various repositories.  If the pathname does
** not select a valid repository and the --notfound option is available,
** then the server redirects (HTTP code 302) to the URL of --notfound.
**
** See also the <a>cgi</a>, <a>server</a> and <a>ui</a> commands.
*/
void cmd_http(void){
  const char *zIpAddr;
  const char *zNotFound;
  zNotFound = find_option("notfound", 0, 1);
  g.cgiOutput = 1;
  if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){
................................................................................
** the web server.  The "ui" command also binds to 127.0.0.1 and so will
** only process HTTP traffic from the local machine.
**
** In the "server" command, the REPOSITORY can be a directory (aka folder)
** that contains one or more respositories with names ending in ".fossil".
** In that case, the first element of the URL is used to select among the
** various repositories.
**
** See also the <a>cgi</a> and <a>http</a> commands.
*/
void cmd_webserver(void){
  int iPort, mxPort;        /* Range of TCP ports allowed */
  const char *zPort;        /* Value of the --port option */
  char *zBrowser;           /* Name of web browser program */
  char *zBrowserCmd = 0;    /* Command to launch the web browser */
  int isUiCmd;              /* True if command is "ui", not "server' */

Changes to src/merge.c.

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
**
** Only file content is merged.  The result continues to use the
** file and directory names from the current checkout even if those
** names might have been changed in the branch being merged in.
**
** Other options:
**
**   --detail                Show additional details of the merge
**
**   --binary GLOBPATTERN    Treat files that match GLOBPATTERN as binary
**                           and do not try to merge parallel changes.  This
**                           option overrides the "binary-glob" setting.
*/
void merge_cmd(void){
  int vid;              /* Current version */
  int mid;              /* Version we are merging against */
  int pid;              /* The pivot version - most recent common ancestor */
  int detailFlag;       /* True if the --detail option is present */
  int pickFlag;         /* True if the --cherrypick option is present */






|

|
|
|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
**
** Only file content is merged.  The result continues to use the
** file and directory names from the current checkout even if those
** names might have been changed in the branch being merged in.
**
** Other options:
**
**   --detail             Show additional details of the merge
**
**   --binary GLOBPATTERN Treat files that match GLOBPATTERN as binary
**                        and do not try to merge parallel changes. This
**                        option overrides the "binary-glob" setting.
*/
void merge_cmd(void){
  int vid;              /* Current version */
  int mid;              /* Version we are merging against */
  int pid;              /* The pivot version - most recent common ancestor */
  int detailFlag;       /* True if the --detail option is present */
  int pickFlag;         /* True if the --cherrypick option is present */

Changes to src/rebuild.c.

377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
...
483
484
485
486
487
488
489

490
491
492
493
494
495
496
...
521
522
523
524
525
526
527
528

529
530
531
532
533

534
535


536
537
538
539
540
541
542
/*
** COMMAND: scrub
** %fossil scrub [--verily] [--force] [REPOSITORY]
**
** The command removes sensitive information (such as passwords) from a
** repository so that the respository can be sent to an untrusted reader.
**
** By default, only passwords are removed.  However, if the --verily option
** is added, then private branches, concealed email addresses, IP
** addresses of correspondents, and similar privacy-sensitive fields
** are also purged.
**
** This command permanently deletes the scrubbed information.  The effects
** of this command are irreversible.  Use with caution.
**
** The user is prompted to confirm the scrub unless the --force option
** is used.
................................................................................
** Usage: %fossil reconstruct FILENAME DIRECTORY
**
** This command studies the artifacts (files) in DIRECTORY and
** reconstructs the fossil record from them. It places the new
** fossil repository in FILENAME. Subdirectories are read, files
** with leading '.' in the filename are ignored.
**

*/
void reconstruct_cmd(void) {
  char *zPassword;
  if( g.argc!=4 ){
    usage("FILENAME DIRECTORY");
  }
  if( file_isdir(g.argv[3])!=1 ){
................................................................................
  zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
  printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);
}

/*
** COMMAND: deconstruct
**
** Usage %fossil deconstruct ?-R|--repository REPOSITORY? ?-L|--prefixlength N? DESTINATION

**
** This command exports all artifacts of o given repository and
** writes all artifacts to the file system. The DESTINATION directory
** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where
** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters.

** If -L|--prefixlength is given, the length (default 2) of the directory
** prefix can be set to 0,1,..,9 characters.


*/
void deconstruct_cmd(void){
  const char *zDestDir;
  const char *zPrefixOpt;
  Stmt        s;

  /* check number of arguments */






|
|
|







 







>







 







|
>

|
|
|
|
>


>
>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
...
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
...
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
/*
** COMMAND: scrub
** %fossil scrub [--verily] [--force] [REPOSITORY]
**
** The command removes sensitive information (such as passwords) from a
** repository so that the respository can be sent to an untrusted reader.
**
** By default, only passwords are removed.  However, if the --verily
** option is added, then private branches, concealed email addresses,
** IP addresses of correspondents, and similar privacy-sensitive fields
** are also purged.
**
** This command permanently deletes the scrubbed information.  The effects
** of this command are irreversible.  Use with caution.
**
** The user is prompted to confirm the scrub unless the --force option
** is used.
................................................................................
** Usage: %fossil reconstruct FILENAME DIRECTORY
**
** This command studies the artifacts (files) in DIRECTORY and
** reconstructs the fossil record from them. It places the new
** fossil repository in FILENAME. Subdirectories are read, files
** with leading '.' in the filename are ignored.
**
** See also the <a>deconstruct</a> command.
*/
void reconstruct_cmd(void) {
  char *zPassword;
  if( g.argc!=4 ){
    usage("FILENAME DIRECTORY");
  }
  if( file_isdir(g.argv[3])!=1 ){
................................................................................
  zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
  printf("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword);
}

/*
** COMMAND: deconstruct
**
** Usage: %fossil deconstruct ?-R|--repository REPOSITORY? \\
**                ?-L|--prefixlength N? DESTINATION
**
** This command exports all artifacts of o given repository and writes
** all artifacts to the file system. The DESTINATION directory will be
** populated with subdirectories AA and files AA/BBBBBBBBB.., where
** AABBBBBBBBB.. is the 40 character artifact ID and AA the first 2
** characters.
** If -L|--prefixlength is given, the length (default 2) of the directory
** prefix can be set to 0,1,..,9 characters.
**
** See also the <a>reconstruct</a> command.
*/
void deconstruct_cmd(void){
  const char *zDestDir;
  const char *zPrefixOpt;
  Stmt        s;

  /* check number of arguments */

Changes to src/report.c.

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  Th_Store("report_items", blob_str(&ril));
  
  Th_Render(zScript);
  
  blob_reset(&ril);
  if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);

  style_footer();
}

/*
** Remove whitespace from both ends of a string.
*/
char *trim_string(const char *zOrig){
  int i;






|







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  Th_Store("report_items", blob_str(&ril));
  
  Th_Render(zScript);
  
  blob_reset(&ril);
  if( g.thTrace ) Th_Trace("END_REPORTLIST<br />\n", -1);

  style_footer_cmdref("ticket",0);
}

/*
** Remove whitespace from both ends of a string.
*/
char *trim_string(const char *zOrig){
  int i;

Changes to src/setup.c.

215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
...
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
....
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
....
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
....
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
....
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
  @ privileges of <span class="usertype">developer</span>,
  @ <span class="usertype">anonymous</span>, and
  @ <span class="usertype">nobody</span>.
  @ </p></li>
  @
  @ </ol>
  @ </td></tr></table>
  style_footer();
}

/*
** Return true if zPw is a valid password string.  A valid
** password string is:
**
**  (1)  A zero-length string, or
................................................................................
  @ <span class="usertype">developer</span>
  @ user.  Similarly, the <span class="usertype">reader</span> user is a 
  @ template for users who are allowed more access than
  @ <span class="usertype">anonymous</span>,
  @ but less than a <span class="usertype">developer</span>.
  @ </p></li>
  @ </ul>
  style_footer();
}


/*
** Generate a checkbox for an attribute.
*/
static void onoff_attribute(
................................................................................
  @ The default CSS is shown below for reference.  Other examples
  @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_header">header</a> and
  @ <a href="setup_footer">footer</a> editing screens.
  @ <blockquote><pre>
  cgi_append_default_css();
  @ </pre></blockquote>
  style_footer();
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_header
*/
void setup_header(void){
................................................................................
  @ The default header is shown below for reference.  Other examples
  @ of headers can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_editcss">CSS</a> and
  @ <a href="setup_footer">footer</a> editing screeens.
  @ <blockquote><pre>
  @ %h(zDefaultHeader)
  @ </pre></blockquote>
  style_footer();
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_footer
*/
void setup_footer(void){
................................................................................
  @ The default footer is shown below for reference.  Other examples
  @ of footers can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_editcss">CSS</a> and
  @ <a href="setup_header">header</a> editing screens.
  @ <blockquote><pre>
  @ %h(zDefaultFooter)
  @ </pre></blockquote>
  style_footer();
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_logo
*/
void setup_logo(void){
................................................................................
  @ <input type="submit" name="clr" value="Revert To Default" />
  @ </div></form>
  @
  @ <p><span class="note">Note:</span>  Your browser has probably cached the
  @ logo image, so you will probably need to press the Reload button on your
  @ browser after changing the logo to provoke your browser to reload the new
  @ logo image. </p>
  style_footer();
  db_end_transaction(0);
}






|







 







|







 







|







 







|







 







|







 







|


215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
...
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
....
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
....
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
....
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
....
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
  @ privileges of <span class="usertype">developer</span>,
  @ <span class="usertype">anonymous</span>, and
  @ <span class="usertype">nobody</span>.
  @ </p></li>
  @
  @ </ol>
  @ </td></tr></table>
  style_footer_cmdref("user",0);
}

/*
** Return true if zPw is a valid password string.  A valid
** password string is:
**
**  (1)  A zero-length string, or
................................................................................
  @ <span class="usertype">developer</span>
  @ user.  Similarly, the <span class="usertype">reader</span> user is a 
  @ template for users who are allowed more access than
  @ <span class="usertype">anonymous</span>,
  @ but less than a <span class="usertype">developer</span>.
  @ </p></li>
  @ </ul>
  style_footer_cmdref("user",0);
}


/*
** Generate a checkbox for an attribute.
*/
static void onoff_attribute(
................................................................................
  @ The default CSS is shown below for reference.  Other examples
  @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_header">header</a> and
  @ <a href="setup_footer">footer</a> editing screens.
  @ <blockquote><pre>
  cgi_append_default_css();
  @ </pre></blockquote>
  style_footer_cmdref("configuration","area skin");
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_header
*/
void setup_header(void){
................................................................................
  @ The default header is shown below for reference.  Other examples
  @ of headers can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_editcss">CSS</a> and
  @ <a href="setup_footer">footer</a> editing screeens.
  @ <blockquote><pre>
  @ %h(zDefaultHeader)
  @ </pre></blockquote>
  style_footer_cmdref("configuration","area skin");
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_footer
*/
void setup_footer(void){
................................................................................
  @ The default footer is shown below for reference.  Other examples
  @ of footers can be seen on the <a href="setup_skin">skins page</a>.
  @ See also the <a href="setup_editcss">CSS</a> and
  @ <a href="setup_header">header</a> editing screens.
  @ <blockquote><pre>
  @ %h(zDefaultFooter)
  @ </pre></blockquote>
  style_footer_cmdref("configuration","area skin");
  db_end_transaction(0);
}

/*
** WEBPAGE: setup_logo
*/
void setup_logo(void){
................................................................................
  @ <input type="submit" name="clr" value="Revert To Default" />
  @ </div></form>
  @
  @ <p><span class="note">Note:</span>  Your browser has probably cached the
  @ logo image, so you will probably need to press the Reload button on your
  @ browser after changing the logo to provoke your browser to reload the new
  @ logo image. </p>
  style_footer_cmdref("configuration","area skin");
  db_end_transaction(0);
}

Changes to src/skins.c.

838
839
840
841
842
843
844
845
846
847
      @ <input type="submit" name="load" value="Use This Skin">
      @ <input type="submit" name="del1" value="Delete This Skin">
      @ </form></li>
    }
  }
  db_finalize(&q);
  @ </ol>
  style_footer();
  db_end_transaction(0);
}






|


838
839
840
841
842
843
844
845
846
847
      @ <input type="submit" name="load" value="Use This Skin">
      @ <input type="submit" name="del1" value="Delete This Skin">
      @ </form></li>
    }
  }
  db_finalize(&q);
  @ </ol>
  style_footer_cmdref("configuration","area skin");
  db_end_transaction(0);
}

Changes to src/style.c.

112
113
114
115
116
117
118

















119
120
121
122
123
124
125
...
237
238
239
240
241
242
243

244
245
246
247
248
249
250
...
728
729
730
731
732
733
734




















735
736
737
738
739
740
741
...
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
  if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
  Th_Unstore("title");   /* Avoid collisions with ticket field names */
  cgi_destination(CGI_BODY);
  g.cgiOutput = 1;
  headerHasBeenGenerated = 1;
  sideboxUsed = 0;
}


















/*
** Draw the footer at the bottom of the page.
*/
void style_footer(void){
  const char *zFooter;

................................................................................
@   html "<a href='$baseurl/setup_ulist'>Users</a> "
@ }
@ if {[info exists login]} {
@   html "<a href='$baseurl/login'>Logout</a> "
@ } else {
@   html "<a href='$baseurl/login'>Login</a> "
@ }

@ </th1></div>
;

/*
** The default page footer
*/
const char zDefaultFooter[] = 
................................................................................
    "format for artifact lines, no longer shunned",
    @   color: blue;
  },
  { "p.shunned",
    "format for artifact lines beeing shunned",
    @   color: blue;
  },




















  { 0,
    0,
    0
  }
};

/*
................................................................................
*/
void cgi_append_default_css(void) {
  int i;

  for (i=0;cssDefaultList[i].elementClass;i++){
    if (cssDefaultList[i].elementClass[0]){
      cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
		 cssDefaultList[i].comment,
		 cssDefaultList[i].elementClass,
		 cssDefaultList[i].value
		);
    }else{
      cgi_printf("%s",
		 cssDefaultList[i].value
		);
    }
  }
}

/*
** WEBPAGE: style.css
*/






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
|
|
|


|
|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
...
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
...
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
  if( g.thTrace ) Th_Trace("END_HEADER<br />\n", -1);
  Th_Unstore("title");   /* Avoid collisions with ticket field names */
  cgi_destination(CGI_BODY);
  g.cgiOutput = 1;
  headerHasBeenGenerated = 1;
  sideboxUsed = 0;
}

/*
** append a reference to command line to a web page
** and generate the footer
*/
void style_footer_cmdref( const char * const zCmd, const char * const zAddOn ){
  @ <div class="cmdref">
  if( zCmd ){
    @ See also command line help:
    @  <a href="help?cmd=%s(zCmd)">%s(zCmd)</a>
  }
  if( zAddOn ){
    @ %s(zAddOn)
  }
  @ </div>
  style_footer();
}

/*
** Draw the footer at the bottom of the page.
*/
void style_footer(void){
  const char *zFooter;

................................................................................
@   html "<a href='$baseurl/setup_ulist'>Users</a> "
@ }
@ if {[info exists login]} {
@   html "<a href='$baseurl/login'>Logout</a> "
@ } else {
@   html "<a href='$baseurl/login'>Login</a> "
@ }
@ html "<small><sup><a href='$baseurl/help'>?</a></sup></small>"
@ </th1></div>
;

/*
** The default page footer
*/
const char zDefaultFooter[] = 
................................................................................
    "format for artifact lines, no longer shunned",
    @   color: blue;
  },
  { "p.shunned",
    "format for artifact lines beeing shunned",
    @   color: blue;
  },
  { "a.hidden",
    "format for links, that should not be very visible",
    @   font-size: xx-small;
    @   color: #aaaaaa;
  },
  { "div.cmdhelp",
    "format for single command display on the gui help page",
    @   font-family: monospace;
    @   padding-left: 4em;
    @   padding-bottom: 1em;
    @   white-space: pre;
  },
  { "div.cmdref",
    "format for references to command line help entries the actual gui page."
    "set \"display\" to \"none\" to suppress the display",
    @   font-size: small;
    @   text-align: right;
    @   font-family: monospace;
    @   color: #777777;
  },
  { 0,
    0,
    0
  }
};

/*
................................................................................
*/
void cgi_append_default_css(void) {
  int i;

  for (i=0;cssDefaultList[i].elementClass;i++){
    if (cssDefaultList[i].elementClass[0]){
      cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
                 cssDefaultList[i].comment,
                 cssDefaultList[i].elementClass,
                 cssDefaultList[i].value
                );
    }else{
      cgi_printf("%s",
                 cssDefaultList[i].value
                );
    }
  }
}

/*
** WEBPAGE: style.css
*/

Changes to src/sync.c.

130
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146
147
148
149
150
151
...
154
155
156
157
158
159
160
161

162
163
164

165
166

167
168

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193
194

195
196

197
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
** Usage: %fossil pull ?URL? ?options?
**
** Pull changes from a remote repository into the local repository.
** Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If the URL is not specified, then the URL from the most recent
** clone, push, pull, remote-url, or sync command is used.

**
** The URL specified normally becomes the new "remote-url" used for
** subsequent push, pull, and sync operations.  However, the "--once"
** command-line option makes the URL a one-time-use URL that is not
** saved.
**
** See also: clone, push, sync, remote-url
*/
void pull_cmd(void){
  int syncFlags = process_sync_args();
  client_sync(0,1,0,syncFlags,0);
}

/*
................................................................................
** Usage: %fossil push ?URL? ?options?
**
** Push changes in the local repository over into a remote repository.
** Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If the URL is not specified, then the URL from the most recent
** clone, push, pull, remote-url, or sync command is used.

**
** The URL specified normally becomes the new "remote-url" used for
** subsequent push, pull, and sync operations.  However, the "--once"

** command-line option makes the URL a one-time-use URL that is not
** saved.

**
** See also: clone, pull, sync, remote-url

*/
void push_cmd(void){
  process_sync_args();
  client_sync(1,0,0,0,0);
}


/*
** COMMAND: sync
**
** Usage: %fossil sync ?URL? ?options?
**
** Synchronize the local repository with a remote repository.  This is
** the equivalent of running both "push" and "pull" at the same time.
** Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If a user-id and password are required, specify them as follows:
**
**     http://userid:password@www.domain.com:1234/path
**
** If the URL is not specified, then the URL from the most recent successful

** clone, push, pull, remote-url, or sync command is used.
**
** The URL specified normally becomes the new "remote-url" used for
** subsequent push, pull, and sync operations.  However, the "--once"

** command-line option makes the URL a one-time-use URL that is not
** saved.

**
** See also:  clone, push, pull, remote-url

*/
void sync_cmd(void){
  int syncFlags = process_sync_args();
  client_sync(1,1,0,syncFlags,0);
}

/*
** COMMAND: remote-url
**
** Usage: %fossil remote-url ?URL|off?
**
** Query and/or change the default server URL used by the "pull", "push",
** and "sync" commands.
**
** The remote-url is set automatically by a "clone" command or by any
** "sync", "push", or "pull" command that specifies an explicit URL.
** The default remote-url is used by auto-syncing and by "sync", "push",
** "pull" that omit the server URL.
**
** See also: clone, push, pull, sync
*/
void remote_url_cmd(void){
  char *zUrl;
  db_find_and_open_repository(1);
  if( g.argc!=2 && g.argc!=3 ){
    usage("remote-url ?URL|off?");
  }






|
>






|







 







|
>


<
>
|
<
>

<
>













|
|






|
>
|


<
>
|
<
>

<
>











|
|

|
|
|
|

|







130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
155
156
157
158
159
160
161
162
163
164
165

166
167

168
169

170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196

197
198

199
200

201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
** Usage: %fossil pull ?URL? ?options?
**
** Pull changes from a remote repository into the local repository.
** Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If the URL is not specified, then the URL from the most recent
** <a>clone</a>, <a>push</a>, <a>pull</a>, <a>remote-url</a>, or <a>sync</a> command
** is used.
**
** The URL specified normally becomes the new "remote-url" used for
** subsequent push, pull, and sync operations.  However, the "--once"
** command-line option makes the URL a one-time-use URL that is not
** saved.
**
** See also: <a>clone</a>, <a>push</a>, <a>sync</a>, <a>remote-url</a>
*/
void pull_cmd(void){
  int syncFlags = process_sync_args();
  client_sync(0,1,0,syncFlags,0);
}

/*
................................................................................
** Usage: %fossil push ?URL? ?options?
**
** Push changes in the local repository over into a remote repository.
** Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If the URL is not specified, then the URL from the most recent
** <a>clone</a>, <a>push</a>, <a>pull</a>, <a>remote-url</a>, or <a>sync</a> command
** is used.
**
** The URL specified normally becomes the new "remote-url" used for

** subsequent <a>push</a>, <a>pull</a>, and <a>sync</a> operations.  However,
** the "--once" command-line option makes the URL a one-time-use URL

** that is not saved.
**

** See also: <a>clone</a>, <a>pull</a>, <a>sync</a>, <a>remote-url</a>
*/
void push_cmd(void){
  process_sync_args();
  client_sync(1,0,0,0,0);
}


/*
** COMMAND: sync
**
** Usage: %fossil sync ?URL? ?options?
**
** Synchronize the local repository with a remote repository.  This is
** the equivalent of running both <a>push</a> and <a>pull</a> at the same
** time. Use the "-R REPO" or "--repository REPO" command-line options
** to specify an alternative repository file.
**
** If a user-id and password are required, specify them as follows:
**
**     http://userid:password@www.domain.com:1234/path
**
** If the URL is not specified, then the URL from the most recent
** successful <a>clone</a>, <a>push</a>, <a>pull</a>, <a>remote-url</a>, or <a>sync</a>
** command is used.
**
** The URL specified normally becomes the new "remote-url" used for

** subsequent <a>push</a>, <a>pull</a>, and <a>sync</a> operations.  However,
** the "--once" command-line option makes the URL a one-time-use URL

** that is not saved.
**

** See also:  <a>clone</a>, <a>push</a>, <a>pull</a>, <a>remote-url</a>
*/
void sync_cmd(void){
  int syncFlags = process_sync_args();
  client_sync(1,1,0,syncFlags,0);
}

/*
** COMMAND: remote-url
**
** Usage: %fossil remote-url ?URL|off?
**
** Query and/or change the default server URL used by the <a>pull</a>,
** <a>push</a>, and <a>sync</a> commands.
**
** The remote-url is set automatically by a <a>clone</a> command or by any
** <a>sync</a>, <a>push</a>, or <a>pull</a> command that specifies an explicit
** URL. The default remote-url is used by auto-syncing and by
** <a>sync</a>, <a>push</a>, <a>pull</a> that omit the server URL.
**
** See also: <a>clone</a>, <a>push</a>, <a>pull</a>, <a>sync</a>
*/
void remote_url_cmd(void){
  char *zUrl;
  db_find_and_open_repository(1);
  if( g.argc!=2 && g.argc!=3 ){
    usage("remote-url ?URL|off?");
  }

Changes to src/tag.c.

316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
...
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
**
** Run various subcommands to control tags and properties
**
**     %fossil tag add ?--raw? ?--propagate? TAGNAME CHECK-IN ?VALUE?
**
**         Add a new tag or property to CHECK-IN. The tag will
**         be usable instead of a CHECK-IN in commands such as
**         update and merge.  If the --propagate flag is present,
**         the tag value propages to all descendants of CHECK-IN
**
**     %fossil tag cancel ?--raw? TAGNAME CHECK-IN
**
**         Remove the tag TAGNAME from CHECK-IN, and also remove
**         the propagation of the tag to any descendants.
**
................................................................................
** not use this option to make changes unless you are sure what
** you are doing.
**
** If you need to use a tagname that might be confused with
** a hexadecimal baseline or artifact ID, you can explicitly
** disambiguate it by prefixing it with "tag:". For instance:
**
**   fossil update decaf
**
** will be taken as an artifact or baseline ID and fossil will
** probably complain that no such revision was found. However
**
**   fossil update tag:decaf
**
** will assume that "decaf" is a tag/branch name.
**
** only allow --date-override and --user-override in 
**   %fossil tag add --date-override 'YYYY-MMM-DD HH:MM:SS' \\
**                   --user-override user 
** in order to import history from other scm systems
................................................................................
      @ %h(zName)</a></li>
    }else{
      @ <li><span class="tagDsp">%h(zName)</span></li>
    }
  }
  @ </ul>
  db_finalize(&q);
  style_footer();
}

/*
** Draw the names of all tags added to check-in rid.  Only tags
** that are directly applied to rid are named.  Propagated tags
** are omitted.
*/






|







 







|




|







 







|







316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
...
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
**
** Run various subcommands to control tags and properties
**
**     %fossil tag add ?--raw? ?--propagate? TAGNAME CHECK-IN ?VALUE?
**
**         Add a new tag or property to CHECK-IN. The tag will
**         be usable instead of a CHECK-IN in commands such as
**         <a>update</a> and <a>merge</a>.  If the --propagate flag is present,
**         the tag value propages to all descendants of CHECK-IN
**
**     %fossil tag cancel ?--raw? TAGNAME CHECK-IN
**
**         Remove the tag TAGNAME from CHECK-IN, and also remove
**         the propagation of the tag to any descendants.
**
................................................................................
** not use this option to make changes unless you are sure what
** you are doing.
**
** If you need to use a tagname that might be confused with
** a hexadecimal baseline or artifact ID, you can explicitly
** disambiguate it by prefixing it with "tag:". For instance:
**
**   fossil <a>update</a> decaf
**
** will be taken as an artifact or baseline ID and fossil will
** probably complain that no such revision was found. However
**
**   fossil <a>update</a> tag:decaf
**
** will assume that "decaf" is a tag/branch name.
**
** only allow --date-override and --user-override in 
**   %fossil tag add --date-override 'YYYY-MMM-DD HH:MM:SS' \\
**                   --user-override user 
** in order to import history from other scm systems
................................................................................
      @ %h(zName)</a></li>
    }else{
      @ <li><span class="tagDsp">%h(zName)</span></li>
    }
  }
  @ </ul>
  db_finalize(&q);
  style_footer_cmdref("tag","list");
}

/*
** Draw the names of all tags added to check-in rid.  Only tags
** that are directly applied to rid are named.  Propagated tags
** are omitted.
*/

Changes to src/timeline.c.

950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
....
1089
1090
1091
1092
1093
1094
1095








1096
1097
1098
1099
1100
1101
1102
  }
  blob_zero(&sql);
  db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC /*scan*/");
  @ <h2>%b(&desc)</h2>
  blob_reset(&desc);
  www_print_timeline(&q, tmFlags, 0);
  db_finalize(&q);
  style_footer();
}

/*
** The input query q selects various records.  Print a human-readable
** summary of those records.
**
** Limit the number of entries printed to nLine.
................................................................................
**
** The optional TYPE argument may any types supported by the /timeline
** page. For example:
**
**     w  = wiki commits only
**     ci = file commits only
**     t  = tickets only








*/
void timeline_cmd(void){
  Stmt q;
  int n, k;
  const char *zCount;
  const char *zType;
  char *zOrigin;






|







 







>
>
>
>
>
>
>
>







950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
....
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
  }
  blob_zero(&sql);
  db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC /*scan*/");
  @ <h2>%b(&desc)</h2>
  blob_reset(&desc);
  www_print_timeline(&q, tmFlags, 0);
  db_finalize(&q);
  style_footer_cmdref("timeline",0);
}

/*
** The input query q selects various records.  Print a human-readable
** summary of those records.
**
** Limit the number of entries printed to nLine.
................................................................................
**
** The optional TYPE argument may any types supported by the /timeline
** page. For example:
**
**     w  = wiki commits only
**     ci = file commits only
**     t  = tickets only
**     e  = events only
**
** The information can also be used in the gui:
**  * go to the <a href="timeline">timeline</a> page
**  * or the "history" links on the dedicated details views(events,
**    files, tickets, ..)
**
** See also: <a>descendants</a>
*/
void timeline_cmd(void){
  Stmt q;
  int n, k;
  const char *zCount;
  const char *zType;
  char *zOrigin;

Changes to src/tkt.c.

361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
...
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
...
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
...
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
...
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
...
894
895
896
897
898
899
900



901
902
903
904
905
906
907
    }
    if( cnt ){
      @ </ul>
    }
    db_finalize(&q);
  }
 
  style_footer();
}

/*
** TH command:   append_field FIELD STRING
**
** FIELD is the name of a database column to which we might want
** to append text.  STRING is the text to be appended to that
................................................................................
  if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br />\n", -1);
  if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
    cgi_redirect(mprintf("%s/tktview/%s", g.zBaseURL, zNewUuid));
    return;
  }
  @ </form>
  if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1);
  style_footer();
}

/*
** WEBPAGE: tktedit
** WEBPAGE: debug_tktedit
**
** Edit a ticket.  The ticket is identified by the name CGI parameter.
................................................................................
  if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT_SCRIPT<br />\n", -1);
  if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zName ){
    cgi_redirect(mprintf("%s/tktview/%s", g.zBaseURL, zName));
    return;
  }
  @ </form>
  if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
  style_footer();
}

/*
** Check the ticket table schema in zSchema to see if it appears to
** be well-formed.  If everything is OK, return NULL.  If something is
** amiss, then return a pointer to a string (obtained from malloc) that
** describes the problem.
................................................................................
         timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
    );
  }
  db_prepare(&q, zSQL);
  free(zSQL);
  www_print_timeline(&q, TIMELINE_ARTID, 0);
  db_finalize(&q);
  style_footer();
}

/*
** WEBPAGE: tkthistory
** URL: /tkthistory?name=TICKETUUID
**
** Show the complete change history for a single ticket
................................................................................
        @ </p>
        ticket_output_change_artifact(&m);
      }
      manifest_clear(&m);
    }
  }
  db_finalize(&q);
  style_footer();
}

/*
** Return TRUE if the given BLOB contains a newline character.
*/
static int contains_newline(Blob *p){
  const char *z = blob_str(p);
................................................................................
**
**     %fossil ticket add FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote?
**
**         like set, but create a new ticket with the given values.
**
** The values in set|add are not validated against the definitions
** given in "Ticket Common Script".



*/
void ticket_cmd(void){
  int n;

  /* do some ints, we want to be inside a checkout */
  db_must_be_within_tree();
  db_find_and_open_repository(1);






|







 







|







 







|







 







|







 







|







 







>
>
>







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
...
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
...
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
...
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
...
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
...
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
    }
    if( cnt ){
      @ </ul>
    }
    db_finalize(&q);
  }
 
  style_footer_cmdref("info",0);
}

/*
** TH command:   append_field FIELD STRING
**
** FIELD is the name of a database column to which we might want
** to append text.  STRING is the text to be appended to that
................................................................................
  if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br />\n", -1);
  if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
    cgi_redirect(mprintf("%s/tktview/%s", g.zBaseURL, zNewUuid));
    return;
  }
  @ </form>
  if( g.thTrace ) Th_Trace("END_TKTVIEW<br />\n", -1);
  style_footer_cmdref("ticket","add");
}

/*
** WEBPAGE: tktedit
** WEBPAGE: debug_tktedit
**
** Edit a ticket.  The ticket is identified by the name CGI parameter.
................................................................................
  if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT_SCRIPT<br />\n", -1);
  if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zName ){
    cgi_redirect(mprintf("%s/tktview/%s", g.zBaseURL, zName));
    return;
  }
  @ </form>
  if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
  style_footer_cmdref("ticket","change");
}

/*
** Check the ticket table schema in zSchema to see if it appears to
** be well-formed.  If everything is OK, return NULL.  If something is
** amiss, then return a pointer to a string (obtained from malloc) that
** describes the problem.
................................................................................
         timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
    );
  }
  db_prepare(&q, zSQL);
  free(zSQL);
  www_print_timeline(&q, TIMELINE_ARTID, 0);
  db_finalize(&q);
  style_footer_cmdref("timeline",0);
}

/*
** WEBPAGE: tkthistory
** URL: /tkthistory?name=TICKETUUID
**
** Show the complete change history for a single ticket
................................................................................
        @ </p>
        ticket_output_change_artifact(&m);
      }
      manifest_clear(&m);
    }
  }
  db_finalize(&q);
  style_footer_cmdref("timeline",0);
}

/*
** Return TRUE if the given BLOB contains a newline character.
*/
static int contains_newline(Blob *p){
  const char *z = blob_str(p);
................................................................................
**
**     %fossil ticket add FIELD VALUE ?FIELD VALUE .. ? ?-q|--quote?
**
**         like set, but create a new ticket with the given values.
**
** The values in set|add are not validated against the definitions
** given in "Ticket Common Script".
**
** All this stuff can also be done in the gui:
**  * Go the the <a href="reportlist">Tickets</a> page
*/
void ticket_cmd(void){
  int n;

  /* do some ints, we want to be inside a checkout */
  db_must_be_within_tree();
  db_find_and_open_repository(1);

Changes to src/undo.c.

242
243
244
245
246
247
248
249
250
251

252
253
254

255
256
257
258
259
260
261
...
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
}

/*
** COMMAND: undo
**
** Usage: %fossil undo ?FILENAME...?
**
** Undo the most recent update or merge or revert operation.  If FILENAME is
** specified then restore the content of the named file(s) but otherwise
** leave the update or merge or revert in effect.

**
** A single level of undo/redo is supported.  The undo/redo stack
** is cleared by the commit and checkout commands.

*/
void undo_cmd(void){
  int undo_available;
  db_must_be_within_tree();
  db_begin_transaction();
  undo_available = db_lget_int("undo_available", 0);
  if( g.argc==2 ){
................................................................................
}

/*
** COMMAND: redo
**
** Usage: %fossil redo ?FILENAME...?
**
** Redo an update or merge or revert operation that has been undone
** by the undo command.  If FILENAME is specified then restore the changes
** associated with the named file(s) but otherwise leave the update
** or merge undone.
**
** A single level of undo/redo is supported.  The undo/redo stack
** is cleared by the commit and checkout commands.
*/
void redo_cmd(void){
  int undo_available;
  db_must_be_within_tree();
  db_begin_transaction();
  undo_available = db_lget_int("undo_available", 0);
  if( g.argc==2 ){






|
|
|
>

<
|
>







 







|
|
|
|

|
|







242
243
244
245
246
247
248
249
250
251
252
253

254
255
256
257
258
259
260
261
262
...
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
}

/*
** COMMAND: undo
**
** Usage: %fossil undo ?FILENAME...?
**
** Undo the most recent <a>update</a> or <a>merge</a> or <a>revert</a> operation.
** If FILENAME is specified then restore the content of the named
** file(s) but otherwise leave the <a>update</a>, <a>merge</a> or <a>revert</a>
** in effect.
**

** A single level of <a>undo</a>/<a>redo</a> is supported. The undo/<a>redo</a>
** stack is cleared by the <a>commit</a> and <a>checkout</a> commands.
*/
void undo_cmd(void){
  int undo_available;
  db_must_be_within_tree();
  db_begin_transaction();
  undo_available = db_lget_int("undo_available", 0);
  if( g.argc==2 ){
................................................................................
}

/*
** COMMAND: redo
**
** Usage: %fossil redo ?FILENAME...?
**
** Redo an <a>update</a>, <a>merge</a> or <a>revert</a> operation that has been
** undone by the <a>undo</a> command. If FILENAME is specified then restore
** the changes associated with the named file(s) but otherwise leave the
** update or merge undone.
**
** A single level of <a>undo</a>/<a>redo</a> is supported.  The <a>undo</a>/<a>redo</a>
** stack is cleared by the <a>commit</a> and <a>checkout</a> commands.
*/
void redo_cmd(void){
  int undo_available;
  db_must_be_within_tree();
  db_begin_transaction();
  undo_available = db_lget_int("undo_available", 0);
  if( g.argc==2 ){

Changes to src/update.c.

346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
** Revert to the current repository version of FILE, or to
** the version associated with baseline REVISION if the -r flag
** appears.
**
** Revert all files if no file name is provided.
**
** If a file is reverted accidently, it can be restored using
** the "fossil undo" command.
*/
void revert_cmd(void){
  const char *zFile;
  const char *zRevision;
  Blob record;
  int i;
  int errCode;






|







346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
** Revert to the current repository version of FILE, or to
** the version associated with baseline REVISION if the -r flag
** appears.
**
** Revert all files if no file name is provided.
**
** If a file is reverted accidently, it can be restored using
** the <a>undo</a> command.
*/
void revert_cmd(void){
  const char *zFile;
  const char *zRevision;
  Blob record;
  int i;
  int errCode;

Changes to src/user.c.

169
170
171
172
173
174
175






176
177
178
179
180
181
182
**        Create a new user in the repository.  Users can never be
**        deleted.  They can be denied all access but they must continue
**        to exist in the database.
**
**    %fossil user password USERNAME ?PASSWORD?
**
**        Change the web access password for a user.






*/
void user_cmd(void){
  int n;
  db_find_and_open_repository(1);
  if( g.argc<3 ){
    usage("capabilities|default|list|new|password ...");
  }






>
>
>
>
>
>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
**        Create a new user in the repository.  Users can never be
**        deleted.  They can be denied all access but they must continue
**        to exist in the database.
**
**    %fossil user password USERNAME ?PASSWORD?
**
**        Change the web access password for a user.
**        Users can change their own password on the
**        <a href="login">Login/Logout</a> gui page.
**
** Administrators can also use the gui: 
**  *  Go to page <a href="setup">Admin</a>
**  ** and click <a href="setup_ulist">Users</a>
*/
void user_cmd(void){
  int n;
  db_find_and_open_repository(1);
  if( g.argc<3 ){
    usage("capabilities|default|list|new|password ...");
  }

Changes to src/wiki.c.

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
...
250
251
252
253
254
255
256




257
258
259
260
261
262
263
...
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
...
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
...
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
...
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
...
897
898
899
900
901
902
903



904
905
906
907
908
909
910
    @ <li> <a href="%s(g.zBaseURL)/wcontent">List of All Wiki Pages</a>
    @      available on this server.</li>
    @ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
    @     Search wiki titles: <input type="text" name="title"/>
    @  &nbsp; <input type="submit" /></div></form>
    @ </li>
    @ </ul>
    style_footer();
    return;
  }
  if( check_name(zPageName) ) return;
  isSandbox = is_sandbox(zPageName);
  if( isSandbox ){
    zBody = db_get("sandbox",zBody);
  }else{
................................................................................
    @ </ul>
  }
  db_finalize(&q);
 
  if( !isSandbox ){
    manifest_clear(&m);
  }




  style_footer();
}

/*
** WEBPAGE: wikiedit
** URL: /wikiedit?name=PAGENAME
*/
................................................................................
  @ <input type="submit" name="preview" value="Preview Your Changes" />
  @ <input type="submit" name="submit" value="Apply These Changes" />
  @ <input type="submit" name="cancel" value="Cancel" />
  @ </div></form>
  if( !isSandbox ){
    manifest_clear(&m);
  }
  style_footer();
}

/*
** WEBPAGE: wikinew
** URL /wikinew
**
** Prompt the user to enter the name of a new wiki page.  Then redirect
................................................................................
  @ <input style="width: 35;" type="text" name="name" value="%h(zName)" />
  @ <input type="submit" value="Create" />
  @ </p></form>
  if( zName[0] ){
    @ <p><span class="wikiError">
    @ "%h(zName)" is not a valid wiki page name!</span></p>
  }
  style_footer();
}


/*
** Append the wiki text for an remark to the end of the given BLOB.
*/
static void appendRemark(Blob *p){
................................................................................
                 "ORDER BY mtime DESC",
                 timeline_query_for_www(), zPageName, zPageName);
  db_prepare(&q, zSQL);
  free(zSQL);
  zWikiPageName = zPageName;
  www_print_timeline(&q, TIMELINE_ARTID, wiki_history_extra);
  db_finalize(&q);
  style_footer();
}

/*
** WEBPAGE: wdiff
** URL: /whistory?name=PAGENAME&a=RID1&b=RID2
**
** Show the difference between two wiki pages.
................................................................................
      @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)">%h(zName)</a></li>
    }else if( showAll ){
      @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
    }
  }
  db_finalize(&q);
  @ </ul>
  style_footer();
}

/*
** WEBPAGE: wfind
**
** URL: /wfind?title=TITLE
** List all wiki pages whose titles contain the search text
................................................................................
**        Lists the artifact ID and/or Date of last change along with
**        each entry name, delimited by the -s char.
**
**     %fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName
**
**        Diffs the local copy of a page with a given version (defaulting
**        to the head version).



*/
void wiki_cmd(void){
  int n;
  db_find_and_open_repository(1);
  if( g.argc<3 ){
    goto wiki_cmd_usage;
  }






|







 







>
>
>
>







 







|







 







|







 







|







 







|







 







>
>
>







162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
...
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
...
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
...
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
...
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
...
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
    @ <li> <a href="%s(g.zBaseURL)/wcontent">List of All Wiki Pages</a>
    @      available on this server.</li>
    @ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
    @     Search wiki titles: <input type="text" name="title"/>
    @  &nbsp; <input type="submit" /></div></form>
    @ </li>
    @ </ul>
    style_footer_cmdref("wiki",0);
    return;
  }
  if( check_name(zPageName) ) return;
  isSandbox = is_sandbox(zPageName);
  if( isSandbox ){
    zBody = db_get("sandbox",zBody);
  }else{
................................................................................
    @ </ul>
  }
  db_finalize(&q);
 
  if( !isSandbox ){
    manifest_clear(&m);
  }
  /* don'tshow the help cross reference, because we are rendering
  ** the wiki conten!
  ** style_footer_cmdref("wiki","export");
  */
  style_footer();
}

/*
** WEBPAGE: wikiedit
** URL: /wikiedit?name=PAGENAME
*/
................................................................................
  @ <input type="submit" name="preview" value="Preview Your Changes" />
  @ <input type="submit" name="submit" value="Apply These Changes" />
  @ <input type="submit" name="cancel" value="Cancel" />
  @ </div></form>
  if( !isSandbox ){
    manifest_clear(&m);
  }
  style_footer_cmdref("wiki"," / <a href=\"wiki_rules\">wiki format</a>");
}

/*
** WEBPAGE: wikinew
** URL /wikinew
**
** Prompt the user to enter the name of a new wiki page.  Then redirect
................................................................................
  @ <input style="width: 35;" type="text" name="name" value="%h(zName)" />
  @ <input type="submit" value="Create" />
  @ </p></form>
  if( zName[0] ){
    @ <p><span class="wikiError">
    @ "%h(zName)" is not a valid wiki page name!</span></p>
  }
  style_footer_cmdref("wiki","create");
}


/*
** Append the wiki text for an remark to the end of the given BLOB.
*/
static void appendRemark(Blob *p){
................................................................................
                 "ORDER BY mtime DESC",
                 timeline_query_for_www(), zPageName, zPageName);
  db_prepare(&q, zSQL);
  free(zSQL);
  zWikiPageName = zPageName;
  www_print_timeline(&q, TIMELINE_ARTID, wiki_history_extra);
  db_finalize(&q);
  style_footer_cmdref("timeline",0);
}

/*
** WEBPAGE: wdiff
** URL: /whistory?name=PAGENAME&a=RID1&b=RID2
**
** Show the difference between two wiki pages.
................................................................................
      @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)">%h(zName)</a></li>
    }else if( showAll ){
      @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
    }
  }
  db_finalize(&q);
  @ </ul>
  style_footer_cmdref("wiki","list");
}

/*
** WEBPAGE: wfind
**
** URL: /wfind?title=TITLE
** List all wiki pages whose titles contain the search text
................................................................................
**        Lists the artifact ID and/or Date of last change along with
**        each entry name, delimited by the -s char.
**
**     %fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName
**
**        Diffs the local copy of a page with a given version (defaulting
**        to the head version).
**
** The wiki format is explained on the <a href="wiki">Wiki</a> subpage
** <a href="wiki_rules">Formatting rules</a>.
*/
void wiki_cmd(void){
  int n;
  db_find_and_open_repository(1);
  if( g.argc<3 ){
    goto wiki_cmd_usage;
  }

Changes to src/winhttp.c.

87
88
89
90
91
92
93



94
95
96
97
98
99
100
...
107
108
109
110
111
112
113



114
115
116



117
118
119




120
121
122
123
124
125
126
...
210
211
212
213
214
215
216



217
218
219
220
221
222
223
    zHdr[amt] = 0;
    z = strstr(zHdr, "\r\n\r\n");
    if( z ){
      wanted = find_content_length(zHdr) + (&z[4]-zHdr) - amt;
      break;
    }
  }



  if( amt>=sizeof(zHdr) ) goto end_request;
  out = fopen(zRequestFName, "wb");
  if( out==0 ) goto end_request;
  fwrite(zHdr, 1, amt, out);
  while( wanted>0 ){
    got = recv(p->s, zHdr, sizeof(zHdr), 0);
    if( got==SOCKET_ERROR ) goto end_request;
................................................................................
  }
  fclose(out);
  out = 0;
  sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s",
    _pgmptr, g.zRepositoryName, zRequestFName, zReplyFName, 
    inet_ntoa(p->addr.sin_addr), p->zNotFound
  );



  portable_system(zCmd);
  in = fopen(zReplyFName, "rb");
  if( in ){



    while( (got = fread(zHdr, 1, sizeof(zHdr), in))>0 ){
      send(p->s, zHdr, got, 0);
    }




  }

end_request:
  if( out ) fclose(out);
  if( in ) fclose(in);
  closesocket(p->s);
  unlink(zRequestFName);
................................................................................
      fossil_fatal("error from accept()");
    }
    p = fossil_malloc( sizeof(*p) );
    p->id = ++idCnt;
    p->s = client;
    p->addr = client_addr;
    p->zNotFound = zNotFoundOption;



    _beginthread(win32_process_one_http_request, 0, (void*)p);
  }
  closesocket(s);
  WSACleanup();
}

#endif /* _WIN32  -- This code is for win32 only */






>
>
>







 







>
>
>



>
>
>



>
>
>
>







 







>
>
>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
    zHdr[amt] = 0;
    z = strstr(zHdr, "\r\n\r\n");
    if( z ){
      wanted = find_content_length(zHdr) + (&z[4]-zHdr) - amt;
      break;
    }
  }
  if( g.fHttpTrace ){
    fprintf(stderr,"HTTPTRACE(%p): got header '%s'\n",pAppData,zHdr);
  }
  if( amt>=sizeof(zHdr) ) goto end_request;
  out = fopen(zRequestFName, "wb");
  if( out==0 ) goto end_request;
  fwrite(zHdr, 1, amt, out);
  while( wanted>0 ){
    got = recv(p->s, zHdr, sizeof(zHdr), 0);
    if( got==SOCKET_ERROR ) goto end_request;
................................................................................
  }
  fclose(out);
  out = 0;
  sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s",
    _pgmptr, g.zRepositoryName, zRequestFName, zReplyFName, 
    inet_ntoa(p->addr.sin_addr), p->zNotFound
  );
  if( g.fHttpTrace ){
    fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
  }
  portable_system(zCmd);
  in = fopen(zReplyFName, "rb");
  if( in ){
    if( g.fHttpTrace ){
      fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
    }
    while( (got = fread(zHdr, 1, sizeof(zHdr), in))>0 ){
      send(p->s, zHdr, got, 0);
    }
  }else{
    if( g.fHttpTrace ){
      fprintf(stderr,"HTTPTRACE(%p): no reply '%s'\n",pAppData,zReplyFName);
    }
  }

end_request:
  if( out ) fclose(out);
  if( in ) fclose(in);
  closesocket(p->s);
  unlink(zRequestFName);
................................................................................
      fossil_fatal("error from accept()");
    }
    p = fossil_malloc( sizeof(*p) );
    p->id = ++idCnt;
    p->s = client;
    p->addr = client_addr;
    p->zNotFound = zNotFoundOption;
    if( g.fHttpTrace ){
      fprintf(stderr,"HTTPTRACE(%p): start new request thread\n",p);
    }
    _beginthread(win32_process_one_http_request, 0, (void*)p);
  }
  closesocket(s);
  WSACleanup();
}

#endif /* _WIN32  -- This code is for win32 only */

Changes to src/zip.c.

374
375
376
377
378
379
380
381
382
383
384
385



386
387
388
389
390
391
392
}

/*
** COMMAND: zip
**
** Usage: %fossil zip VERSION OUTPUTFILE [--name DIRECTORYNAME]
**
** Generate a ZIP archive for a specified version.  If the --name option is
** used, it argument becomes the name of the top-level directory in the
** resulting ZIP archive.  If --name is omitted, the top-level directory
** named is derived from the project name, the check-in date and time, and
** the artifact ID of the check-in.



*/
void baseline_zip_cmd(void){
  int rid;
  Blob zip;
  const char *zName;
  zName = find_option("name", 0, 1);
  db_find_and_open_repository(1);






|
|



>
>
>







374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
}

/*
** COMMAND: zip
**
** Usage: %fossil zip VERSION OUTPUTFILE [--name DIRECTORYNAME]
**
** Generate a ZIP archive for a specified version.  If the --name option
** is used, it argument becomes the name of the top-level directory in the
** resulting ZIP archive.  If --name is omitted, the top-level directory
** named is derived from the project name, the check-in date and time, and
** the artifact ID of the check-in.
**
** The zip download can also be done through the Check-in detail view,
** accessible from the <a href="timeline">timeline</a> page.
*/
void baseline_zip_cmd(void){
  int rid;
  Blob zip;
  const char *zName;
  zName = find_option("name", 0, 1);
  db_find_and_open_repository(1);

Changes to win/Makefile.PellesCGMake.

55
56
57
58
59
60
61

62
63
64
65
66
67
68
69
70
# define linker command and options
LINK=$(PellesCDir)/bin/polink.exe
LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib

# define standard C-compiler and flags, used to compile
# the fossil binary. Some special definitions follow for
# special files follow

CC=$(PellesCDir)\bin\pocc.exe
DEFINES=-DFOSSIL_I18N=0 -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp 
CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES)
INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR)

# define commands for building the windows resource files
RESOURCE=fossil.res
RC=$(PellesCDir)\bin\porc.exe
RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION)






>

|







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# define linker command and options
LINK=$(PellesCDir)/bin/polink.exe
LINKFLAGS=-subsystem:console -machine:$(TARGETMACHINE_LN) /LIBPATH:$(PellesCDir)\lib\win$(TARGETEXTEND) /LIBPATH:$(PellesCDir)\lib kernel32.lib advapi32.lib delayimp$(TARGETEXTEND).lib Wsock32.lib Crtmt$(TARGETEXTEND).lib

# define standard C-compiler and flags, used to compile
# the fossil binary. Some special definitions follow for
# special files follow
# Pelles C doesn't support _pgmptr in it's includes/libs, so map it to argv[0]
CC=$(PellesCDir)\bin\pocc.exe
DEFINES=-DFOSSIL_I18N=0 -Dstrncasecmp=memicmp -Dstrcasecmp=stricmp -D_pgmptr=g.argv[0]
CCFLAGS=-T$(TARGETMACHINE_CC)-coff -Ot -W2 -Gd -Go -Ze -MT $(DEFINES)
INCLUDE=/I $(PellesCDir)\Include\Win /I $(PellesCDir)\Include /I $(ZLIBSRCDIR) /I $(SRCDIR)

# define commands for building the windows resource files
RESOURCE=fossil.res
RC=$(PellesCDir)\bin\porc.exe
RCFLAGS=$(INCLUDE) -D__POCC__=1 -D_M_X$(TARGETVERSION)

Changes to www/index.wiki.

121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
     [http://www.mail-archive.com/fossil-users@lists.fossil-scm.org | archives]
     available for discussing fossil issues.
  *  [./stats.wiki | Performance statistics] taken from real-world projects
     hosted on fossil.
  *  How to [./shunning.wiki | delete content] from a fossil repository.
  *  How Fossil does [./password.wiki | password management].
  *  Some (unfinished but expanding) extended
      [./reference.wiki | reference documentation] for the fossil command line.

  *  Documentation on the
     [http://www.sqliteconcepts.org/THManual.pdf | TH1 Script Language] used
     to configure the ticketing subsystem.
  *  A free hosting server for Fossil repositories is available at
     [http://chiselapp.com/].
  *  How to [./server.wiki | set up a server] for your repository.
  *  Customizing the [./custom_ticket.wiki | ticket system].






|
>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
     [http://www.mail-archive.com/fossil-users@lists.fossil-scm.org | archives]
     available for discussing fossil issues.
  *  [./stats.wiki | Performance statistics] taken from real-world projects
     hosted on fossil.
  *  How to [./shunning.wiki | delete content] from a fossil repository.
  *  How Fossil does [./password.wiki | password management].
  *  Some (unfinished but expanding) extended
      [./reference.wiki | reference documentation] for the fossil
       [/help|command line].
  *  Documentation on the
     [http://www.sqliteconcepts.org/THManual.pdf | TH1 Script Language] used
     to configure the ticketing subsystem.
  *  A free hosting server for Fossil repositories is available at
     [http://chiselapp.com/].
  *  How to [./server.wiki | set up a server] for your repository.
  *  Customizing the [./custom_ticket.wiki | ticket system].

Changes to www/reference.wiki.

48
49
50
51
52
53
54
55


56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219

220
221
222
223
224
225
226




227
228
229
230





231
232
233
234
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
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
311
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477

478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
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
693
694
695
696
697
698
699
700
701
702







    guaranteed and fast access to the sources & docs (your cloned fossil
    repository).
<br /><br /> <br />
  <b>You should</b> probably start interacting with fossil at the command
  line by asking it what it can
  do:&nbsp;&nbsp;&nbsp;&nbsp;<a name="tof">&#710;</a>

  <code>$ fossil help</code><nowiki><pre>


Usage: fossil help COMMAND.
Available COMMANDs:</pre><table width="80%"
                          style="font-family: fixed, courier, monospace;">
  <tr>
    <td><a href="#add">add</a>*</td>
    <td><a href="#checkout">co</a>*</td>
    <td><a href="#http">http</a></td>
    <td><a href="#rebuild">rebuild</a></td>
    <td><a href="#sync">sync</a>*</td>
  </tr>
  <tr>
    <td><a href="#all">all</a>*</td>
    <td><a href="#commit">commit</a></td>
    <td><a href="#info">info</a></td>
    <td><a href="#reconstruct">reconstruct</a></td>
    <td><a href="#tag">tag</a></td>
  </tr>
  <tr>
    <td><a href="#branch">branch</a></td>
    <td><a href="#configuration">configuration</a></td>
    <td><a href="#leaves">leaves</a></td>
    <td><a href="#redo">redo</a></td>
    <td><a href="#timeline">timeline</a></td>
  </tr>
  <tr>
    <td><a href="#cgi">cgi</a>*</td>
    <td><a href="#deconstruct">deconstruct</a></td>
    <td><a href="#ls">ls</a>*</td>
    <td><a href="#mv">rename</a>*</td>
    <td><a href="#server">ui</a></td>
  </tr>
  <tr>
    <td><a href="#changes">changes</a>*</td>
    <td><a href="#rm">del</a>*</td>
    <td><a href="#merge">merge</a></td>
    <td><a href="#revert">revert</a></td>
    <td><a href="#undo">undo</a></td>
  </tr>
  <tr>
    <td><a href="#checkout">checkout</a>*</td>
    <td><a href="#descendants">descendants</a></td>
    <td><a href="#mv">mv</a>*</td>
    <td><a href="#rm">rm</a>*</td>
    <td><a href="#setting">unset</a></td>
  </tr>
  <tr>
    <td><a href="#commit">ci</a></td>
    <td><a href="#diff">diff</a></td>
    <td><a href="#new">new</a>*</td>
    <td><a href="#rstats">rstats</a></td>
    <td><a href="#update">update</a>*</td>
  </tr>
  <tr>
    <td><a href="#clean">clean</a></td>
    <td><a href="#extra">extra</a>*</td>
    <td><a href="#open">open</a></td>
    <td><a href="#server">server</a></td>
    <td><a href="#user">user</a></td>
  </tr>
  <tr>
    <td><a href="#clone">clone</a></td>
    <td><a href="#diff">gdiff</a></td>
    <td><a href="#pull">pull</a></td>
    <td><a href="#setting">settings</a></td>
    <td><a href="#version">version</a>*</td>
  </tr>
  <tr>
    <td><a href="#close">close</a></td>
    <td><a href="#help">help</a></td>
    <td><a href="#push">push</a></td>
    <td><a href="#status">status</a>*</td>
    <td><a href="#wiki">wiki</a></td>
  </tr>
</table><nowiki><pre>
This is fossil version [a89b436bc9] 2009-02-11 05:00:02 UTC
</pre>
<b>What follows</b> is a survey of what you get if you type<code>
fossil&nbsp;help&nbsp;<i>command</i> </code>for all of the
commands listed above.  There are links to individual pages for each
of them; pages with content (commands marked with a '*' are done) go
into the reason for a command in a bit more depth than the program help.
<pre>
<hr><a href="#tof">&#710;</a>
    <a name="add">Usage: </a><code><a href="cmd_add.wiki">fossil add</a></code> FILE...
    Make arrangements to add one or more files to the current checkout
    at the next commit.

<hr><a href="#tof">&#710;</a>
    <a name="all">Usage: </a><code><a href="cmd_all.wiki">fossil all</a></code> (list|pull|push|rebuild|sync)
    The ~/.fossil file records the location of all repositories for a
    user.  This command performs certain operations on all repositories
    that can be useful before or after a period of disconnection operation.

    On Win32 systems, this file is located in %LOCALAPPDATA%, %APDDATA%
    or %HOMEPATH% and is named _fossil.




    Available operations are:

    list       Display the location of all repositories

    pull       Run a "pull" operation on all repositories

    push       Run a "push" on all repositories

    rebuild    Rebuild on all repositories

    sync       Run a "sync" on all repositories

    Respositories are automatically added to the set of known repositories
    when one of the following commands against the repository: clone, info,
    pull, push, or sync

<hr><a href="#tof">&#710;</a>
    <a name="branch">Usage: </a><code><a href="cmd_branch.wiki">fossil branch</a></code> SUBCOMMAND ... ?-R|--repository FILE?

Run various subcommands on the branches of the open repository or
of the repository identified by the -R or --repository option.

   fossil branch new BRANCH-NAME BASIS ?-bgcolor COLOR?

       Create a new branch BRANCH-NAME off of check-in BASIS.
       You can optionally give the branch a default color.

   fossil branch list

       List all branches

<hr><a href="#tof">&#710;</a>
    <a name="cgi">Usage: </a><a href="cmd_cgi.wiki">fossil cgi</a> SCRIPT
    The SCRIPT argument is the name of a file that is the CGI script
    that is being run.  The command name, "cgi", may be omitted if
    the GATEWAY_INTERFACE environment variable is set to "CGI" (which
    should always be the case for CGI scripts run by a webserver.)  The
    SCRIPT file should look something like this:

    #!/usr/bin/fossil
    repository: /home/somebody/project.db

    The second line defines the name of the repository.  After locating
    the repository, fossil will generate a webpage on stdout based on
    the values of standard CGI environment variables.

<hr><a href="#tof">&#710;</a>
    <a name="changes">Usage: </a><a href="cmd_changes.wiki">fossil changes</a>
    Report on the edit status of all files in the current checkout.
    See also the "status" and "extra" commands.

<hr><a href="#tof">&#710;</a>
    <a name="checkout">Usage: </a><a href="cmd_checkout.wiki">fossil checkout</a> VERSION ?-f|--force?
    Check out a version specified on the command-line.  This command
    will not overwrite edited files in the current checkout unless
    the --force option appears on the command-line.

    See also the "update" command.

<hr><a href="#tof">&#710;</a>
    <a name="commit">Usage: </a><a href="cmd_commit.wiki">fossil commit</a> ?-m COMMENT? ?--nosign? ?FILE...?    fossil ci  ...  (as above)

    Create a new version containing all of the changes in the current
    checkout.  You will be prompted to enter a check-in comment unless
    the "-m" option is used to specify a comment line.  You will be
    prompted for your GPG passphrase in order to sign the new manifest
    unless the "--nosign" option is used.  All files that have
    changed will be committed unless some subset of files is specified

    on the command line.

<hr><a href="#tof">&#710;</a>
    <a name="clean">Usage: </a><a href="cmd_clean.wiki">fossil clean</a> ?-all?
    Delete all "extra" files in the source tree.  "Extra" files are
    files that are not officially part of the checkout.  See also
    the "extra" command. This operation cannot be undone.





    You will be prompted before removing each file. If you are
    sure you wish to remove all "extra" files you can specify the
    optional -all flag.






<hr><a href="#tof">&#710;</a>
    <a name="clone">Usage: </a><a href="cmd_clone.wiki">fossil clone</a> URL FILENAME
    Make a clone of a repository specified by URL in the local
    file named FILENAME.

<hr><a href="#tof">&#710;</a>
    <a name="close">Usage: </a><a href="cmd_close.wiki">fossil close</a> ?-f|--force?
    The opposite of "open".  Close the current database connection.
    Require a -f or --force flag if there are unsaved changed in the
    current check-out.

<hr><a href="#tof">&#710;</a>
    <a name="configuration">Usage: </a><a href="cmd_configure.wiki">fossil configuration</a> METHOD ...
    Where METHOD is one of: export import merge pull push reset.  All methods
    accept the -R or --repository option to specific a repository.

    fossil configuration export AREA FILENAME

    Write to FILENAME exported configuraton information for AREA.
    AREA can be one of:  all ticket skin project

    fossil configuration import FILENAME

    Read a configuration from FILENAME, overwriting the current
    configuration.

    fossil configuration merge FILENAME

    Read a configuration from FILENAME and merge its values into
    the current configuration.  Existing values take priority over
    values read from FILENAME.

    fossil configuration pull AREA ?URL?

    Pull and install the configuration from a different server
    identified by URL.  If no URL is specified, then the default
    server is used.
    fossil configuration push AREA ?URL?

    Push the local configuration into the remote server identified
    by URL.  Admin privilege is required on the remote server for
    this to work.

    fossil configuration reset AREA

    Restore the configuration to the default.  AREA as above.

    WARNING: Do not import, merge, or pull configurations from an untrusted
    source.  The inbound configuration is not checked for safety and can
    introduce security vulnerabilities.

<hr><a href="#tof">&#710;</a>
    COMMAND: deconstruct
    <a name="deconstruct">Usage: </a><a href="cmd_deconstruct.wiki">fossil deconstruct</a> ?-R|--repository REPOSITORY? DESTINATION
    Populates the indicated DESTINATION directory with copies of all
    artifcats contained within the repository.  Artifacts are named AA/bbbbb
    where AA is the first 2 characters of the artifact ID and bbbbb is the
    remaining 38 characters.

<hr><a href="#tof">&#710;</a>
    <a name="rm">Usage: </a><a href="cmd_rm.wiki">fossil rm</a> FILE...    or: fossil del FILE...
    Remove one or more files from the tree.

<hr><a href="#tof">&#710;</a>
    <a name="descendants">Usage: </a><a href="cmd_descendants.wiki">fossil descendants</a> ?CHECKIN-ID?
    Find all leaf descendants of the check-in specified or if the argument
    is omitted, of the check-in currently checked out.

<hr><a href="#tof">&#710;</a>
    <a name="diff">Usage: </a><a href="cmd_diff.wiki">fossil diff</a>|gdiff ?-i? ?-r REVISION? FILE...
    Show the difference between the current version of a file (as it
    exists on disk) and that same file as it was checked out.

    diff will show a textual diff while gdiff will attempt to run a
    graphical diff command that you have setup. If the choosen command
    is not yet configured, the internal textual diff command will be
    used.

    If -i is supplied for either diff or gdiff, the internal textual
    diff command will be executed.

    Here are a few external diff command settings, for example:

    fossil setting diff-command diff

    fossil setting gdiff-command tkdiff
    fossil setting gdiff-command eskill22
    fossil setting gdiff-command tortoisemerge
    fossil setting gdiff-command meld
    fossil setting gdiff-command xxdiff
    fossil setting gdiff-command kdiff3

<hr><a href="#tof">&#710;</a>
    <a name="extra">Usage: </a><a href="cmd_extra.wiki">fossil extra</a>
    Print a list of all files in the source tree that are not part of
    the current checkout.  See also the "clean" command.

<hr><a href="#tof">&#710;</a>
    <a name="help">Usage: </a><a href="cmd_help.wiki">fossil help</a> COMMAND
    Display information on how to use COMMAND

<hr><a href="#tof">&#710;</a>
    <a name="http">Usage: </a><a href="cmd_http.wiki">fossil http</a> REPOSITORY
    Handle a single HTTP request appearing on stdin.  The resulting webpage
    is delivered on stdout.  This method is used to launch an HTTP request
    handler from inetd, for example.  The argument is the name of the    repository.

<hr><a href="#tof">&#710;</a>
    <a name="info">Usage: </a><a href="cmd_info.wiki">fossil info</a> ?ARTIFACT-ID|FILENAME?
    With no arguments, provide information about the current tree.
    If an argument is specified, provide information about the object
    in the respository of the current tree that the argument refers
    to.  Or if the argument is the name of a repository, show
    information about that repository.

<hr><a href="#tof">&#710;</a>
    <a name="leaves">Usage: </a><a href="cmd_leaves.wiki">fossil leaves</a>
    Find leaves of all branches.

<hr><a href="#tof">&#710;</a>
    <a name="ls">Usage: </a><a href="cmd_ls.wiki">fossil ls</a>
    Show the names of all files in the current checkout

<hr><a href="#tof">&#710;</a>
    <a name="merge">Usage: </a><a href="cmd_merge.wiki">fossil merge</a> VERSION
    The argument is a version that should be merged into the current
    checkout.
    Only file content is merged.  The result continues to use the
    file and directory names from the current check-out even if those
    names might have been changed in the branch being merged in.

<hr><a href="#tof">&#710;</a>
    <a name="mv">Usage: </a><a href="cmd_mv.wiki">fossil mv|rename</a> OLDNAME NEWNAME       or: fossil mv|rename OLDNAME... DIR

    Move or rename one or more files within the tree

    This command does not rename the files on disk.  All this command does is
    record the fact that filenames have changed so that appropriate notations
    can be made at the next commit/checkin.

<hr><a href="#tof">&#710;</a>
    <a name="new">Usage: </a><a href="cmd_new.wiki">fossil new</a> FILENAME

    Create a repository for a new project in the file named FILENAME.
    This command is distinct from "clone".  The "clone" command makes
    a copy of an existing project.  This command starts a new project.

<hr><a href="#tof">&#710;</a>
    <a name="open">Usage: </a><a href="cmd_open.wiki">fossil open</a> FILENAME
    Open a connection to the local repository in FILENAME.  A checkout
    for the repository is created with its root at the working directory.
    See also the "close" command.

<hr><a href="#tof">&#710;</a>
    <a name="rstats">Usage: </a><a href="cmd_rstats.wiki">fossil rstats</a>

    Deliver a report of the repository statistics for the
    current checkout.

<hr><a href="#tof">&#710;</a>
    <a name="pull">Usage: </a><a href="cmd_pull.wiki">fossil pull</a> ?URL? ?-R|--respository REPOSITORY?
    Pull changes in a remote repository into the local repository.
    The repository is identified by the -R or --repository option.
    If there is no such option then the open repository is used.
    The URL of the remote server is specified on the command line
    If no URL is specified then the URL used by the most recent
    "pull", "push", or "sync" command is used.

    The URL is of the following form:

    http://USER@HOST:PORT/PATH

    The "USER@" and ":PORT" substrings are optional.
    The "USER" substring specifies the login user.  You will be
    prompted for the password on the command-line.  The PORT
    specifies the TCP port of the server.  The default port is
    80.

<hr><a href="#tof">&#710;</a>
    <a name="push">Usage: </a><a href="cmd_push.wiki">fossil push</a> ?URL? ?-R|--repository REPOSITORY?
    Push changes in the local repository over into a remote repository.
    See the "pull" command for additional information.

<hr><a href="#tof">&#710;</a>
    <a name="rebuild">Usage: </a><a href="cmd_rebuild.wiki">fossil rebuild</a> REPOSITORY
    Reconstruct the named repository database from the core
    records.  Run this command after updating the fossil
    executable in a way that changes the database schema.

<hr><a href="#tof">&#710;</a>
    COMMAND: reconstruct
    <a name="reconstruct">Usage: </a><a href="cmd_reconstruct.wiki">fossil reconstruct</a> REPOSITORY ORIGIN
    Creates the REPOSITORY and populates it with the artifacts in the
    indicated ORIGIN directory.

<hr><a href="#tof">&#710;</a>
    <a name="redo">Usage: </a><a href="cmd_redo.wiki">fossil redo</a> ?FILENAME...?
    Redo the an update or merge operation that has been undone by the
    undo command.  If FILENAME is specified then restore the changes
    associated with the named file(s) but otherwise leave the update
    or merge undone.

    A single level of undo/redo is supported.  The undo/redo stack
    is cleared by the commit and checkout commands.

<hr><a href="#tof">&#710;</a>
    <a name="revert">Usage: </a><a href="cmd_revert.wiki">fossil revert</a> ?--yes? ?-r CHECKIN? FILE
    Revert to the current repository version of FILE, or to
    the version associated with check-in CHECKIN if the -r flag
    appears.  This command will confirm your operation unless the
    file is missing or the --yes option is used.

<hr><a href="#tof">&#710;</a>
    <a name="server">Usage: </a><a href="cmd_server.wiki">fossil server</a> ?-P|--port TCPPORT? ?REPOSITORY?    Or: fossil ui ?-P|--port TCPPORT? ?REPOSITORY?

    Open a socket and begin listening and responding to HTTP requests on
    TCP port 8080, or on any other TCP port defined by the -P or
    --port option.  The optional argument is the name of the repository.
    The repository argument may be omitted if the working directory is
    within an open checkout.

    The "ui" command automatically starts a web browser after initializing
    the web server.

<hr><a href="#tof">&#710;</a>
    COMMAND: settings
    COMMAND: unset
    <a name="settings">Usage: </a><a href="cmd_setting.wiki">fossil settings</a> ?PROPERTY? ?VALUE? ?-global?
    fossil unset PROPERTY ?-global?

    The "settings" command with no arguments lists all properties and their
    values.  With just a property name it shows the value of that property.
    With a value argument it changes the property for the current repository.

    The "unset" command clears a property setting.

       autosync         If enabled, automatically pull prior to
		        commit or update and automatically push
		        after commit or tag or branch creation.

       diff-command     External command to run when performing a diff.
		        If undefined, the internal text diff will be used.

       editor           Text editor command used for check-in comments.

       http-port        The TCP/IP port number to use by the "server"

		        and "ui" commands.  Default: 8080

       gdiff-command    External command to run when performing a graphical
		        diff. If undefined, text diff will be used.

       localauth        If enabled, require that HTTP connections from
		        127.0.0.1 be authenticated by password.  If
		        false, all HTTP requests from localhost have
		        unrestricted access to the repository.

       clearsign        When enabled (the default), fossil will attempt to
		        sign all commits with gpg.  When disabled, commits will
		        be unsigned.

       pgp-command      Command used to clear-sign manifests at check-in.
		        The default is "gpg --clearsign -o ".

       mtime-changes    Use file modification times (mtimes) to detect when
		        files have been modified.

       proxy            URL of the HTTP proxy.  If undefined or "on" then
		        the "http_proxy" environment variable is consulted.
		        If the http_proxy environment variable is undefined
		        then a direct HTTP connection is used.

       web-browser      A shell command used to launch your preferred
		        web browser when given a URL as an argument.
		        Defaults to "start" on windows, "open" on Mac,
		        and "firefox" on Unix.

<hr><a href="#tof">&#710;</a>
    <a name="status">Usage: </a><a href="cmd_status.wiki">fossil status</a>
    Report on the status of the current checkout.

<hr><a href="#tof">&#710;</a>
    <a name="sync">Usage: </a><a href="cmd_sync.wiki">fossil sync</a> ?URL? ?-R|--repository REPOSITORY?
    Synchronize the local repository with a remote repository.  This is
    the equivalent of running both "push" and "pull" at the same time.
    See the "pull" command for additional information.

<hr><a href="#tof">&#710;</a>
    <a name="tag">Usage: </a><a href="cmd_tag.wiki">fossil tag</a> SUBCOMMAND ...
    Run various subcommands to control tags and properties

    fossil tag add ?--raw? TAGNAME CHECK-IN ?VALUE?

    Add a new tag or property to CHECK-IN. The tag will
    be usable instead of a CHECK-IN in commands such as
    update and merge.

    fossil tag branch ?--raw? ?--nofork? TAGNAME CHECK-IN ?VALUE?

    A fork will be created so that the new checkin
    is a sibling of CHECK-IN and identical to it except
    for a generated comment. Then the new tag will
    be added to the new checkin and propagated to
    all direct children.  Additionally all symbolic
    tags of that checkin inherited from CHECK-IN will
    be cancelled.

    However, if the option --nofork is given, no
    fork will be created and the tag/property will be
    added to CHECK-IN directly. No tags will be canceled.

    fossil tag cancel ?--raw? TAGNAME CHECK-IN

    Remove the tag TAGNAME from CHECK-IN, and also remove
    the propagation of the tag to any descendants.

    fossil tag find ?--raw? TAGNAME

    List all check-ins that use TAGNAME

    fossil tag list ?--raw? ?CHECK-IN?

    List all tags, or if CHECK-IN is supplied, list
    all tags and their values for CHECK-IN.

    The option --raw allows the manipulation of all types of
    tags used for various internal purposes in fossil. You
    should not use this option to make changes unless you are
    sure what you are doing.

    If you need to use a tagname that might be confused with
    a hexadecimal check-in or artifact ID, you can explicitly
    disambiguate it by prefixing it with "tag:". For instance:

    fossil update decaf

    will be taken as an artifact or check-in ID and fossil will
    probably complain that no such revision was found. However

    fossil update tag:decaf

    will assume that "decaf" is a tag/branch name.

<hr><a href="#tof">&#710;</a>
    <a name="timeline">Usage: </a><a href="cmd_timeline.wiki">fossil timeline</a> ?WHEN? ?CHECK-IN|DATETIME? ?-n|--count N?
    Print a summary of activity going backwards in date and time
    specified or from the current date and time if no arguments
    are given.  Show as many as N (default 20) check-ins.  The
    WHEN argument can be any unique abbreviation of one of these
    keywords:

    before
    after
    descendants | children
    ancestors | parents

    The CHECK-IN can be any unique prefix of 4 characters or more.
    The DATETIME should be in the ISO8601 format.  For
    examples: "2007-08-18 07:21:21".  You can also say "current"
    for the current version or "now" for the current time.

<hr><a href="#tof">&#710;</a>
    <a name="undo">Usage: </a><a href="cmd_undo.wiki">fossil undo</a> ?FILENAME...?
    Undo the most recent update or merge operation.  If FILENAME is
    specified then restore the content of the named file(s) but otherwise
    leave the update or merge in effect.

    A single level of undo/redo is supported.  The undo/redo stack
    is cleared by the commit and checkout commands.

<hr><a href="#tof">&#710;</a>
    <a name="update">Usage: </a><a href="cmd_update.wiki">fossil update</a> ?VERSION? ?--latest?
    The optional argument is a version that should become the current
    version.  If the argument is omitted, then use the leaf of the
    tree that begins with the current version, if there is only a    single leaf.  If there are a multiple leaves, the latest is used
    if the --latest flag is present.

    This command is different from the "checkout" in that edits are
    not overwritten.  Edits are merged into the new version.

<hr><a href="#tof">&#710;</a>
    <a name="user">Usage: </a><a href="cmd_user.wiki">fossil user</a> SUBCOMMAND ...  ?-R|--repository FILE?
    Run various subcommands on users of the open repository or of
    the repository identified by the -R or --repository option.

    fossil user capabilities USERNAME ?STRING?

    Query or set the capabilities for user USERNAME

    fossil user default ?USERNAME?

    Query or set the default user.  The default user is the
    user for command-line interaction.

    fossil user list

    List all users known to the repository

    fossil user new ?USERNAME?

    Create a new user in the repository.  Users can never be
    deleted.  They can be denied all access but they must continue
    to exist in the database.

    fossil user password USERNAME

    Change the web access password for a user.

<hr><a href="#tof">&#710;</a>
    <a name="version">Usage: </a><a href="cmd_version.wiki">fossil version</a>
    Print the source code version number for the fossil executable.

<hr><a href="#tof">&#710;</a>
    <a name="wiki">Usage: </a><a href="cmd_wiki.wiki">fossil wiki</a> (export|create|commit|list) WikiName
    Run various subcommands to fetch wiki entries.

    fossil wiki export PAGENAME ?FILE?

    Sends the latest version of the PAGENAME wiki
    entry to the given file or standard output.

    fossil wiki commit PAGENAME ?FILE?

    Commit changes to a wiki page from FILE or from standard.

    fossil wiki create PAGENAME ?FILE?

    Create a new wiki page with initial content taken from
    FILE or from standard input.

    fossil wiki list

    Lists all wiki entries, one per line, ordered
    case-insentively by name.

    TODOs:

    fossil wiki export ?-u ARTIFACT? WikiName ?FILE?

    Outputs the selected version of WikiName.

    fossil wiki delete ?-m MESSAGE? WikiName

    The same as deleting a file entry, but i don't know if fossil
    supports a commit message for Wiki entries.

    fossil wiki ?-u? ?-d? ?-s=[|]? list

    Lists the artifact ID and/or Date of last change along with
    each entry name, delimited by the -s char.

    fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName

    Diffs the local copy of a page with a given version (defaulting
    to the head version).

  </pre></nowiki>

  <hr><a href="#tof">&#710;</a>

    <h3>Caveats</h3>
    This is not actually a reference, it's the start of a reference.
    There are wikilinks to uncreated pages for the commands.  This was
    created by running the fossil help for each command listed by running
    fossil help...  Duplicate commands are only listed once (I
    <i>think</i>).  There are several bits of <b>fossil</b> that are not addressed
    in the help for commands (special wiki directories, special users, etc.)
    so they are (currently) not addressed here.  Clarity and brevity may be
    sacrificed for expediency at the authors indiscretion.  All spelling and
    grammatical mistakes are somebody elses fault.<code>  void * </code>
    prohibited where<code> __C_PLUS_PLUS__ </code>. Title and taxes extra.
    Not valid in Hooptigonia.













|
>
>




|
|
|
|
|


|
|
|
|
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|


<
<
<
<
<
<
<
<
<
<

<
<
<
<
<

<
<
>
>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|

<
<
<
<
<
>
>
>
>

<
<
<
>
>
>
>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
>
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
|
|
|
>
>
>
>
>
>
>
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
























































75
76
77










78





79


80
81
82
83




































































84
85
86





87
88
89
90
91



92
93
94
95
96
97






















































































































































































































































98
99
100
























































































































































































































101
102
103
104
105
106
107
108
109
110
111
112
113
114
    guaranteed and fast access to the sources & docs (your cloned fossil
    repository).
<br /><br /> <br />
  <b>You should</b> probably start interacting with fossil at the command
  line by asking it what it can
  do:&nbsp;&nbsp;&nbsp;&nbsp;<a name="tof">&#710;</a>

  <code>$ fossil [/help|help]</code>

  This will generate output in the form:<pre>
Usage: fossil help COMMAND.
Available COMMANDs:</pre><table width="80%"
                          style="font-family: fixed, courier, monospace;">
  <tr>
    <td width="20%">[/help?cmd=add|add]</td>
    <td>[/help?cmd=co|co]</td>
    <td width="20%">[/help?cmd=info|info]</td>
    <td width="20%">[/help?cmd=remote-url|remote-url]</td>
    <td width="20%">[/help?cmd=ticket|ticket]</td>
  </tr>
  <tr>
    <td>..</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
























































</table><pre>
This is fossil version [a89b436bc9] 2009-02-11 05:00:02 UTC
</pre>



















  This information can also viewed in the fossil gui using the url
  PROJEKT-BASEURL/[/help|help]. You'll see a web page, listing all
  available commands in the current fossil build.





































































  Each listed command is a link to a web page, displaying the detailed
  command line help for the appropriate command.






  There are links to individual wiki pages for each command. These pages
  are named <kbd>cmd_<i>COMMAND-NAME</i></kbd>. These pages are not
  defined for all commands - it's a work in progress. Existing pages give
  more detailed description of the corresponding command.




  <h3>Caveats</h3>
  This reference is complete concerning the [/help|list] of commands
  and the detailed command line reference. It's always in sync with the
  used fossil build, because it uses the original command help, which is
  compiled into the binary.























































































































































































































































  Additional, in-depth information in the wiki part is not available for
  all commands.
  
























































































































































































































  There are several bits of <b>fossil</b> that are not addressed
  in the help for commands (special wiki directories, special users, etc.)
  so they are (currently) not addressed here.  Clarity and brevity may be
  sacrificed for expediency at the authors indiscretion.  All spelling and
  grammatical mistakes are somebody elses fault.<code>  void * </code>
  prohibited where<code> __C_PLUS_PLUS__ </code>. Title and taxes extra.
  Not valid in Hooptigonia.

  <h3>Testing fossil</h3>
  There are several [/help?cmd=test|test commands] to test the
  internals of fossil. These commands are listed on a special web page
  [/help?cmd=test|help?cmd=test]. This page is the counter part of
  <kbd><a href="/help?cmd=test-commands">fossil test-commands</a></kbd>.