Fossil SCM

Rename the 'clearsign' setting to 'pgp-command'. Remove the 'safemerge' setting - safemerge is on by default and cannot be disabled.

drh 2008-02-08 21:42 trunk
Commit 5cc845cfeb32e18a3ce82593b0c8c28387f198c8
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -393,11 +393,11 @@
393393
}
394394
395395
vid = db_lget_int("checkout", 0);
396396
if( db_exists("SELECT 1 FROM plink WHERE pid=%d", vid) ){
397397
wouldFork=1;
398
- if( forceFlag==0 && db_get_int("safemerge", 0)==0 ){
398
+ if( forceFlag==0 ){
399399
fossil_fatal("would fork. use -f or --force");
400400
}
401401
}
402402
vfile_aggregate_checksum_disk(vid, &cksum1);
403403
if( zComment ){
404404
--- src/checkin.c
+++ src/checkin.c
@@ -393,11 +393,11 @@
393 }
394
395 vid = db_lget_int("checkout", 0);
396 if( db_exists("SELECT 1 FROM plink WHERE pid=%d", vid) ){
397 wouldFork=1;
398 if( forceFlag==0 && db_get_int("safemerge", 0)==0 ){
399 fossil_fatal("would fork. use -f or --force");
400 }
401 }
402 vfile_aggregate_checksum_disk(vid, &cksum1);
403 if( zComment ){
404
--- src/checkin.c
+++ src/checkin.c
@@ -393,11 +393,11 @@
393 }
394
395 vid = db_lget_int("checkout", 0);
396 if( db_exists("SELECT 1 FROM plink WHERE pid=%d", vid) ){
397 wouldFork=1;
398 if( forceFlag==0 ){
399 fossil_fatal("would fork. use -f or --force");
400 }
401 }
402 vfile_aggregate_checksum_disk(vid, &cksum1);
403 if( zComment ){
404
+1 -1
--- src/clearsign.c
+++ src/clearsign.c
@@ -34,11 +34,11 @@
3434
*/
3535
int clearsign(Blob *pIn, Blob *pOut){
3636
char *zRand;
3737
char *zIn;
3838
char *zOut;
39
- char *zBase = db_get("clear-sign", "gpg --clearsign -o ");
39
+ char *zBase = db_get("pgp-command", "gpg --clearsign -o ");
4040
char *zCmd;
4141
int rc;
4242
zRand = db_text(0, "SELECT hex(randomblob(10))");
4343
zOut = mprintf("out-%s", zRand);
4444
zIn = mprintf("in-%z", zRand);
4545
--- src/clearsign.c
+++ src/clearsign.c
@@ -34,11 +34,11 @@
34 */
35 int clearsign(Blob *pIn, Blob *pOut){
36 char *zRand;
37 char *zIn;
38 char *zOut;
39 char *zBase = db_get("clear-sign", "gpg --clearsign -o ");
40 char *zCmd;
41 int rc;
42 zRand = db_text(0, "SELECT hex(randomblob(10))");
43 zOut = mprintf("out-%s", zRand);
44 zIn = mprintf("in-%z", zRand);
45
--- src/clearsign.c
+++ src/clearsign.c
@@ -34,11 +34,11 @@
34 */
35 int clearsign(Blob *pIn, Blob *pOut){
36 char *zRand;
37 char *zIn;
38 char *zOut;
39 char *zBase = db_get("pgp-command", "gpg --clearsign -o ");
40 char *zCmd;
41 int rc;
42 zRand = db_text(0, "SELECT hex(randomblob(10))");
43 zOut = mprintf("out-%s", zRand);
44 zIn = mprintf("in-%z", zRand);
45
+4 -10
--- src/db.c
+++ src/db.c
@@ -757,11 +757,10 @@
757757
"INSERT INTO config(name,value)"
758758
" VALUES('project-code', lower(hex(randomblob(20))));"
759759
);
760760
}
761761
if( !db_is_global("autosync") ) db_set_int("autosync", 1, 0);
762
- if( !db_is_global("safemerge") ) db_set_int("safemerge", 0, 0);
763762
if( !db_is_global("localauth") ) db_set_int("localauth", 0, 0);
764763
zUser = db_get("default-user", 0);
765764
if( zUser==0 ){
766765
#ifdef __MINGW32__
767766
zUser = getenv("USERNAME");
@@ -1052,11 +1051,11 @@
10521051
**
10531052
** autosync If enabled, automatically pull prior to
10541053
** commit or update and automatically push
10551054
** after commit or tag or branch creation.
10561055
**
1057
-** clearsign Command used to clear-sign manifests at check-in.
1056
+** pgp-command Command used to clear-sign manifests at check-in.
10581057
** The default is "gpg --clearsign -o ".
10591058
**
10601059
** editor Text editor command used for check-in comments.
10611060
**
10621061
** localauth If enabled, require that HTTP connections from
@@ -1065,28 +1064,23 @@
10651064
** unrestricted access to the repository.
10661065
**
10671066
** omitsign When enabled, fossil will not attempt to sign any
10681067
** commit with gpg. All commits will be unsigned.
10691068
**
1070
-** safemerge If enabled, when commit will cause a fork, the
1071
-** commit will not abort with warning. Also update
1072
-** will not be allowed if local changes exist.
1073
-**
1074
-** diff-command External command to run when performing a diff.
1069
+** diff-command External command to run when performing a diff.
10751070
** If undefined, the internal text diff will be used.
10761071
**
1077
-** gdiff-command External command to run when performing a graphical
1072
+** gdiff-command External command to run when performing a graphical
10781073
** diff. If undefined, text diff will be used.
10791074
*/
10801075
void setting_cmd(void){
10811076
static const char *azName[] = {
10821077
"autosync",
1083
- "clearsign",
1078
+ "pgp-command",
10841079
"editor",
10851080
"localauth",
10861081
"omitsign",
1087
- "safemerge",
10881082
"diff-command",
10891083
"gdiff-command",
10901084
};
10911085
int i;
10921086
int globalFlag = find_option("global","g",0)!=0;
10931087
--- src/db.c
+++ src/db.c
@@ -757,11 +757,10 @@
757 "INSERT INTO config(name,value)"
758 " VALUES('project-code', lower(hex(randomblob(20))));"
759 );
760 }
761 if( !db_is_global("autosync") ) db_set_int("autosync", 1, 0);
762 if( !db_is_global("safemerge") ) db_set_int("safemerge", 0, 0);
763 if( !db_is_global("localauth") ) db_set_int("localauth", 0, 0);
764 zUser = db_get("default-user", 0);
765 if( zUser==0 ){
766 #ifdef __MINGW32__
767 zUser = getenv("USERNAME");
@@ -1052,11 +1051,11 @@
1052 **
1053 ** autosync If enabled, automatically pull prior to
1054 ** commit or update and automatically push
1055 ** after commit or tag or branch creation.
1056 **
1057 ** clearsign Command used to clear-sign manifests at check-in.
1058 ** The default is "gpg --clearsign -o ".
1059 **
1060 ** editor Text editor command used for check-in comments.
1061 **
1062 ** localauth If enabled, require that HTTP connections from
@@ -1065,28 +1064,23 @@
1065 ** unrestricted access to the repository.
1066 **
1067 ** omitsign When enabled, fossil will not attempt to sign any
1068 ** commit with gpg. All commits will be unsigned.
1069 **
1070 ** safemerge If enabled, when commit will cause a fork, the
1071 ** commit will not abort with warning. Also update
1072 ** will not be allowed if local changes exist.
1073 **
1074 ** diff-command External command to run when performing a diff.
1075 ** If undefined, the internal text diff will be used.
1076 **
1077 ** gdiff-command External command to run when performing a graphical
1078 ** diff. If undefined, text diff will be used.
1079 */
1080 void setting_cmd(void){
1081 static const char *azName[] = {
1082 "autosync",
1083 "clearsign",
1084 "editor",
1085 "localauth",
1086 "omitsign",
1087 "safemerge",
1088 "diff-command",
1089 "gdiff-command",
1090 };
1091 int i;
1092 int globalFlag = find_option("global","g",0)!=0;
1093
--- src/db.c
+++ src/db.c
@@ -757,11 +757,10 @@
757 "INSERT INTO config(name,value)"
758 " VALUES('project-code', lower(hex(randomblob(20))));"
759 );
760 }
761 if( !db_is_global("autosync") ) db_set_int("autosync", 1, 0);
 
762 if( !db_is_global("localauth") ) db_set_int("localauth", 0, 0);
763 zUser = db_get("default-user", 0);
764 if( zUser==0 ){
765 #ifdef __MINGW32__
766 zUser = getenv("USERNAME");
@@ -1052,11 +1051,11 @@
1051 **
1052 ** autosync If enabled, automatically pull prior to
1053 ** commit or update and automatically push
1054 ** after commit or tag or branch creation.
1055 **
1056 ** pgp-command Command used to clear-sign manifests at check-in.
1057 ** The default is "gpg --clearsign -o ".
1058 **
1059 ** editor Text editor command used for check-in comments.
1060 **
1061 ** localauth If enabled, require that HTTP connections from
@@ -1065,28 +1064,23 @@
1064 ** unrestricted access to the repository.
1065 **
1066 ** omitsign When enabled, fossil will not attempt to sign any
1067 ** commit with gpg. All commits will be unsigned.
1068 **
1069 ** diff-command External command to run when performing a diff.
 
 
 
 
1070 ** If undefined, the internal text diff will be used.
1071 **
1072 ** gdiff-command External command to run when performing a graphical
1073 ** diff. If undefined, text diff will be used.
1074 */
1075 void setting_cmd(void){
1076 static const char *azName[] = {
1077 "autosync",
1078 "pgp-command",
1079 "editor",
1080 "localauth",
1081 "omitsign",
 
1082 "diff-command",
1083 "gdiff-command",
1084 };
1085 int i;
1086 int globalFlag = find_option("global","g",0)!=0;
1087
+7 -7
--- src/update.c
+++ src/update.c
@@ -36,24 +36,20 @@
3636
}
3737
3838
/*
3939
** COMMAND: update
4040
**
41
-** Usage: %fossil update ?VERSION? ?--force? ?--latest?
41
+** Usage: %fossil update ?VERSION? ?--latest?
4242
**
4343
** The optional argument is a version that should become the current
4444
** version. If the argument is omitted, then use the leaf of the
4545
** tree that begins with the current version, if there is only a
4646
** single leaf. If there are a multiple leaves, the latest is used
4747
** if the --latest flag is present.
4848
**
4949
** This command is different from the "checkout" in that edits are
5050
** not overwritten. Edits are merged into the new version.
51
-**
52
-** If there are uncommitted edits and the safemerge option is
53
-** enabled then no update will occur unless you provide the
54
-** --force flag.
5551
*/
5652
void update_cmd(void){
5753
int vid; /* Current version */
5854
int tid=0; /* Target version - version we are changing to */
5955
Stmt q;
@@ -71,13 +67,17 @@
7167
fossil_fatal("cannot find current version");
7268
}
7369
if( db_exists("SELECT 1 FROM vmerge") ){
7470
fossil_fatal("cannot update an uncommitted merge");
7571
}
76
- if( !forceFlag && db_get_int("safemerge", 0) && unsaved_changes() ){
77
- fossil_fatal("there are uncommitted changes and safemerge is enabled");
72
+#if 0
73
+ /* Always do the update. If it does not work out, the user can back out
74
+ ** the changes using "undo" */
75
+ if( !forceFlag && unsaved_changes() ){
76
+ fossil_fatal("uncommitted changes; use -f or --force to override");
7877
}
78
+#endif
7979
8080
if( g.argc==3 ){
8181
tid = name_to_rid(g.argv[2]);
8282
if( tid==0 ){
8383
fossil_fatal("not a version: %s", g.argv[2]);
8484
--- src/update.c
+++ src/update.c
@@ -36,24 +36,20 @@
36 }
37
38 /*
39 ** COMMAND: update
40 **
41 ** Usage: %fossil update ?VERSION? ?--force? ?--latest?
42 **
43 ** The optional argument is a version that should become the current
44 ** version. If the argument is omitted, then use the leaf of the
45 ** tree that begins with the current version, if there is only a
46 ** single leaf. If there are a multiple leaves, the latest is used
47 ** if the --latest flag is present.
48 **
49 ** This command is different from the "checkout" in that edits are
50 ** not overwritten. Edits are merged into the new version.
51 **
52 ** If there are uncommitted edits and the safemerge option is
53 ** enabled then no update will occur unless you provide the
54 ** --force flag.
55 */
56 void update_cmd(void){
57 int vid; /* Current version */
58 int tid=0; /* Target version - version we are changing to */
59 Stmt q;
@@ -71,13 +67,17 @@
71 fossil_fatal("cannot find current version");
72 }
73 if( db_exists("SELECT 1 FROM vmerge") ){
74 fossil_fatal("cannot update an uncommitted merge");
75 }
76 if( !forceFlag && db_get_int("safemerge", 0) && unsaved_changes() ){
77 fossil_fatal("there are uncommitted changes and safemerge is enabled");
 
 
 
78 }
 
79
80 if( g.argc==3 ){
81 tid = name_to_rid(g.argv[2]);
82 if( tid==0 ){
83 fossil_fatal("not a version: %s", g.argv[2]);
84
--- src/update.c
+++ src/update.c
@@ -36,24 +36,20 @@
36 }
37
38 /*
39 ** COMMAND: update
40 **
41 ** Usage: %fossil update ?VERSION? ?--latest?
42 **
43 ** The optional argument is a version that should become the current
44 ** version. If the argument is omitted, then use the leaf of the
45 ** tree that begins with the current version, if there is only a
46 ** single leaf. If there are a multiple leaves, the latest is used
47 ** if the --latest flag is present.
48 **
49 ** This command is different from the "checkout" in that edits are
50 ** not overwritten. Edits are merged into the new version.
 
 
 
 
51 */
52 void update_cmd(void){
53 int vid; /* Current version */
54 int tid=0; /* Target version - version we are changing to */
55 Stmt q;
@@ -71,13 +67,17 @@
67 fossil_fatal("cannot find current version");
68 }
69 if( db_exists("SELECT 1 FROM vmerge") ){
70 fossil_fatal("cannot update an uncommitted merge");
71 }
72 #if 0
73 /* Always do the update. If it does not work out, the user can back out
74 ** the changes using "undo" */
75 if( !forceFlag && unsaved_changes() ){
76 fossil_fatal("uncommitted changes; use -f or --force to override");
77 }
78 #endif
79
80 if( g.argc==3 ){
81 tid = name_to_rid(g.argv[2]);
82 if( tid==0 ){
83 fossil_fatal("not a version: %s", g.argv[2]);
84

Keyboard Shortcuts

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