Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 370255
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js (-114 / +82 lines)
Lines 804-809 Link Here
804
			callback: function(data) {
804
			callback: function(data) {
805
				var item = data.items;
805
				var item = data.items;
806
				var path = item.Location;
806
				var path = item.Location;
807
				
808
				var handleResponse = function(jsonData, commandInvocation){
809
					if (jsonData.JsonData.HostKey){
810
						doOperation(commandInvocation, jsonData.JsonData);
811
					} else if (commandInvocation){
812
						if (jsonData.JsonData.User)
813
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
814
						else
815
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
816
						
817
						commandInvocation.parameters.errorData = jsonData.JsonData;
818
						commandService._collectParameters(commandInvocation);
819
					} else {
820
						doOperation(null, jsonData.JsonData);
821
					}
822
				};
807
823
808
				var doOperation = function(commandInvocation, errorData){
824
				var doOperation = function(commandInvocation, errorData){
809
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
825
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
Lines 830-845 Link Here
830
													dojo.hitch(explorer, explorer.changedItem)(item);
846
													dojo.hitch(explorer, explorer.changedItem)(item);
831
												}, displayErrorOnStatus
847
												}, displayErrorOnStatus
832
											);
848
											);
833
										}, function () {
849
										}, function (jsonData) {
834
											if (jsonData.JsonData.HostKey){
850
											handleResponse(jsonData, commandInvocation);
835
												doOperation(commandInvocation, jsonData.JsonData);
836
											} else if (commandInvocation){
837
												commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
838
												commandInvocation.parameters.errorData = jsonData.JsonData;
839
												commandService._collectParameters(commandInvocation);
840
											} else {
841
												doOperation(null, jsonData.JsonData);
842
											}
843
										}
851
										}
844
									);
852
									);
845
								}, function(jsonData, secondArg) {
853
								}, function(jsonData, secondArg) {
Lines 847-861 Link Here
847
										function() {
855
										function() {
848
										
856
										
849
										}, function (jsonData) {
857
										}, function (jsonData) {
850
											if (jsonData.JsonData.HostKey){
858
											handleResponse(jsonData, commandInvocation);
851
												doOperation(commandInvocation, jsonData.JsonData);
852
											} else if (commandInvocation){
853
												commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
854
												commandInvocation.parameters.errorData = jsonData.JsonData;
855
												commandService._collectParameters(commandInvocation);
856
											} else {
857
												doOperation(null, jsonData.JsonData);
858
											}
859
										}
859
										}
860
									);
860
									);
861
								}
861
								}
Lines 889-894 Link Here
889
				
889
				
890
				var item = data.items;
890
				var item = data.items;
891
				var path = item.Location;
891
				var path = item.Location;
892
				
893
				var handleResponse = function(jsonData, commandInvocation){
894
					if (jsonData.JsonData.HostKey){
895
						doOperation(commandInvocation, jsonData.JsonData);
896
					} else if (commandInvocation){
897
						if (jsonData.JsonData.User)
898
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
899
						else
900
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
901
						
902
						commandInvocation.parameters.errorData = jsonData.JsonData;
903
						commandService._collectParameters(commandInvocation);
904
					} else {
905
						doOperation(null, jsonData.JsonData);
906
					}
907
				};
892
908
893
				var doOperation = function(commandInvocation, errorData){
909
				var doOperation = function(commandInvocation, errorData){
894
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
910
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
Lines 915-930 Link Here
915
													dojo.hitch(explorer, explorer.changedItem)(item);
931
													dojo.hitch(explorer, explorer.changedItem)(item);
916
												}, displayErrorOnStatus
932
												}, displayErrorOnStatus
917
											);
933
											);
918
										}, function () {
934
										}, function (jsonData) {
919
											if (jsonData.JsonData.HostKey){
935
											handleResponse(jsonData, commandInvocation);
920
												doOperation(commandInvocation, jsonData.JsonData);
921
											} else if (commandInvocation){
922
												commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
923
												commandInvocation.parameters.errorData = jsonData.JsonData;
924
												commandService._collectParameters(commandInvocation);
925
											} else {
926
												doOperation(null, jsonData.JsonData);
927
											}
928
										}
936
										}
929
									);
937
									);
930
								}, function(jsonData, secondArg) {
938
								}, function(jsonData, secondArg) {
Lines 932-946 Link Here
932
										function() {
940
										function() {
933
										
941
										
934
										}, function (jsonData) {
942
										}, function (jsonData) {
935
											if (jsonData.JsonData.HostKey){
943
											handleResponse(jsonData, commandInvocation);
936
												doOperation(commandInvocation, jsonData.JsonData);
937
											} else if (commandInvocation){
938
												commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
939
												commandInvocation.parameters.errorData = jsonData.JsonData;
940
												commandService._collectParameters(commandInvocation);
941
											} else {
942
												doOperation(null, jsonData.JsonData);
943
											}
944
										}
944
										}
945
									);
