88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
-
+
+
-
-
-
|
** file named FILENAME.
**
** URL must be in one of the following form: ([...] mean optional)
** HTTP/HTTPS protocol:
** http[s]://[userid[:password]@]host[:port][/path]
**
** SSH protocol:
** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil
** ssh://[userid[:password]@]host[:port]/path/to/repo.fossil\\
** [?fossil=path/to/fossil.exe]
**
** Filesystem:
** [file://]path/to/repo.fossil
**
** Note: For ssh and filesystem, path must have an extra leading
** '/' to use an absolute path.
**
** Note: the userid for SSH is the SSH account, not the Fossil account.
**
** By default, your current login name is used to create the default
** admin user. This can be overridden using the -A|--admin-user
** parameter.
**
** Options:
** --admin-user|-A USERNAME Make USERNAME the administrator
** --private Also clone private branches
** --ssl-identity=filename Use the SSL identity if requested by the server
** --ssh-fossil|-f /fossil Use this path as remote fossil command
** --ssh-command|-c 'command' Use this SSH command
** --ssh-fossil-user|-l user Fossil user to use for SSH if different.
**
** See also: init
*/
void clone_cmd(void){
char *zPassword;
|
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
-
-
-
-
-
-
-
-
|
db_end_transaction(0);
}
/*
** Look for SSH clone command line options and setup in globals.
*/
void clone_ssh_find_options(void){
const char *zSshFossilCmd; /* Path to remote fossil command for SSH */
const char *zSshCmd; /* SSH command string */
const char *zFossilUser; /* Fossil user if login specified for SSH */
zSshFossilCmd = find_option("ssh-fossil","f",1);
if( zSshFossilCmd && zSshFossilCmd[0] ){
g.zSshFossilCmd = mprintf("%s", zSshFossilCmd);
}
zSshCmd = find_option("ssh-command","c",1);
if( zSshCmd && zSshCmd[0] ){
g.zSshCmd = mprintf("%s", zSshCmd);
}
zFossilUser = find_option("ssh-fossil-user","l",1);
if( zFossilUser && zFossilUser[0] ){
g.zFossilUser = mprintf("%s", zFossilUser);
}
}
/*
** Set SSH options discovered in global variables (set from command line
** options).
*/
void clone_ssh_db_set_options(void){
if( g.zSshFossilCmd && g.zSshFossilCmd[0] ){
db_set("ssh-fossil", g.zSshFossilCmd, 0);
}
if( g.zSshCmd && g.zSshCmd[0] ){
db_set("ssh-command", g.zSshCmd, 0);
}
if( g.zFossilUser && g.zFossilUser[0] ){
db_set("ssh-fossil-user", g.zFossilUser, 0);
}
}
|