Fossil

Diff
Login

Differences From Artifact [d8864d4601]:

To Artifact [161ad4f2b5]:


94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
94
95
96
97
98
99
100

101
102
103
104
105
106
107







-







** 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.
**    --ssh-use-http|-h on/off   Enable http instead of test-http. Default: off
**
** See also: init
*/
void clone_cmd(void){
  char *zPassword;
  const char *zDefaultUser;   /* Optional name of the default user */
  int nErr = 0;
186
187
188
189
190
191
192
193
194
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
227









228
229
230

231
232
185
186
187
188
189
190
191

192
193
194
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









-













-
-
-
-







-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
/*
** 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 */
  const char *zSshUseHttp;    /* Use http or test-http mode 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);
  }
  zSshUseHttp = find_option("ssh-use-http","h",1);
  if( zSshUseHttp && zSshUseHttp[0] ){
    g.zSshUseHttp = mprintf("%s", zSshUseHttp);
  }
}

/*
** Set SSH options discovered in global variables (set from command line 
** options).
*/
void clone_ssh_db_set_options(void){
  if( g.urlIsSsh ){
    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);
    }
  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);
  }
    if( g.zSshUseHttp && g.zSshUseHttp[0] ){
      db_set_int("ssh-use-http", is_truth(g.zSshUseHttp), 0);
    }
}
  }
}