945
									);
946
								}
946
								}
Lines 1122-1127 Link Here
1122
				if (item.toRef) {
1122
				if (item.toRef) {
1123
					item = item.toRef;
1123
					item = item.toRef;
1124
				}
1124
				}
1125
				
1126
				var handleResponse = function(jsonData, commandInvocation){
1127
					if (jsonData.JsonData.HostKey){
1128
						doOperation(commandInvocation, jsonData.JsonData);
1129
					} else if (commandInvocation){
1130
						if (jsonData.JsonData.User)
1131
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1132
						else
1133
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1134
						
1135
						commandInvocation.parameters.errorData = jsonData.JsonData;
1136
						commandService._collectParameters(commandInvocation);
1137
					} else {
1138
						doOperation(null, jsonData.JsonData);
1139
					}
1140
				};
1125
1141
1126
				var doOperation = function(commandInvocation, errorData){
1142
				var doOperation = function(commandInvocation, errorData){
1127
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
1143
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
Lines 1141-1156 Link Here
1141
													dojo.toggleClass(node, "outgoingCommitsdRow", false);
1157
													dojo.toggleClass(node, "outgoingCommitsdRow", false);
1142
												});
1158
												});
1143
												dojo.hitch(explorer, explorer.changedItem)({});
1159
												dojo.hitch(explorer, explorer.changedItem)({});
1144
											}, function () {
1160
											}, function (jsonData) {
1145
												if (jsonData.JsonData.HostKey){
1161
												handleResponse(jsonData, commandInvocation);
1146
													doOperation(commandInvocation, jsonData.JsonData);
1147
												} else if (commandInvocation){
1148
													commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1149
													commandInvocation.parameters.errorData = jsonData.JsonData;
1150
													commandService._collectParameters(commandInvocation);
1151
												} else {
1152
													doOperation(null, jsonData.JsonData);
1153
												}
1154
											}
1162
											}
1155
										);
1163
										);
1156
									}, function(jsonData, secondArg) {
1164
									}, function(jsonData, secondArg) {
Lines 1158-1172 Link Here
1158
											function() {
1166
											function() {
1159
											
1167
											
1160
											}, function (jsonData) {
1168
											}, function (jsonData) {
1161
												if (jsonData.JsonData.HostKey){
1169
												handleResponse(jsonData, commandInvocation);
1162
													doOperation(commandInvocation, jsonData.JsonData);
1163
												} else if (commandInvocation){
1164
													commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1165
													commandInvocation.parameters.errorData = jsonData.JsonData;
1166
													commandService._collectParameters(commandInvocation);
1167
												} else {
1168
													doOperation(null, jsonData.JsonData);
1169
												}
1170
											}
1170
											}
1171
										);
1171
										);
1172
									}	
1172
									}	
Lines 1196-1211 Link Here
1196
																dojo.toggleClass(node, "outgoingCommitsdRow", false);
1196
																dojo.toggleClass(node, "outgoingCommitsdRow", false);
1197
															});
1197
															});
1198
															dojo.hitch(explorer, explorer.changedItem)({});
1198
															dojo.hitch(explorer, explorer.changedItem)({});
1199
														}, function () {
1199
														}, function (jsonData) {
1200
															if (jsonData.JsonData.HostKey){
1200
															handleResponse(jsonData, commandInvocation);
1201
																doOperation(commandInvocation, jsonData.JsonData);
1202
															} else if (commandInvocation){
1203
																commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1204
																commandInvocation.parameters.errorData = jsonData.JsonData;
1205
																commandService._collectParameters(commandInvocation);
1206
															} else {
1207
																doOperation(null, jsonData.JsonData);
1208
															}
1209
														}
1201
														}
1210
													);
1202
													);
1211
												}, function(jsonData, secondArg) {
1203
												}, function(jsonData, secondArg) {
Lines 1213-1227 Link Here
1213
														function() {
1205
														function() {
1214
														
1206
														
1215
														}, function (jsonData) {
1207
														}, function (jsonData) {
1216
															if (jsonData.JsonData.HostKey){
1208
															handleResponse(jsonData, commandInvocation);
1217
																doOperation(commandInvocation, jsonData.JsonData);
1218
															} else if (commandInvocation){
1219
																commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1220
																commandInvocation.parameters.errorData = jsonData.JsonData;
1221
																commandService._collectParameters(commandInvocation);
1222
															} else {
1223
																doOperation(null, jsonData.JsonData);
1224
															}
1225
														}
1209
														}
1226
													);
1210
													);
1227
												}
1211
												}
