Fossil SCM

Show the number of changes following a "fossil update".

drh 2012-09-06 10:23 trunk merge
Commit 3db1cf69e583250cfbc427097f578c7a1b36421b
2 files changed +12 -2 +12 -2
+12 -2
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105105
int nChng; /* Number of file renames */
106106
int *aChng; /* Array of file renames */
107107
int i; /* Loop counter */
108108
int nConflict = 0; /* Number of merge conflicts */
109109
int nOverwrite = 0; /* Number of unmanaged files overwritten */
110
+ int nUpdate = 0; /* Number of chagnes of any kind */
110111
Stmt mtimeXfer; /* Statment to transfer mtimes */
111112
112113
if( !internalUpdate ){
113114
undo_capture_command_line();
114115
url_proxy_options();
@@ -363,10 +364,11 @@
363364
char nameChng; /* True if the name changed */
364365
365366
zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
366367
zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
367368
nameChng = fossil_strcmp(zName, zNewName);
369
+ nUpdate++;
368370
if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
369371
/* Conflict. This file has been added to the current checkout
370372
** but also exists in the target checkout. Use the current version.
371373
*/
372374
fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
446448
if( nameChng && !nochangeFlag ) file_delete(zFullPath);
447449
blob_reset(&v);
448450
blob_reset(&t);
449451
blob_reset(&r);
450452
}else{
453
+ nUpdate--;
451454
if( chnged ){
452455
if( verboseFlag ) fossil_print("EDITED %s\n", zName);
453456
}else{
454457
db_bind_int(&mtimeXfer, ":idv", idv);
455458
db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
461464
free(zFullPath);
462465
free(zFullNewPath);
463466
}
464467
db_finalize(&q);
465468
db_finalize(&mtimeXfer);
466
- fossil_print("--------------\n");
467
- show_common_info(tid, "updated-to:", 1, 0);
469
+ fossil_print("%.79c\n",'-');
470
+ if( nUpdate==0 ){
471
+ show_common_info(tid, "checkout:", 1, 0);
472
+ fossil_print("%-13s None. Already up-to-date\n", "changes:");
473
+ }else{
474
+ show_common_info(tid, "updated-to:", 1, 0);
475
+ fossil_print("%-13s %d file%s modified.\n", "changes:",
476
+ nUpdate, nUpdate>1 ? "s" : "");
477
+ }
468478
469479
/* Report on conflicts
470480
*/
471481
if( !nochangeFlag ){
472482
Stmt q;
473483
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105 int nChng; /* Number of file renames */
106 int *aChng; /* Array of file renames */
107 int i; /* Loop counter */
108 int nConflict = 0; /* Number of merge conflicts */
109 int nOverwrite = 0; /* Number of unmanaged files overwritten */
 
110 Stmt mtimeXfer; /* Statment to transfer mtimes */
111
112 if( !internalUpdate ){
113 undo_capture_command_line();
114 url_proxy_options();
@@ -363,10 +364,11 @@
363 char nameChng; /* True if the name changed */
364
365 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
366 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
367 nameChng = fossil_strcmp(zName, zNewName);
 
368 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
369 /* Conflict. This file has been added to the current checkout
370 ** but also exists in the target checkout. Use the current version.
371 */
372 fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
446 if( nameChng && !nochangeFlag ) file_delete(zFullPath);
447 blob_reset(&v);
448 blob_reset(&t);
449 blob_reset(&r);
450 }else{
 
451 if( chnged ){
452 if( verboseFlag ) fossil_print("EDITED %s\n", zName);
453 }else{
454 db_bind_int(&mtimeXfer, ":idv", idv);
455 db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
461 free(zFullPath);
462 free(zFullNewPath);
463 }
464 db_finalize(&q);
465 db_finalize(&mtimeXfer);
466 fossil_print("--------------\n");
467 show_common_info(tid, "updated-to:", 1, 0);
 
 
 
 
 
 
 
468
469 /* Report on conflicts
470 */
471 if( !nochangeFlag ){
472 Stmt q;
473
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105 int nChng; /* Number of file renames */
106 int *aChng; /* Array of file renames */
107 int i; /* Loop counter */
108 int nConflict = 0; /* Number of merge conflicts */
109 int nOverwrite = 0; /* Number of unmanaged files overwritten */
110 int nUpdate = 0; /* Number of chagnes of any kind */
111 Stmt mtimeXfer; /* Statment to transfer mtimes */
112
113 if( !internalUpdate ){
114 undo_capture_command_line();
115 url_proxy_options();
@@ -363,10 +364,11 @@
364 char nameChng; /* True if the name changed */
365
366 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
367 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
368 nameChng = fossil_strcmp(zName, zNewName);
369 nUpdate++;
370 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
371 /* Conflict. This file has been added to the current checkout
372 ** but also exists in the target checkout. Use the current version.
373 */
374 fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
448 if( nameChng && !nochangeFlag ) file_delete(zFullPath);
449 blob_reset(&v);
450 blob_reset(&t);
451 blob_reset(&r);
452 }else{
453 nUpdate--;
454 if( chnged ){
455 if( verboseFlag ) fossil_print("EDITED %s\n", zName);
456 }else{
457 db_bind_int(&mtimeXfer, ":idv", idv);
458 db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
464 free(zFullPath);
465 free(zFullNewPath);
466 }
467 db_finalize(&q);
468 db_finalize(&mtimeXfer);
469 fossil_print("%.79c\n",'-');
470 if( nUpdate==0 ){
471 show_common_info(tid, "checkout:", 1, 0);
472 fossil_print("%-13s None. Already up-to-date\n", "changes:");
473 }else{
474 show_common_info(tid, "updated-to:", 1, 0);
475 fossil_print("%-13s %d file%s modified.\n", "changes:",
476 nUpdate, nUpdate>1 ? "s" : "");
477 }
478
479 /* Report on conflicts
480 */
481 if( !nochangeFlag ){
482 Stmt q;
483
+12 -2
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105105
int nChng; /* Number of file renames */
106106
int *aChng; /* Array of file renames */
107107
int i; /* Loop counter */
108108
int nConflict = 0; /* Number of merge conflicts */
109109
int nOverwrite = 0; /* Number of unmanaged files overwritten */
110
+ int nUpdate = 0; /* Number of chagnes of any kind */
110111
Stmt mtimeXfer; /* Statment to transfer mtimes */
111112
112113
if( !internalUpdate ){
113114
undo_capture_command_line();
114115
url_proxy_options();
@@ -363,10 +364,11 @@
363364
char nameChng; /* True if the name changed */
364365
365366
zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
366367
zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
367368
nameChng = fossil_strcmp(zName, zNewName);
369
+ nUpdate++;
368370
if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
369371
/* Conflict. This file has been added to the current checkout
370372
** but also exists in the target checkout. Use the current version.
371373
*/
372374
fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
446448
if( nameChng && !nochangeFlag ) file_delete(zFullPath);
447449
blob_reset(&v);
448450
blob_reset(&t);
449451
blob_reset(&r);
450452
}else{
453
+ nUpdate--;
451454
if( chnged ){
452455
if( verboseFlag ) fossil_print("EDITED %s\n", zName);
453456
}else{
454457
db_bind_int(&mtimeXfer, ":idv", idv);
455458
db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
461464
free(zFullPath);
462465
free(zFullNewPath);
463466
}
464467
db_finalize(&q);
465468
db_finalize(&mtimeXfer);
466
- fossil_print("--------------\n");
467
- show_common_info(tid, "updated-to:", 1, 0);
469
+ fossil_print("%.79c\n",'-');
470
+ if( nUpdate==0 ){
471
+ show_common_info(tid, "checkout:", 1, 0);
472
+ fossil_print("%-13s None. Already up-to-date\n", "changes:");
473
+ }else{
474
+ show_common_info(tid, "updated-to:", 1, 0);
475
+ fossil_print("%-13s %d file%s modified.\n", "changes:",
476
+ nUpdate, nUpdate>1 ? "s" : "");
477
+ }
468478
469479
/* Report on conflicts
470480
*/
471481
if( !nochangeFlag ){
472482
Stmt q;
473483
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105 int nChng; /* Number of file renames */
106 int *aChng; /* Array of file renames */
107 int i; /* Loop counter */
108 int nConflict = 0; /* Number of merge conflicts */
109 int nOverwrite = 0; /* Number of unmanaged files overwritten */
 
110 Stmt mtimeXfer; /* Statment to transfer mtimes */
111
112 if( !internalUpdate ){
113 undo_capture_command_line();
114 url_proxy_options();
@@ -363,10 +364,11 @@
363 char nameChng; /* True if the name changed */
364
365 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
366 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
367 nameChng = fossil_strcmp(zName, zNewName);
 
368 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
369 /* Conflict. This file has been added to the current checkout
370 ** but also exists in the target checkout. Use the current version.
371 */
372 fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
446 if( nameChng && !nochangeFlag ) file_delete(zFullPath);
447 blob_reset(&v);
448 blob_reset(&t);
449 blob_reset(&r);
450 }else{
 
451 if( chnged ){
452 if( verboseFlag ) fossil_print("EDITED %s\n", zName);
453 }else{
454 db_bind_int(&mtimeXfer, ":idv", idv);
455 db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
461 free(zFullPath);
462 free(zFullNewPath);
463 }
464 db_finalize(&q);
465 db_finalize(&mtimeXfer);
466 fossil_print("--------------\n");
467 show_common_info(tid, "updated-to:", 1, 0);
 
 
 
 
 
 
 
468
469 /* Report on conflicts
470 */
471 if( !nochangeFlag ){
472 Stmt q;
473
--- src/update.c
+++ src/update.c
@@ -105,10 +105,11 @@
105 int nChng; /* Number of file renames */
106 int *aChng; /* Array of file renames */
107 int i; /* Loop counter */
108 int nConflict = 0; /* Number of merge conflicts */
109 int nOverwrite = 0; /* Number of unmanaged files overwritten */
110 int nUpdate = 0; /* Number of chagnes of any kind */
111 Stmt mtimeXfer; /* Statment to transfer mtimes */
112
113 if( !internalUpdate ){
114 undo_capture_command_line();
115 url_proxy_options();
@@ -363,10 +364,11 @@
364 char nameChng; /* True if the name changed */
365
366 zFullPath = mprintf("%s%s", g.zLocalRoot, zName);
367 zFullNewPath = mprintf("%s%s", g.zLocalRoot, zNewName);
368 nameChng = fossil_strcmp(zName, zNewName);
369 nUpdate++;
370 if( idv>0 && ridv==0 && idt>0 && ridt>0 ){
371 /* Conflict. This file has been added to the current checkout
372 ** but also exists in the target checkout. Use the current version.
373 */
374 fossil_print("CONFLICT %s\n", zName);
@@ -446,10 +448,11 @@
448 if( nameChng && !nochangeFlag ) file_delete(zFullPath);
449 blob_reset(&v);
450 blob_reset(&t);
451 blob_reset(&r);
452 }else{
453 nUpdate--;
454 if( chnged ){
455 if( verboseFlag ) fossil_print("EDITED %s\n", zName);
456 }else{
457 db_bind_int(&mtimeXfer, ":idv", idv);
458 db_bind_int(&mtimeXfer, ":idt", idt);
@@ -461,12 +464,19 @@
464 free(zFullPath);
465 free(zFullNewPath);
466 }
467 db_finalize(&q);
468 db_finalize(&mtimeXfer);
469 fossil_print("%.79c\n",'-');
470 if( nUpdate==0 ){
471 show_common_info(tid, "checkout:", 1, 0);
472 fossil_print("%-13s None. Already up-to-date\n", "changes:");
473 }else{
474 show_common_info(tid, "updated-to:", 1, 0);
475 fossil_print("%-13s %d file%s modified.\n", "changes:",
476 nUpdate, nUpdate>1 ? "s" : "");
477 }
478
479 /* Report on conflicts
480 */
481 if( !nochangeFlag ){
482 Stmt q;
483

Keyboard Shortcuts

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