Fossil SCM

Mirror many "fossil ui" options to the remote side when using a remote repository.

drh 2021-06-30 22:49 trunk
Commit 612f6cee385911cfcd558412c3f31fd027b7b96d5ab3ed8c808805d26c85a4b8
1 file changed +23 -6
+23 -6
--- src/main.c
+++ src/main.c
@@ -2964,14 +2964,24 @@
29642964
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
29652965
if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){
29662966
/* If REPOSITORY arg is the root of a checkout,
29672967
** chdir to that checkout so that the current version
29682968
** gets highlighted in the timeline by default. */
2969
- const char * zDir = g.argv[2];
2970
- if(dir_has_ckout_db(zDir)){
2971
- if(0!=file_chdir(zDir, 0)){
2972
- fossil_fatal("Cannot chdir to %s", zDir);
2969
+ const char * zArg = g.argv[2];
2970
+ char * zCkoutDb = mprintf("%//.fslckout", zArg);
2971
+ if(file_size(zCkoutDb, ExtFILE)<=0){
2972
+ fossil_free(zCkoutDb);
2973
+ zCkoutDb = mprintf("%//_FOSSIL_", zArg);
2974
+ if(file_size(zCkoutDb, ExtFILE)<=0){
2975
+ fossil_free(zCkoutDb);
2976
+ zCkoutDb = 0;
2977
+ }
2978
+ }
2979
+ if(zCkoutDb!=0){
2980
+ fossil_free(zCkoutDb);
2981
+ if(0!=file_chdir(zArg, 0)){
2982
+ fossil_fatal("Cannot chdir to %s", zArg);
29732983
}
29742984
findServerArg = 99;
29752985
fCreate = 0;
29762986
g.argv[2] = 0;
29772987
--g.argc;
@@ -3043,18 +3053,25 @@
30433053
if( zRemote ){
30443054
/* If a USER@HOST:REPO argument is supplied, then use SSH to run
30453055
** "fossil ui --nobrowser" on the remote system and to set up a
30463056
** tunnel from the local machine to the remote. */
30473057
FILE *sshIn;
3058
+ const char *zSkin;
30483059
Blob ssh;
30493060
char zLine[1000];
30503061
blob_init(&ssh, 0, 0);
30513062
transport_ssh_command(&ssh);
30523063
blob_appendf(&ssh,
30533064
" -t -L127.0.0.1:%d:127.0.0.1:%d -- %!$"
3054
- " fossil ui --nobrowser --localauth --port %d %$",
3055
- iPort, iPort, zRemote, iPort, g.argv[2]);
3065
+ " fossil ui --nobrowser --localauth --port %d",
3066
+ iPort, iPort, zRemote, iPort);
3067
+ if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound);
3068
+ if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob);
3069
+ if( g.zCkoutAlias ) blob_appendf(&ssh, " --ckout-alias %!$",g.zCkoutAlias);
3070
+ if( g.zExtRoot ) blob_appendf(&ssh, " --extroot %$", g.zExtRoot);
3071
+ if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use());
3072
+ blob_appendf(&ssh, " %$", g.argv[2]);
30563073
fossil_print("%s\n", blob_str(&ssh));
30573074
sshIn = popen(blob_str(&ssh), "r");
30583075
if( sshIn==0 ){
30593076
fossil_fatal("unable to %s", blob_str(&ssh));
30603077
}
30613078
--- src/main.c
+++ src/main.c
@@ -2964,14 +2964,24 @@
2964 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2965 if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){
2966 /* If REPOSITORY arg is the root of a checkout,
2967 ** chdir to that checkout so that the current version
2968 ** gets highlighted in the timeline by default. */
2969 const char * zDir = g.argv[2];
2970 if(dir_has_ckout_db(zDir)){
2971 if(0!=file_chdir(zDir, 0)){
2972 fossil_fatal("Cannot chdir to %s", zDir);
 
 
 
 
 
 
 
 
 
 
2973 }
2974 findServerArg = 99;
2975 fCreate = 0;
2976 g.argv[2] = 0;
2977 --g.argc;
@@ -3043,18 +3053,25 @@
3043 if( zRemote ){
3044 /* If a USER@HOST:REPO argument is supplied, then use SSH to run
3045 ** "fossil ui --nobrowser" on the remote system and to set up a
3046 ** tunnel from the local machine to the remote. */
3047 FILE *sshIn;
 
3048 Blob ssh;
3049 char zLine[1000];
3050 blob_init(&ssh, 0, 0);
3051 transport_ssh_command(&ssh);
3052 blob_appendf(&ssh,
3053 " -t -L127.0.0.1:%d:127.0.0.1:%d -- %!$"
3054 " fossil ui --nobrowser --localauth --port %d %$",
3055 iPort, iPort, zRemote, iPort, g.argv[2]);
 
 
 
 
 
 
3056 fossil_print("%s\n", blob_str(&ssh));
3057 sshIn = popen(blob_str(&ssh), "r");
3058 if( sshIn==0 ){
3059 fossil_fatal("unable to %s", blob_str(&ssh));
3060 }
3061
--- src/main.c
+++ src/main.c
@@ -2964,14 +2964,24 @@
2964 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2965 if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){
2966 /* If REPOSITORY arg is the root of a checkout,
2967 ** chdir to that checkout so that the current version
2968 ** gets highlighted in the timeline by default. */
2969 const char * zArg = g.argv[2];
2970 char * zCkoutDb = mprintf("%//.fslckout", zArg);
2971 if(file_size(zCkoutDb, ExtFILE)<=0){
2972 fossil_free(zCkoutDb);
2973 zCkoutDb = mprintf("%//_FOSSIL_", zArg);
2974 if(file_size(zCkoutDb, ExtFILE)<=0){
2975 fossil_free(zCkoutDb);
2976 zCkoutDb = 0;
2977 }
2978 }
2979 if(zCkoutDb!=0){
2980 fossil_free(zCkoutDb);
2981 if(0!=file_chdir(zArg, 0)){
2982 fossil_fatal("Cannot chdir to %s", zArg);
2983 }
2984 findServerArg = 99;
2985 fCreate = 0;
2986 g.argv[2] = 0;
2987 --g.argc;
@@ -3043,18 +3053,25 @@
3053 if( zRemote ){
3054 /* If a USER@HOST:REPO argument is supplied, then use SSH to run
3055 ** "fossil ui --nobrowser" on the remote system and to set up a
3056 ** tunnel from the local machine to the remote. */
3057 FILE *sshIn;
3058 const char *zSkin;
3059 Blob ssh;
3060 char zLine[1000];
3061 blob_init(&ssh, 0, 0);
3062 transport_ssh_command(&ssh);
3063 blob_appendf(&ssh,
3064 " -t -L127.0.0.1:%d:127.0.0.1:%d -- %!$"
3065 " fossil ui --nobrowser --localauth --port %d",
3066 iPort, iPort, zRemote, iPort);
3067 if( zNotFound ) blob_appendf(&ssh, " --notfound %!$", zNotFound);
3068 if( zFileGlob ) blob_appendf(&ssh, " --files-urlenc %T", zFileGlob);
3069 if( g.zCkoutAlias ) blob_appendf(&ssh, " --ckout-alias %!$",g.zCkoutAlias);
3070 if( g.zExtRoot ) blob_appendf(&ssh, " --extroot %$", g.zExtRoot);
3071 if( skin_in_use() ) blob_appendf(&ssh, " --skin %s", skin_in_use());
3072 blob_appendf(&ssh, " %$", g.argv[2]);
3073 fossil_print("%s\n", blob_str(&ssh));
3074 sshIn = popen(blob_str(&ssh), "r");
3075 if( sshIn==0 ){
3076 fossil_fatal("unable to %s", blob_str(&ssh));
3077 }
3078

Keyboard Shortcuts

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