Fossil SCM

Show overridden user in commit comment. Ticket [4af785ba].

dchest 2011-09-11 12:19 trunk
Commit 7c82dbf5465f7b4d303f32a02811c435c6bb1717
1 file changed +4 -3
+4 -3
--- src/checkin.c
+++ src/checkin.c
@@ -415,11 +415,12 @@
415415
*/
416416
static void prepare_commit_comment(
417417
Blob *pComment,
418418
char *zInit,
419419
const char *zBranch,
420
- int parent_rid
420
+ int parent_rid,
421
+ const char *zUserOvrd
421422
){
422423
const char *zEditor;
423424
char *zCmd;
424425
char *zFile;
425426
Blob text, line;
@@ -430,11 +431,11 @@
430431
"\n"
431432
"# Enter comments on this check-in. Lines beginning with # are ignored.\n"
432433
"# The check-in comment follows wiki formatting rules.\n"
433434
"#\n", -1
434435
);
435
- blob_appendf(&text, "# user: %s\n", g.zLogin);
436
+ blob_appendf(&text, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin);
436437
if( zBranch && zBranch[0] ){
437438
blob_appendf(&text, "# tags: %s\n#\n", zBranch);
438439
}else{
439440
char *zTags = info_tags_of_checkin(parent_rid, 1);
440441
if( zTags ) blob_appendf(&text, "# tags: %z\n#\n", zTags);
@@ -1034,11 +1035,11 @@
10341035
}else if( zComFile ){
10351036
blob_zero(&comment);
10361037
blob_read_from_file(&comment, zComFile);
10371038
}else{
10381039
char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1039
- prepare_commit_comment(&comment, zInit, zBranch, vid);
1040
+ prepare_commit_comment(&comment, zInit, zBranch, vid, zUserOvrd);
10401041
free(zInit);
10411042
}
10421043
if( blob_size(&comment)==0 ){
10431044
Blob ans;
10441045
blob_zero(&ans);
10451046
--- src/checkin.c
+++ src/checkin.c
@@ -415,11 +415,12 @@
415 */
416 static void prepare_commit_comment(
417 Blob *pComment,
418 char *zInit,
419 const char *zBranch,
420 int parent_rid
 
421 ){
422 const char *zEditor;
423 char *zCmd;
424 char *zFile;
425 Blob text, line;
@@ -430,11 +431,11 @@
430 "\n"
431 "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
432 "# The check-in comment follows wiki formatting rules.\n"
433 "#\n", -1
434 );
435 blob_appendf(&text, "# user: %s\n", g.zLogin);
436 if( zBranch && zBranch[0] ){
437 blob_appendf(&text, "# tags: %s\n#\n", zBranch);
438 }else{
439 char *zTags = info_tags_of_checkin(parent_rid, 1);
440 if( zTags ) blob_appendf(&text, "# tags: %z\n#\n", zTags);
@@ -1034,11 +1035,11 @@
1034 }else if( zComFile ){
1035 blob_zero(&comment);
1036 blob_read_from_file(&comment, zComFile);
1037 }else{
1038 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1039 prepare_commit_comment(&comment, zInit, zBranch, vid);
1040 free(zInit);
1041 }
1042 if( blob_size(&comment)==0 ){
1043 Blob ans;
1044 blob_zero(&ans);
1045
--- src/checkin.c
+++ src/checkin.c
@@ -415,11 +415,12 @@
415 */
416 static void prepare_commit_comment(
417 Blob *pComment,
418 char *zInit,
419 const char *zBranch,
420 int parent_rid,
421 const char *zUserOvrd
422 ){
423 const char *zEditor;
424 char *zCmd;
425 char *zFile;
426 Blob text, line;
@@ -430,11 +431,11 @@
431 "\n"
432 "# Enter comments on this check-in. Lines beginning with # are ignored.\n"
433 "# The check-in comment follows wiki formatting rules.\n"
434 "#\n", -1
435 );
436 blob_appendf(&text, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin);
437 if( zBranch && zBranch[0] ){
438 blob_appendf(&text, "# tags: %s\n#\n", zBranch);
439 }else{
440 char *zTags = info_tags_of_checkin(parent_rid, 1);
441 if( zTags ) blob_appendf(&text, "# tags: %z\n#\n", zTags);
@@ -1034,11 +1035,11 @@
1035 }else if( zComFile ){
1036 blob_zero(&comment);
1037 blob_read_from_file(&comment, zComFile);
1038 }else{
1039 char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
1040 prepare_commit_comment(&comment, zInit, zBranch, vid, zUserOvrd);
1041 free(zInit);
1042 }
1043 if( blob_size(&comment)==0 ){
1044 Blob ans;
1045 blob_zero(&ans);
1046

Keyboard Shortcuts

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