Differences From:
File
src/checkin.c
part of check-in
[9c06ea3120]
- Change the "ls" command so that it only shows the filenames by default.
To see the extra information about the status of each file, add the -l
option. Ex: "fossil ls -l"
by
drh on
2009-12-17 14:27:06.
[view]
To:
File
src/checkin.c
part of check-in
[6df39e37f2]
- Update the "checkin" command so that the template check-in message contains
a comment that shows the branch tags that will be associated with the new
check-in.
by
drh on
2009-12-17 14:51:24.
[view]
@@ -262,10 +262,24 @@
** the VISUAL or EDITOR environment variable.
**
** Store the final commit comment in pComment. pComment is assumed
** to be uninitialized - any prior content is overwritten.
+**
+** zInit is the text of the most recent failed attempt to check in
+** this same change. Use zInit to reinitialize the check-in comment
+** so that the user does not have to retype.
+**
+** zBranch is the name of a new branch that this check-in is forced into.
+** zBranch might be NULL or an empty string if no forcing occurs.
+**
+** parent_rid is the recordid of the parent check-in.
*/
-static void prepare_commit_comment(Blob *pComment, char *zInit){
+static void prepare_commit_comment(
+ Blob *pComment,
+ char *zInit,
+ const char *zBranch,
+ int parent_rid
+){
const char *zEditor;
char *zCmd;
char *zFile;
Blob text, line;
@@ -277,8 +291,14 @@
"# Enter comments on this check-in. Lines beginning with # are ignored.\n"
"# The check-in comment follows wiki formatting rules.\n"
"#\n", -1
);
+ if( zBranch && zBranch[0] ){
+ blob_appendf(&text, "# tags: %s\n#\n", zBranch);
+ }else{
+ char *zTags = info_tags_of_checkin(parent_rid);
+ if( zTags ) blob_appendf(&text, "# tags: %z\n#\n", zTags);
+ }
if( g.markPrivate ){
blob_append(&text,
"# PRIVATE BRANCH: This check-in will be private and will not sync to\n"
"# repositories.\n"
@@ -559,9 +579,9 @@
blob_zero(&comment);
blob_read_from_file(&comment, zCommentFile);
}else{
char *zInit = db_text(0, "SELECT value FROM vvar WHERE name='ci-comment'");
- prepare_commit_comment(&comment, zInit);
+ prepare_commit_comment(&comment, zInit, zBranch, vid);
free(zInit);
}
if( blob_size(&comment)==0 ){
Blob ans;