Fossil

Check-in [b3bf08cc]
Login

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

Overview
Comment:removed quotes from command cross references and add them in help command
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wolfgangHelpCmd
Files: files | file ages | folders
SHA1:b3bf08cc843a7de39968ecb41c8b14e5c9adae18
User & Date: wolfgang 2010-10-08 12:18:17
Context
2010-10-08
12:32
help overview page uses table layout check-in: 94741fb6 user: wolfgang tags: wolfgangHelpCmd
12:18
removed quotes from command cross references and add them in help command check-in: b3bf08cc user: wolfgang tags: wolfgangHelpCmd
12:10
shorten command lines to 80 char check-in: ad29dc11 user: wolfgang tags: wolfgangHelpCmd
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
...
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305

/*
** COMMAND: changes
**
** Usage: %fossil changes
**
** Report on the edit status of all files in the current checkout.
** See also the "<a>status</a>" and "<a>extra</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: 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.
*/
void extra_cmd(void){
  Blob path;
  Blob repo;
................................................................................

/*
** 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







|







 







|







 







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
...
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
...
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305

/*
** COMMAND: changes
**
** Usage: %fossil changes
**
** Report on the edit status of all files in the current checkout.
** See also the <a>status</a> and <a>extra</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: 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.
*/
void extra_cmd(void){
  Blob path;
  Blob repo;
................................................................................

/*
** 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

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 "<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();
}







|







 







|












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/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

/*
** 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();







|







 







|







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

/*
** 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();

Changes to src/diffcmd.c.

362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
** 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".
*/
void diff_cmd(void){
  int isGDiff;               /* True for gdiff.  False for normal diff */
  int isInternDiff;          /* True for internal diff */
  const char *zFrom;         /* Source version number */
  const char *zTo;           /* Target version number */







|







362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
** 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".
*/
void diff_cmd(void){
  int isGDiff;               /* True for gdiff.  False for normal diff */
  int isInternDiff;          /* True for internal diff */
  const char *zFrom;         /* Source version number */
  const char *zTo;           /* Target version number */

Changes to src/main.c.

583
584
585
586
587
588
589

590
591

592
593
594
595
596
597
598
...
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
...
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
       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 ){

      z += 3;
    }else if( *z=='<' && strncmp(z,"</a>",4)==0 ){

      z += 4;
    }else{
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
................................................................................
      if( rc==1 ){
        @ unknown command: %s(zCmd)
      }else if( rc==2 ){
        @ ambiguous command prefix: %s(zCmd)
      }else{
        char *zSrc, *zDest;
        int src,dest,len;
	
        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 ){
	      /* found an internal command cross reference,
	      ** create an additional link
	      */
	      int start;

              len+=80;
	      zDest=realloc(zDest,len);
	      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++]='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;
	  @ <pre>%s(zDest)</pre>
	  free(zDest);
	}
      }
      @ <hr>additional information may be found in the web documentation:
      @ <a href="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 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







>


>







 







|




|

|
|
|
|
|
|
|
|


|
|







 







|
|
|
|


|
|
|
|
|
|
|
|
|
|
|








|







583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
...
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
...
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
       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('"');
      z += 3;
    }else if( *z=='<' && strncmp(z,"</a>",4)==0 ){
      putchar('"');
      z += 4;
    }else{
      putchar(*z);
      z++;
    }
  }
  putchar('\n');
................................................................................
      if( rc==1 ){
        @ unknown command: %s(zCmd)
      }else if( rc==2 ){
        @ ambiguous command prefix: %s(zCmd)
      }else{
        char *zSrc, *zDest;
        int src,dest,len;

        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 ){
              /* found an internal command cross reference,
              ** create an additional link
              */
              int start;

              len+=80;
              zDest=realloc(zDest,len);
              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++]='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;
          @ <pre>%s(zDest)</pre>
          free(zDest);
        }
      }
      @ <hr>additional information may be found in the web documentation:
      @ <a href="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 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

Changes to src/sync.c.

177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

/*
** 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
**
................................................................................
}

/*
** 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 ){







|







 







|
|

|
|

|







177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

/*
** 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
**
................................................................................
}

/*
** 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 ){

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 "<a>undo</a>" 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;