Fossil SCM

merge trunk

jan.nijtmans 2012-11-12 13:17 UTC ticket-fb3057f6ed merge
Commit 2b63068b4a299d751c6b5813f87c1db576890b84
2 files changed +4 -1 +12 -5
+4 -1
--- src/checkin.c
+++ src/checkin.c
@@ -1002,10 +1002,11 @@
10021002
** --message-file|-M FILE read the commit comment from given file
10031003
** --nosign do not attempt to sign this commit with gpg
10041004
** --private do not sync changes and their descendants
10051005
** --tag TAG-NAME assign given tag TAG-NAME to the checkin
10061006
** --conflict allow unresolved merge conflicts
1007
+** --binary-ok do not warn about committing binary files
10071008
**
10081009
** See also: branch, changes, checkout, extra, sync
10091010
*/
10101011
void commit_cmd(void){
10111012
int hasChanges; /* True if unsaved changes exist */
@@ -1020,10 +1021,11 @@
10201021
int isAMerge = 0; /* True if checking in a merge */
10211022
int forceFlag = 0; /* Force a fork */
10221023
int forceDelta = 0; /* Force a delta-manifest */
10231024
int forceBaseline = 0; /* Force a baseline-manifest */
10241025
int allowConflict = 0; /* Allow unresolve merge conflicts */
1026
+ int binaryOk = 0; /* The --binary-ok flag */
10251027
char *zManifestFile; /* Name of the manifest file */
10261028
int useCksum; /* True if checksums should be computed and verified */
10271029
int outputManifest; /* True to output "manifest" and "manifest.uuid" */
10281030
int testRun; /* True for a test run. Debugging only */
10291031
const char *zBranch; /* Create a new branch with this name */
@@ -1056,10 +1058,11 @@
10561058
zComment = find_option("comment","m",1);
10571059
forceFlag = find_option("force", "f", 0)!=0;
10581060
zBranch = find_option("branch","b",1);
10591061
zColor = find_option("bgcolor",0,1);
10601062
zBrClr = find_option("branchcolor",0,1);
1063
+ binaryOk = find_option("binary-ok",0,0)!=0;
10611064
while( (zTag = find_option("tag",0,1))!=0 ){
10621065
if( zTag[0]==0 ) continue;
10631066
azTag = fossil_realloc((void *)azTag, sizeof(char*)*(nTag+2));
10641067
azTag[nTag++] = zTag;
10651068
azTag[nTag] = 0;
@@ -1265,11 +1268,11 @@
12651268
id = db_column_int(&q, 0);
12661269
zFullname = db_column_text(&q, 1);
12671270
rid = db_column_int(&q, 2);
12681271
crnlOk = db_column_int(&q, 3);
12691272
chnged = db_column_int(&q, 4);
1270
- binOk = db_column_int(&q, 5);
1273
+ binOk = binaryOk || db_column_int(&q, 5);
12711274
12721275
blob_zero(&content);
12731276
if( file_wd_islink(zFullname) ){
12741277
/* Instead of file content, put link destination path */
12751278
blob_read_link(&content, zFullname);
12761279
--- 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
--- src/http_transport.c
+++ src/http_transport.c
@@ -110,10 +110,12 @@
110110
*/
111111
const char *zSsh; /* The base SSH command */
112112
Blob zCmd; /* The SSH command */
113113
char *zHost; /* The host name to contact */
114114
char *zIn; /* An input line received back from remote */
115
+ unsigned iRandom;
116
+ char zProbe[30];
115117
116118
zSsh = db_get("ssh-command", zDefaultSshCmd);
117119
blob_init(&zCmd, zSsh, -1);
118120
if( g.urlPort!=g.urlDfltPort ){
119121
#ifdef __MINGW32__
@@ -155,18 +157,23 @@
155157
if( sshPid==0 ){
156158
fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
157159
}
158160
blob_reset(&zCmd);
159161
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
161163
** connection is up and working.
162164
*/
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);
164172
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 ){
168175
pclose2(sshIn, sshOut, sshPid);
169176
fossil_fatal("ssh connection failed: [%s]", zIn);
170177
}
171178
fossil_free(zIn);
172179
}
173180
--- 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

Keyboard Shortcuts

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