Fossil SCM

The "amend" command only works from within an open check-out.

drh 2017-03-18 12:44 trunk
Commit 8c22e1bbcd8ec048b8062e87cd8a54a9d930f6bb16f7ec745ccbce5ac3d24f5f
3 files changed +2 -1 +4 +1 -1
+2 -1
--- src/checkin.c
+++ src/checkin.c
@@ -1202,12 +1202,13 @@
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
+ assert( g.zLocalRoot!=0 );
12071208
file_relative_name(g.zLocalRoot, &fname, 1);
1208
- zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
1209
+ zFile = db_text(0, "SELECT '%qci-comment-'||hex(randomblob(6))||'.txt'",
12091210
blob_str(&fname));
12101211
blob_reset(&fname);
12111212
}
12121213
#if defined(_WIN32)
12131214
blob_add_cr(pPrompt);
12141215
--- src/checkin.c
+++ src/checkin.c
@@ -1202,12 +1202,13 @@
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 file_relative_name(g.zLocalRoot, &fname, 1);
1208 zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
1209 blob_str(&fname));
1210 blob_reset(&fname);
1211 }
1212 #if defined(_WIN32)
1213 blob_add_cr(pPrompt);
1214
--- src/checkin.c
+++ src/checkin.c
@@ -1202,12 +1202,13 @@
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 }
1213 #if defined(_WIN32)
1214 blob_add_cr(pPrompt);
1215
+4
--- src/db.c
+++ src/db.c
@@ -1615,10 +1615,14 @@
16151615
16161616
/*
16171617
** Open the local database. If unable, exit with an error.
16181618
*/
16191619
void db_must_be_within_tree(void){
1620
+ if( find_repository_option() ){
1621
+ fossil_fatal("the \"%s\" command only work from within an open check-out",
1622
+ g.argv[1]);
1623
+ }
16201624
if( db_open_local(0)==0 ){
16211625
fossil_fatal("current directory is not within an open checkout");
16221626
}
16231627
db_open_repository(0);
16241628
db_verify_schema();
16251629
--- src/db.c
+++ src/db.c
@@ -1615,10 +1615,14 @@
1615
1616 /*
1617 ** Open the local database. If unable, exit with an error.
1618 */
1619 void db_must_be_within_tree(void){
 
 
 
 
1620 if( db_open_local(0)==0 ){
1621 fossil_fatal("current directory is not within an open checkout");
1622 }
1623 db_open_repository(0);
1624 db_verify_schema();
1625
--- src/db.c
+++ src/db.c
@@ -1615,10 +1615,14 @@
1615
1616 /*
1617 ** Open the local database. If unable, exit with an error.
1618 */
1619 void db_must_be_within_tree(void){
1620 if( find_repository_option() ){
1621 fossil_fatal("the \"%s\" command only work from within an open check-out",
1622 g.argv[1]);
1623 }
1624 if( db_open_local(0)==0 ){
1625 fossil_fatal("current directory is not within an open checkout");
1626 }
1627 db_open_repository(0);
1628 db_verify_schema();
1629
+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_find_and_open_repository(0,0);
2951
+ db_must_be_within_tree();
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_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
--- 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

Keyboard Shortcuts

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