Fossil SCM

Merge the ben-minorchanges branch into trunk.

drh 2011-08-04 14:32 trunk merge
Commit 83c032de7f1e6fa64a6cc955756b1c1d672a7c20
2 files changed +22 -16 +7 -7
+22 -16
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -175,23 +175,24 @@
175175
blob_reset(&cmd);
176176
}
177177
}
178178
179179
/*
180
-** Do a diff against a single file named in g.argv[2] from version zFrom
180
+** Do a diff against a single file named in zFileTreeName from version zFrom
181181
** against the same file on disk.
182182
*/
183183
static void diff_one_against_disk(
184184
const char *zFrom, /* Name of file */
185185
const char *zDiffCmd, /* Use this "diff" command */
186
- int ignoreEolWs /* Ignore whitespace changes at end of lines */
186
+ int ignoreEolWs, /* Ignore whitespace changes at end of lines */
187
+ const char *zFileTreeName
187188
){
188189
Blob fname;
189190
Blob content;
190
- file_tree_name(g.argv[2], &fname, 1);
191
+ file_tree_name(zFileTreeName, &fname, 1);
191192
historical_version_of_file(zFrom, blob_str(&fname), &content, 0, 0);
192
- diff_file(&content, g.argv[2], g.argv[2], zDiffCmd, ignoreEolWs);
193
+ diff_file(&content, zFileTreeName, zFileTreeName, zDiffCmd, ignoreEolWs);
193194
blob_reset(&content);
194195
blob_reset(&fname);
195196
}
196197
197198
/*
@@ -295,22 +296,22 @@
295296
}
296297
297298
/*
298299
** Output the differences between two versions of a single file.
299300
** zFrom and zTo are the check-ins containing the two file versions.
300
-** The filename is contained in g.argv[2].
301301
*/
302302
static void diff_one_two_versions(
303303
const char *zFrom,
304304
const char *zTo,
305305
const char *zDiffCmd,
306
- int ignoreEolWs
306
+ int ignoreEolWs,
307
+ const char *zFileTreeName
307308
){
308309
char *zName;
309310
Blob fname;
310311
Blob v1, v2;
311
- file_tree_name(g.argv[2], &fname, 1);
312
+ file_tree_name(zFileTreeName, &fname, 1);
312313
zName = blob_str(&fname);
313314
historical_version_of_file(zFrom, zName, &v1, 0, 0);
314315
historical_version_of_file(zTo, zName, &v2, 0, 0);
315316
diff_file_mem(&v1, &v2, zName, zDiffCmd, ignoreEolWs);
316317
blob_reset(&v1);
@@ -408,16 +409,16 @@
408409
409410
/*
410411
** COMMAND: diff
411412
** COMMAND: gdiff
412413
**
413
-** Usage: %fossil diff|gdiff ?options? ?FILE?
414
+** Usage: %fossil diff|gdiff ?options? ?FILE1? ?FILE2 ...?
414415
**
415
-** Show the difference between the current version of FILE (as it
416
-** exists on disk) and that same file as it was checked out. Or
417
-** if the FILE argument is omitted, show the unsaved changed currently
418
-** in the working check-out.
416
+** Show the difference between the current version of each of the FILEs
417
+** specified (as they exist on disk) and that same file as it was checked
418
+** out. Or if the FILE arguments are omitted, show the unsaved changed
419
+** currently in the working check-out.
419420
**
420421
** If the "--from VERSION" or "-r VERSION" option is used it specifies
421422
** the source check-in for the diff operation. If not specified, the
422423
** source check-in is the base check-in for the current check-out.
423424
**
@@ -440,10 +441,11 @@
440441
int hasNFlag; /* True if -N or --new-file flag is used */
441442
const char *zFrom; /* Source version number */
442443
const char *zTo; /* Target version number */
443444
const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
444445
int diffFlags = 0; /* Flags to control the DIFF */
446
+ int f;
445447
446448
isGDiff = g.argv[1][0]=='g';
447449
isInternDiff = find_option("internal","i",0)!=0;
448450
zFrom = find_option("from", "r", 1);
449451
zTo = find_option("to", 0, 1);
@@ -455,12 +457,14 @@
455457
db_must_be_within_tree();
456458
verify_all_options();
457459
if( !isInternDiff ){
458460
zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
459461
}
460
- if( g.argc==3 ){
461
- diff_one_against_disk(zFrom, zDiffCmd, 0);
462
+ if( g.argc>=3 ){
463
+ for(f=2; f<g.argc; ++f){
464
+ diff_one_against_disk(zFrom, zDiffCmd, 0, g.argv[f]);
465
+ }
462466
}else{
463467
diff_all_against_disk(zFrom, zDiffCmd, diffFlags);
464468
}
465469
}else if( zFrom==0 ){
466470
fossil_fatal("must use --from if --to is present");
@@ -468,12 +472,14 @@
468472
db_find_and_open_repository(0, 0);
469473
verify_all_options();
470474
if( !isInternDiff ){
471475
zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
472476
}
473
- if( g.argc==3 ){
474
- diff_one_two_versions(zFrom, zTo, zDiffCmd, 0);
477
+ if( g.argc>=3 ){
478
+ for(f=2; f<g.argc; ++f){
479
+ diff_one_two_versions(zFrom, zTo, zDiffCmd, 0, g.argv[f]);
480
+ }
475481
}else{
476482
diff_all_two_versions(zFrom, zTo, zDiffCmd, diffFlags);
477483
}
478484
}
479485
}
480486
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -175,23 +175,24 @@
175 blob_reset(&cmd);
176 }
177 }
178
179 /*
180 ** Do a diff against a single file named in g.argv[2] from version zFrom
181 ** against the same file on disk.
182 */
183 static void diff_one_against_disk(
184 const char *zFrom, /* Name of file */
185 const char *zDiffCmd, /* Use this "diff" command */
186 int ignoreEolWs /* Ignore whitespace changes at end of lines */
 
187 ){
188 Blob fname;
189 Blob content;
190 file_tree_name(g.argv[2], &fname, 1);
191 historical_version_of_file(zFrom, blob_str(&fname), &content, 0, 0);
192 diff_file(&content, g.argv[2], g.argv[2], zDiffCmd, ignoreEolWs);
193 blob_reset(&content);
194 blob_reset(&fname);
195 }
196
197 /*
@@ -295,22 +296,22 @@
295 }
296
297 /*
298 ** Output the differences between two versions of a single file.
299 ** zFrom and zTo are the check-ins containing the two file versions.
300 ** The filename is contained in g.argv[2].
301 */
302 static void diff_one_two_versions(
303 const char *zFrom,
304 const char *zTo,
305 const char *zDiffCmd,
306 int ignoreEolWs
 
307 ){
308 char *zName;
309 Blob fname;
310 Blob v1, v2;
311 file_tree_name(g.argv[2], &fname, 1);
312 zName = blob_str(&fname);
313 historical_version_of_file(zFrom, zName, &v1, 0, 0);
314 historical_version_of_file(zTo, zName, &v2, 0, 0);
315 diff_file_mem(&v1, &v2, zName, zDiffCmd, ignoreEolWs);
316 blob_reset(&v1);
@@ -408,16 +409,16 @@
408
409 /*
410 ** COMMAND: diff
411 ** COMMAND: gdiff
412 **
413 ** Usage: %fossil diff|gdiff ?options? ?FILE?
414 **
415 ** Show the difference between the current version of FILE (as it
416 ** exists on disk) and that same file as it was checked out. Or
417 ** if the FILE argument is omitted, show the unsaved changed currently
418 ** in the working check-out.
419 **
420 ** If the "--from VERSION" or "-r VERSION" option is used it specifies
421 ** the source check-in for the diff operation. If not specified, the
422 ** source check-in is the base check-in for the current check-out.
423 **
@@ -440,10 +441,11 @@
440 int hasNFlag; /* True if -N or --new-file flag is used */
441 const char *zFrom; /* Source version number */
442 const char *zTo; /* Target version number */
443 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
444 int diffFlags = 0; /* Flags to control the DIFF */
 
445
446 isGDiff = g.argv[1][0]=='g';
447 isInternDiff = find_option("internal","i",0)!=0;
448 zFrom = find_option("from", "r", 1);
449 zTo = find_option("to", 0, 1);
@@ -455,12 +457,14 @@
455 db_must_be_within_tree();
456 verify_all_options();
457 if( !isInternDiff ){
458 zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
459 }
460 if( g.argc==3 ){
461 diff_one_against_disk(zFrom, zDiffCmd, 0);
 
 
462 }else{
463 diff_all_against_disk(zFrom, zDiffCmd, diffFlags);
464 }
465 }else if( zFrom==0 ){
466 fossil_fatal("must use --from if --to is present");
@@ -468,12 +472,14 @@
468 db_find_and_open_repository(0, 0);
469 verify_all_options();
470 if( !isInternDiff ){
471 zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
472 }
473 if( g.argc==3 ){
474 diff_one_two_versions(zFrom, zTo, zDiffCmd, 0);
 
 
475 }else{
476 diff_all_two_versions(zFrom, zTo, zDiffCmd, diffFlags);
477 }
478 }
479 }
480
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -175,23 +175,24 @@
175 blob_reset(&cmd);
176 }
177 }
178
179 /*
180 ** Do a diff against a single file named in zFileTreeName from version zFrom
181 ** against the same file on disk.
182 */
183 static void diff_one_against_disk(
184 const char *zFrom, /* Name of file */
185 const char *zDiffCmd, /* Use this "diff" command */
186 int ignoreEolWs, /* Ignore whitespace changes at end of lines */
187 const char *zFileTreeName
188 ){
189 Blob fname;
190 Blob content;
191 file_tree_name(zFileTreeName, &fname, 1);
192 historical_version_of_file(zFrom, blob_str(&fname), &content, 0, 0);
193 diff_file(&content, zFileTreeName, zFileTreeName, zDiffCmd, ignoreEolWs);
194 blob_reset(&content);
195 blob_reset(&fname);
196 }
197
198 /*
@@ -295,22 +296,22 @@
296 }
297
298 /*
299 ** Output the differences between two versions of a single file.
300 ** zFrom and zTo are the check-ins containing the two file versions.
 
301 */
302 static void diff_one_two_versions(
303 const char *zFrom,
304 const char *zTo,
305 const char *zDiffCmd,
306 int ignoreEolWs,
307 const char *zFileTreeName
308 ){
309 char *zName;
310 Blob fname;
311 Blob v1, v2;
312 file_tree_name(zFileTreeName, &fname, 1);
313 zName = blob_str(&fname);
314 historical_version_of_file(zFrom, zName, &v1, 0, 0);
315 historical_version_of_file(zTo, zName, &v2, 0, 0);
316 diff_file_mem(&v1, &v2, zName, zDiffCmd, ignoreEolWs);
317 blob_reset(&v1);
@@ -408,16 +409,16 @@
409
410 /*
411 ** COMMAND: diff
412 ** COMMAND: gdiff
413 **
414 ** Usage: %fossil diff|gdiff ?options? ?FILE1? ?FILE2 ...?
415 **
416 ** Show the difference between the current version of each of the FILEs
417 ** specified (as they exist on disk) and that same file as it was checked
418 ** out. Or if the FILE arguments are omitted, show the unsaved changed
419 ** currently in the working check-out.
420 **
421 ** If the "--from VERSION" or "-r VERSION" option is used it specifies
422 ** the source check-in for the diff operation. If not specified, the
423 ** source check-in is the base check-in for the current check-out.
424 **
@@ -440,10 +441,11 @@
441 int hasNFlag; /* True if -N or --new-file flag is used */
442 const char *zFrom; /* Source version number */
443 const char *zTo; /* Target version number */
444 const char *zDiffCmd = 0; /* External diff command. NULL for internal diff */
445 int diffFlags = 0; /* Flags to control the DIFF */
446 int f;
447
448 isGDiff = g.argv[1][0]=='g';
449 isInternDiff = find_option("internal","i",0)!=0;
450 zFrom = find_option("from", "r", 1);
451 zTo = find_option("to", 0, 1);
@@ -455,12 +457,14 @@
457 db_must_be_within_tree();
458 verify_all_options();
459 if( !isInternDiff ){
460 zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
461 }
462 if( g.argc>=3 ){
463 for(f=2; f<g.argc; ++f){
464 diff_one_against_disk(zFrom, zDiffCmd, 0, g.argv[f]);
465 }
466 }else{
467 diff_all_against_disk(zFrom, zDiffCmd, diffFlags);
468 }
469 }else if( zFrom==0 ){
470 fossil_fatal("must use --from if --to is present");
@@ -468,12 +472,14 @@
472 db_find_and_open_repository(0, 0);
473 verify_all_options();
474 if( !isInternDiff ){
475 zDiffCmd = db_get(isGDiff ? "gdiff-command" : "diff-command", 0);
476 }
477 if( g.argc>=3 ){
478 for(f=2; f<g.argc; ++f){
479 diff_one_two_versions(zFrom, zTo, zDiffCmd, 0, g.argv[f]);
480 }
481 }else{
482 diff_all_two_versions(zFrom, zTo, zDiffCmd, diffFlags);
483 }
484 }
485 }
486
+7 -7
--- src/winhttp.c
+++ src/winhttp.c
@@ -444,11 +444,11 @@
444444
** is logged in.
445445
**
446446
** In the following description of the methods, "Fossil-DSCM" will be
447447
** used as the default SERVICE-NAME:
448448
**
449
-** fossil service create ?SERVICE-NAME? ?OPTIONS?
449
+** fossil winsrv create ?SERVICE-NAME? ?OPTIONS?
450450
**
451451
** Creates a service. Available options include:
452452
**
453453
** -D|--display DISPLAY-NAME
454454
**
@@ -458,11 +458,11 @@
458458
**
459459
** -S|--start TYPE
460460
**
461461
** Sets the start type of the service. TYPE can be "manual",
462462
** which means you need to start the service yourself with the
463
-** 'fossil service start' command or with the "net start" command
463
+** 'fossil winsrv start' command or with the "net start" command
464464
** from the operating system. If TYPE is set to "auto", the service
465465
** will be started automatically by the system during startup.
466466
**
467467
** -U|--username USERNAME
468468
**
@@ -509,27 +509,27 @@
509509
** Enables automatic login if the --localauth option is present
510510
** and the "localauth" setting is off and the connection is from
511511
** localhost.
512512
**
513513
**
514
-** fossil service delete ?SERVICE-NAME?
514
+** fossil winsrv delete ?SERVICE-NAME?
515515
**
516516
** Deletes a service. If the service is currently running, it will be
517517
** stopped first and then deleted.
518518
**
519519
**
520
-** fossil service show ?SERVICE-NAME?
520
+** fossil winsrv show ?SERVICE-NAME?
521521
**
522522
** Shows how the service is configured and its current state.
523523
**
524524
**
525
-** fossil service start ?SERVICE-NAME?
525
+** fossil winsrv start ?SERVICE-NAME?
526526
**
527527
** Start the service.
528528
**
529529
**
530
-** fossil service stop ?SERVICE-NAME?
530
+** fossil winsrv stop ?SERVICE-NAME?
531531
**
532532
** Stop the service.
533533
**
534534
**
535535
** NOTE: This command is available on Windows operating systems only and
@@ -852,11 +852,11 @@
852852
853853
#else /* _WIN32 -- This code is for win32 only */
854854
#include "winhttp.h"
855855
856856
void cmd_win32_service(void){
857
- fossil_fatal("The service command is platform specific "
857
+ fossil_fatal("The winsrv command is platform specific "
858858
"and not available on this platform.");
859859
return;
860860
}
861861
862862
#endif /* _WIN32 -- This code is for win32 only */
863863
--- src/winhttp.c
+++ src/winhttp.c
@@ -444,11 +444,11 @@
444 ** is logged in.
445 **
446 ** In the following description of the methods, "Fossil-DSCM" will be
447 ** used as the default SERVICE-NAME:
448 **
449 ** fossil service create ?SERVICE-NAME? ?OPTIONS?
450 **
451 ** Creates a service. Available options include:
452 **
453 ** -D|--display DISPLAY-NAME
454 **
@@ -458,11 +458,11 @@
458 **
459 ** -S|--start TYPE
460 **
461 ** Sets the start type of the service. TYPE can be "manual",
462 ** which means you need to start the service yourself with the
463 ** 'fossil service start' command or with the "net start" command
464 ** from the operating system. If TYPE is set to "auto", the service
465 ** will be started automatically by the system during startup.
466 **
467 ** -U|--username USERNAME
468 **
@@ -509,27 +509,27 @@
509 ** Enables automatic login if the --localauth option is present
510 ** and the "localauth" setting is off and the connection is from
511 ** localhost.
512 **
513 **
514 ** fossil service delete ?SERVICE-NAME?
515 **
516 ** Deletes a service. If the service is currently running, it will be
517 ** stopped first and then deleted.
518 **
519 **
520 ** fossil service show ?SERVICE-NAME?
521 **
522 ** Shows how the service is configured and its current state.
523 **
524 **
525 ** fossil service start ?SERVICE-NAME?
526 **
527 ** Start the service.
528 **
529 **
530 ** fossil service stop ?SERVICE-NAME?
531 **
532 ** Stop the service.
533 **
534 **
535 ** NOTE: This command is available on Windows operating systems only and
@@ -852,11 +852,11 @@
852
853 #else /* _WIN32 -- This code is for win32 only */
854 #include "winhttp.h"
855
856 void cmd_win32_service(void){
857 fossil_fatal("The service command is platform specific "
858 "and not available on this platform.");
859 return;
860 }
861
862 #endif /* _WIN32 -- This code is for win32 only */
863
--- src/winhttp.c
+++ src/winhttp.c
@@ -444,11 +444,11 @@
444 ** is logged in.
445 **
446 ** In the following description of the methods, "Fossil-DSCM" will be
447 ** used as the default SERVICE-NAME:
448 **
449 ** fossil winsrv create ?SERVICE-NAME? ?OPTIONS?
450 **
451 ** Creates a service. Available options include:
452 **
453 ** -D|--display DISPLAY-NAME
454 **
@@ -458,11 +458,11 @@
458 **
459 ** -S|--start TYPE
460 **
461 ** Sets the start type of the service. TYPE can be "manual",
462 ** which means you need to start the service yourself with the
463 ** 'fossil winsrv start' command or with the "net start" command
464 ** from the operating system. If TYPE is set to "auto", the service
465 ** will be started automatically by the system during startup.
466 **
467 ** -U|--username USERNAME
468 **
@@ -509,27 +509,27 @@
509 ** Enables automatic login if the --localauth option is present
510 ** and the "localauth" setting is off and the connection is from
511 ** localhost.
512 **
513 **
514 ** fossil winsrv delete ?SERVICE-NAME?
515 **
516 ** Deletes a service. If the service is currently running, it will be
517 ** stopped first and then deleted.
518 **
519 **
520 ** fossil winsrv show ?SERVICE-NAME?
521 **
522 ** Shows how the service is configured and its current state.
523 **
524 **
525 ** fossil winsrv start ?SERVICE-NAME?
526 **
527 ** Start the service.
528 **
529 **
530 ** fossil winsrv stop ?SERVICE-NAME?
531 **
532 ** Stop the service.
533 **
534 **
535 ** NOTE: This command is available on Windows operating systems only and
@@ -852,11 +852,11 @@
852
853 #else /* _WIN32 -- This code is for win32 only */
854 #include "winhttp.h"
855
856 void cmd_win32_service(void){
857 fossil_fatal("The winsrv command is platform specific "
858 "and not available on this platform.");
859 return;
860 }
861
862 #endif /* _WIN32 -- This code is for win32 only */
863

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button