Lines 1271-1276 Link Here
1271
				if (item.toRef) {
1255
				if (item.toRef) {
1272
					item = item.toRef;
1256
					item = item.toRef;
1273
				}
1257
				}
1258
				
1259
				var handleResponse = function(jsonData, commandInvocation){
1260
					if (jsonData.JsonData.HostKey){
1261
						doOperation(commandInvocation, jsonData.JsonData);
1262
					} else if (commandInvocation){
1263
						if (jsonData.JsonData.User)
1264
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1265
						else
1266
							commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1267
						
1268
						commandInvocation.parameters.errorData = jsonData.JsonData;
1269
						commandService._collectParameters(commandInvocation);
1270
					} else {
1271
						doOperation(null, jsonData.JsonData);
1272
					}
1273
				};
1274
1274
1275
				var doOperation = function(commandInvocation, errorData){
1275
				var doOperation = function(commandInvocation, errorData){
1276
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
1276
					exports.gatherSshCredentials(serviceRegistry, commandInvocation, errorData).then(
Lines 1290-1305 Link Here
1290
													dojo.toggleClass(node, "outgoingCommitsdRow", false);
1290
													dojo.toggleClass(node, "outgoingCommitsdRow", false);
1291
												});
1291
												});
1292
												dojo.hitch(explorer, explorer.changedItem)({});
1292
												dojo.hitch(explorer, explorer.changedItem)({});
1293
											}, function () {
1293
											}, function (jsonData) {
1294
												if (jsonData.JsonData.HostKey){
1294
												handleResponse(jsonData, commandInvocation);
1295
													doOperation(commandInvocation, jsonData.JsonData);
1296
												} else if (commandInvocation){
1297
													commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1298
													commandInvocation.parameters.errorData = jsonData.JsonData;
1299
													commandService._collectParameters(commandInvocation);
1300
												} else {
1301
													doOperation(null, jsonData.JsonData);
1302
												}
1303
											}
1295
											}
1304
										);
1296
										);
1305
									}, function(jsonData, secondArg) {
1297
									}, function(jsonData, secondArg) {
Lines 1307-1321 Link Here
1307
											function() {
1299
											function() {
1308
											
1300
											
1309
											}, function (jsonData) {
1301
											}, function (jsonData) {
1310
												if (jsonData.JsonData.HostKey){
1302
												handleResponse(jsonData, commandInvocation);
1311
													doOperation(commandInvocation, jsonData.JsonData);
1312
												} else if (commandInvocation){
1313
													commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1314
													commandInvocation.parameters.errorData = jsonData.JsonData;
1315
													commandService._collectParameters(commandInvocation);
1316
												} else {
1317
													doOperation(null, jsonData.JsonData);
1318
												}
1319
											}
1303
											}
1320
										);
1304
										);
1321
									}	
1305
									}	
Lines 1345-1360 Link Here
1345
																dojo.toggleClass(node, "outgoingCommitsdRow", false);
1329
																dojo.toggleClass(node, "outgoingCommitsdRow", false);
1346
															});
1330
															});
1347
															dojo.hitch(explorer, explorer.changedItem)({});
1331
															dojo.hitch(explorer, explorer.changedItem)({});
1348
														}, function () {
1332
														}, function (jsonData) {
1349
															if (jsonData.JsonData.HostKey){
1333
															handleResponse(jsonData, commandInvocation);
1350
																doOperation(commandInvocation, jsonData.JsonData);
1351
															} else if (commandInvocation){
1352
																commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1353
																commandInvocation.parameters.errorData = jsonData.JsonData;
1354
																commandService._collectParameters(commandInvocation);
1355
															} else {
1356
																doOperation(null, jsonData.JsonData);
1357
															}
1358
														}
1334
														}
1359
													);
1335
													);
1360
												}, function(jsonData, secondArg) {
1336
												}, function(jsonData, secondArg) {
Lines 1362-1376 Link Here
1362
														function() {
1338
														function() {
1363
														
1339
														
1364
														}, function (jsonData) {
1340
														}, function (jsonData) {
1365
															if (jsonData.JsonData.HostKey){
1341
															handleResponse(jsonData, commandInvocation);
1366
																doOperation(commandInvocation, jsonData.JsonData);
1367
															} else if (commandInvocation){
1368
																commandInvocation.parameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("sshuser", "text", "SSH User Name:"), new mCommands.CommandParameter("sshpassword", "password", "SSH Password:")], true);
1369
																commandInvocation.parameters.errorData = jsonData.JsonData;
1370
																commandService._collectParameters(commandInvocation);
1371
															} else {
1372
																doOperation(null, jsonData.JsonData);
1373
															}
1374
														}
1342
														}
1375
													);
1343
													);
1376
												}
1344
												}

Return to bug 370255