Fossil SCM
merge trunk
Commit
2b63068b4a299d751c6b5813f87c1db576890b84
Parent
df71e9d360476d4…
2 files changed
+4
-1
+12
-5
+4
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1002,10 +1002,11 @@ | ||
| 1002 | 1002 | ** --message-file|-M FILE read the commit comment from given file |
| 1003 | 1003 | ** --nosign do not attempt to sign this commit with gpg |
| 1004 | 1004 | ** --private do not sync changes and their descendants |
| 1005 | 1005 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1006 | 1006 | ** --conflict allow unresolved merge conflicts |
| 1007 | +** --binary-ok do not warn about committing binary files | |
| 1007 | 1008 | ** |
| 1008 | 1009 | ** See also: branch, changes, checkout, extra, sync |
| 1009 | 1010 | */ |
| 1010 | 1011 | void commit_cmd(void){ |
| 1011 | 1012 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -1020,10 +1021,11 @@ | ||
| 1020 | 1021 | int isAMerge = 0; /* True if checking in a merge */ |
| 1021 | 1022 | int forceFlag = 0; /* Force a fork */ |
| 1022 | 1023 | int forceDelta = 0; /* Force a delta-manifest */ |
| 1023 | 1024 | int forceBaseline = 0; /* Force a baseline-manifest */ |
| 1024 | 1025 | int allowConflict = 0; /* Allow unresolve merge conflicts */ |
| 1026 | + int binaryOk = 0; /* The --binary-ok flag */ | |
| 1025 | 1027 | char *zManifestFile; /* Name of the manifest file */ |
| 1026 | 1028 | int useCksum; /* True if checksums should be computed and verified */ |
| 1027 | 1029 | int outputManifest; /* True to output "manifest" and "manifest.uuid" */ |
| 1028 | 1030 | int testRun; /* True for a test run. Debugging only */ |
| 1029 | 1031 | const char *zBranch; /* Create a new branch with this name */ |
| @@ -1056,10 +1058,11 @@ | ||
| 1056 | 1058 | zComment = find_option("comment","m",1); |
| 1057 | 1059 | forceFlag = find_option("force", "f", 0)!=0; |
| 1058 | 1060 | zBranch = find_option("branch","b",1); |
| 1059 | 1061 | zColor = find_option("bgcolor",0,1); |
| 1060 | 1062 | zBrClr = find_option("branchcolor",0,1); |
| 1063 | + binaryOk = find_option("binary-ok",0,0)!=0; | |
| 1061 | 1064 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1062 | 1065 | if( zTag[0]==0 ) continue; |
| 1063 | 1066 | azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2)); |
| 1064 | 1067 | azTag[nTag++] = zTag; |
| 1065 | 1068 | azTag[nTag] = 0; |
| @@ -1265,11 +1268,11 @@ | ||
| 1265 | 1268 | id = db_column_int(&q, 0); |
| 1266 | 1269 | zFullname = db_column_text(&q, 1); |
| 1267 | 1270 | rid = db_column_int(&q, 2); |
| 1268 | 1271 | crnlOk = db_column_int(&q, 3); |
| 1269 | 1272 | chnged = db_column_int(&q, 4); |
| 1270 | - binOk = db_column_int(&q, 5); | |
| 1273 | + binOk = binaryOk || db_column_int(&q, 5); | |
| 1271 | 1274 | |
| 1272 | 1275 | blob_zero(&content); |
| 1273 | 1276 | if( file_wd_islink(zFullname) ){ |
| 1274 | 1277 | /* Instead of file content, put link destination path */ |
| 1275 | 1278 | blob_read_link(&content, zFullname); |
| 1276 | 1279 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1002,10 +1002,11 @@ | |
| 1002 | ** --message-file|-M FILE read the commit comment from given file |
| 1003 | ** --nosign do not attempt to sign this commit with gpg |
| 1004 | ** --private do not sync changes and their descendants |
| 1005 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1006 | ** --conflict allow unresolved merge conflicts |
| 1007 | ** |
| 1008 | ** See also: branch, changes, checkout, extra, sync |
| 1009 | */ |
| 1010 | void commit_cmd(void){ |
| 1011 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -1020,10 +1021,11 @@ | |
| 1020 | int isAMerge = 0; /* True if checking in a merge */ |
| 1021 | int forceFlag = 0; /* Force a fork */ |
| 1022 | int forceDelta = 0; /* Force a delta-manifest */ |
| 1023 | int forceBaseline = 0; /* Force a baseline-manifest */ |
| 1024 | int allowConflict = 0; /* Allow unresolve merge conflicts */ |
| 1025 | char *zManifestFile; /* Name of the manifest file */ |
| 1026 | int useCksum; /* True if checksums should be computed and verified */ |
| 1027 | int outputManifest; /* True to output "manifest" and "manifest.uuid" */ |
| 1028 | int testRun; /* True for a test run. Debugging only */ |
| 1029 | const char *zBranch; /* Create a new branch with this name */ |
| @@ -1056,10 +1058,11 @@ | |
| 1056 | zComment = find_option("comment","m",1); |
| 1057 | forceFlag = find_option("force", "f", 0)!=0; |
| 1058 | zBranch = find_option("branch","b",1); |
| 1059 | zColor = find_option("bgcolor",0,1); |
| 1060 | zBrClr = find_option("branchcolor",0,1); |
| 1061 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1062 | if( zTag[0]==0 ) continue; |
| 1063 | azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2)); |
| 1064 | azTag[nTag++] = zTag; |
| 1065 | azTag[nTag] = 0; |
| @@ -1265,11 +1268,11 @@ | |
| 1265 | id = db_column_int(&q, 0); |
| 1266 | zFullname = db_column_text(&q, 1); |
| 1267 | rid = db_column_int(&q, 2); |
| 1268 | crnlOk = db_column_int(&q, 3); |
| 1269 | chnged = db_column_int(&q, 4); |
| 1270 | binOk = db_column_int(&q, 5); |
| 1271 | |
| 1272 | blob_zero(&content); |
| 1273 | if( file_wd_islink(zFullname) ){ |
| 1274 | /* Instead of file content, put link destination path */ |
| 1275 | blob_read_link(&content, zFullname); |
| 1276 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1002,10 +1002,11 @@ | |
| 1002 | ** --message-file|-M FILE read the commit comment from given file |
| 1003 | ** --nosign do not attempt to sign this commit with gpg |
| 1004 | ** --private do not sync changes and their descendants |
| 1005 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1006 | ** --conflict allow unresolved merge conflicts |
| 1007 | ** --binary-ok do not warn about committing binary files |
| 1008 | ** |
| 1009 | ** See also: branch, changes, checkout, extra, sync |
| 1010 | */ |
| 1011 | void commit_cmd(void){ |
| 1012 | int hasChanges; /* True if unsaved changes exist */ |
| @@ -1020,10 +1021,11 @@ | |
| 1021 | int isAMerge = 0; /* True if checking in a merge */ |
| 1022 | int forceFlag = 0; /* Force a fork */ |
| 1023 | int forceDelta = 0; /* Force a delta-manifest */ |
| 1024 | int forceBaseline = 0; /* Force a baseline-manifest */ |
| 1025 | int allowConflict = 0; /* Allow unresolve merge conflicts */ |
| 1026 | int binaryOk = 0; /* The --binary-ok flag */ |
| 1027 | char *zManifestFile; /* Name of the manifest file */ |
| 1028 | int useCksum; /* True if checksums should be computed and verified */ |
| 1029 | int outputManifest; /* True to output "manifest" and "manifest.uuid" */ |
| 1030 | int testRun; /* True for a test run. Debugging only */ |
| 1031 | const char *zBranch; /* Create a new branch with this name */ |
| @@ -1056,10 +1058,11 @@ | |
| 1058 | zComment = find_option("comment","m",1); |
| 1059 | forceFlag = find_option("force", "f", 0)!=0; |
| 1060 | zBranch = find_option("branch","b",1); |
| 1061 | zColor = find_option("bgcolor",0,1); |
| 1062 | zBrClr = find_option("branchcolor",0,1); |
| 1063 | binaryOk = find_option("binary-ok",0,0)!=0; |
| 1064 | while( (zTag = find_option("tag",0,1))!=0 ){ |
| 1065 | if( zTag[0]==0 ) continue; |
| 1066 | azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2)); |
| 1067 | azTag[nTag++] = zTag; |
| 1068 | azTag[nTag] = 0; |
| @@ -1265,11 +1268,11 @@ | |
| 1268 | id = db_column_int(&q, 0); |
| 1269 | zFullname = db_column_text(&q, 1); |
| 1270 | rid = db_column_int(&q, 2); |
| 1271 | crnlOk = db_column_int(&q, 3); |
| 1272 | chnged = db_column_int(&q, 4); |
| 1273 | binOk = binaryOk || db_column_int(&q, 5); |
| 1274 | |
| 1275 | blob_zero(&content); |
| 1276 | if( file_wd_islink(zFullname) ){ |
| 1277 | /* Instead of file content, put link destination path */ |
| 1278 | blob_read_link(&content, zFullname); |
| 1279 |
+12
-5
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -110,10 +110,12 @@ | ||
| 110 | 110 | */ |
| 111 | 111 | const char *zSsh; /* The base SSH command */ |
| 112 | 112 | Blob zCmd; /* The SSH command */ |
| 113 | 113 | char *zHost; /* The host name to contact */ |
| 114 | 114 | char *zIn; /* An input line received back from remote */ |
| 115 | + unsigned iRandom; | |
| 116 | + char zProbe[30]; | |
| 115 | 117 | |
| 116 | 118 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 117 | 119 | blob_init(&zCmd, zSsh, -1); |
| 118 | 120 | if( g.urlPort!=g.urlDfltPort ){ |
| 119 | 121 | #ifdef __MINGW32__ |
| @@ -155,18 +157,23 @@ | ||
| 155 | 157 | if( sshPid==0 ){ |
| 156 | 158 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 157 | 159 | } |
| 158 | 160 | blob_reset(&zCmd); |
| 159 | 161 | |
| 160 | - /* Send an "echo" command to the other side to make sure that the | |
| 162 | + /* Send a couple of "echo" command to the other side to make sure that the | |
| 161 | 163 | ** connection is up and working. |
| 162 | 164 | */ |
| 163 | - fprintf(sshOut, "echo test\n"); | |
| 165 | + fprintf(sshOut, "echo test1\n"); | |
| 166 | + fflush(sshOut); | |
| 167 | + zIn = fossil_malloc(50000); | |
| 168 | + sshin_read(zIn, 50000); | |
| 169 | + sqlite3_randomness(sizeof(iRandom), &iRandom); | |
| 170 | + sqlite3_snprintf(sizeof(zProbe), zProbe, "probe-%08x", iRandom); | |
| 171 | + fprintf(sshOut, "echo %s\n", zProbe); | |
| 164 | 172 | fflush(sshOut); |
| 165 | - zIn = fossil_malloc(16000); | |
| 166 | - sshin_read(zIn, 16000); | |
| 167 | - if( memcmp(zIn, "test", 4)!=0 ){ | |
| 173 | + sshin_read(zIn, 500); | |
| 174 | + if( memcmp(zIn, zProbe, 14)!=0 ){ | |
| 168 | 175 | pclose2(sshIn, sshOut, sshPid); |
| 169 | 176 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 170 | 177 | } |
| 171 | 178 | fossil_free(zIn); |
| 172 | 179 | } |
| 173 | 180 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -110,10 +110,12 @@ | |
| 110 | */ |
| 111 | const char *zSsh; /* The base SSH command */ |
| 112 | Blob zCmd; /* The SSH command */ |
| 113 | char *zHost; /* The host name to contact */ |
| 114 | char *zIn; /* An input line received back from remote */ |
| 115 | |
| 116 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 117 | blob_init(&zCmd, zSsh, -1); |
| 118 | if( g.urlPort!=g.urlDfltPort ){ |
| 119 | #ifdef __MINGW32__ |
| @@ -155,18 +157,23 @@ | |
| 155 | if( sshPid==0 ){ |
| 156 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 157 | } |
| 158 | blob_reset(&zCmd); |
| 159 | |
| 160 | /* Send an "echo" command to the other side to make sure that the |
| 161 | ** connection is up and working. |
| 162 | */ |
| 163 | fprintf(sshOut, "echo test\n"); |
| 164 | fflush(sshOut); |
| 165 | zIn = fossil_malloc(16000); |
| 166 | sshin_read(zIn, 16000); |
| 167 | if( memcmp(zIn, "test", 4)!=0 ){ |
| 168 | pclose2(sshIn, sshOut, sshPid); |
| 169 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 170 | } |
| 171 | fossil_free(zIn); |
| 172 | } |
| 173 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -110,10 +110,12 @@ | |
| 110 | */ |
| 111 | const char *zSsh; /* The base SSH command */ |
| 112 | Blob zCmd; /* The SSH command */ |
| 113 | char *zHost; /* The host name to contact */ |
| 114 | char *zIn; /* An input line received back from remote */ |
| 115 | unsigned iRandom; |
| 116 | char zProbe[30]; |
| 117 | |
| 118 | zSsh = db_get("ssh-command", zDefaultSshCmd); |
| 119 | blob_init(&zCmd, zSsh, -1); |
| 120 | if( g.urlPort!=g.urlDfltPort ){ |
| 121 | #ifdef __MINGW32__ |
| @@ -155,18 +157,23 @@ | |
| 157 | if( sshPid==0 ){ |
| 158 | fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd); |
| 159 | } |
| 160 | blob_reset(&zCmd); |
| 161 | |
| 162 | /* Send a couple of "echo" command to the other side to make sure that the |
| 163 | ** connection is up and working. |
| 164 | */ |
| 165 | fprintf(sshOut, "echo test1\n"); |
| 166 | fflush(sshOut); |
| 167 | zIn = fossil_malloc(50000); |
| 168 | sshin_read(zIn, 50000); |
| 169 | sqlite3_randomness(sizeof(iRandom), &iRandom); |
| 170 | sqlite3_snprintf(sizeof(zProbe), zProbe, "probe-%08x", iRandom); |
| 171 | fprintf(sshOut, "echo %s\n", zProbe); |
| 172 | fflush(sshOut); |
| 173 | sshin_read(zIn, 500); |
| 174 | if( memcmp(zIn, zProbe, 14)!=0 ){ |
| 175 | pclose2(sshIn, sshOut, sshPid); |
| 176 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 177 | } |
| 178 | fossil_free(zIn); |
| 179 | } |
| 180 |