Fossil SCM

Restore the ability to use amend outside an open check-out disabled by [8c22e1bbcd8ec048]. Only allow interactive edits within an open check-out. Perhaps unixTempFileDir() could be used to locate a suitable TMP location for the edit in the event that there is not an open-checkout.

andybradford 2017-05-26 03:46 UTC trunk
Commit afef5fb5fc49fdd92fa497a3394153a2c3a36c029cd685062951af074d620290
2 files changed +2 +1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -1202,10 +1202,12 @@
12021202
"# Type \".\" on a line by itself when you are done:\n", -1);
12031203
zFile = mprintf("-");
12041204
}else{
12051205
Blob fname;
12061206
blob_zero(&fname);
1207
+ if ( g.zRepositoryOption )
1208
+ fossil_fatal("interactive edits must be done within an open check-out");
12071209
assert( g.zLocalRoot!=0 );
12081210
file_relative_name(g.zLocalRoot, &fname, 1);
12091211
zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
12101212
blob_str(&fname));
12111213
blob_reset(&fname);
12121214
--- src/checkin.c
+++ src/checkin.c
@@ -1202,10 +1202,12 @@
1202 "# Type \".\" on a line by itself when you are done:\n", -1);
1203 zFile = mprintf("-");
1204 }else{
1205 Blob fname;
1206 blob_zero(&fname);
 
 
1207 assert( g.zLocalRoot!=0 );
1208 file_relative_name(g.zLocalRoot, &fname, 1);
1209 zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
1210 blob_str(&fname));
1211 blob_reset(&fname);
1212
--- src/checkin.c
+++ src/checkin.c
@@ -1202,10 +1202,12 @@
1202 "# Type \".\" on a line by itself when you are done:\n", -1);
1203 zFile = mprintf("-");
1204 }else{
1205 Blob fname;
1206 blob_zero(&fname);
1207 if ( g.zRepositoryOption )
1208 fossil_fatal("interactive edits must be done within an open check-out");
1209 assert( g.zLocalRoot!=0 );
1210 file_relative_name(g.zLocalRoot, &fname, 1);
1211 zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
1212 blob_str(&fname));
1213 blob_reset(&fname);
1214
+1 -1
--- src/info.c
+++ src/info.c
@@ -2946,11 +2946,11 @@
29462946
pzNewTags = find_repeatable_option("tag",0,&nTags);
29472947
pzCancelTags = find_repeatable_option("cancel",0,&nCancels);
29482948
fClose = find_option("close",0,0)!=0;
29492949
fHide = find_option("hide",0,0)!=0;
29502950
zChngTime = find_option("chngtime",0,1);
2951
- db_must_be_within_tree();
2951
+ db_find_and_open_repository(0,0);
29522952
user_select();
29532953
verify_all_options();
29542954
if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT);
29552955
rid = name_to_typed_rid(g.argv[2], "ci");
29562956
if( rid==0 && !is_a_version(rid) ) fossil_fatal("no such check-in");
29572957
--- src/info.c
+++ src/info.c
@@ -2946,11 +2946,11 @@
2946 pzNewTags = find_repeatable_option("tag",0,&nTags);
2947 pzCancelTags = find_repeatable_option("cancel",0,&nCancels);
2948 fClose = find_option("close",0,0)!=0;
2949 fHide = find_option("hide",0,0)!=0;
2950 zChngTime = find_option("chngtime",0,1);
2951 db_must_be_within_tree();
2952 user_select();
2953 verify_all_options();
2954 if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT);
2955 rid = name_to_typed_rid(g.argv[2], "ci");
2956 if( rid==0 && !is_a_version(rid) ) fossil_fatal("no such check-in");
2957
--- src/info.c
+++ src/info.c
@@ -2946,11 +2946,11 @@
2946 pzNewTags = find_repeatable_option("tag",0,&nTags);
2947 pzCancelTags = find_repeatable_option("cancel",0,&nCancels);
2948 fClose = find_option("close",0,0)!=0;
2949 fHide = find_option("hide",0,0)!=0;
2950 zChngTime = find_option("chngtime",0,1);
2951 db_find_and_open_repository(0,0);
2952 user_select();
2953 verify_all_options();
2954 if( g.argc<3 || g.argc>=4 ) usage(AMEND_USAGE_STMT);
2955 rid = name_to_typed_rid(g.argv[2], "ci");
2956 if( rid==0 && !is_a_version(rid) ) fossil_fatal("no such check-in");
2957

Keyboard Shortcuts

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