Fossil SCM
Mirror many "fossil ui" options to the remote side when using a remote repository.
Commit
612f6cee385911cfcd558412c3f31fd027b7b96d5ab3ed8c808805d26c85a4b8
Parent
9a931a16aca2a71…
1 file changed
+23
-6
+23
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2964,14 +2964,24 @@ | ||
| 2964 | 2964 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2965 | 2965 | if( isUiCmd && 3==g.argc && file_isdir(g.argv[2], ExtFILE)>0 ){ |
| 2966 | 2966 | /* If REPOSITORY arg is the root of a checkout, |
| 2967 | 2967 | ** chdir to that checkout so that the current version |
| 2968 | 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); | |
| 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); | |
| 2973 | 2983 | } |
| 2974 | 2984 | findServerArg = 99; |
| 2975 | 2985 | fCreate = 0; |
| 2976 | 2986 | g.argv[2] = 0; |
| 2977 | 2987 | --g.argc; |
| @@ -3043,18 +3053,25 @@ | ||
| 3043 | 3053 | if( zRemote ){ |
| 3044 | 3054 | /* If a USER@HOST:REPO argument is supplied, then use SSH to run |
| 3045 | 3055 | ** "fossil ui --nobrowser" on the remote system and to set up a |
| 3046 | 3056 | ** tunnel from the local machine to the remote. */ |
| 3047 | 3057 | FILE *sshIn; |
| 3058 | + const char *zSkin; | |
| 3048 | 3059 | Blob ssh; |
| 3049 | 3060 | char zLine[1000]; |
| 3050 | 3061 | blob_init(&ssh, 0, 0); |
| 3051 | 3062 | transport_ssh_command(&ssh); |
| 3052 | 3063 | blob_appendf(&ssh, |
| 3053 | 3064 | " -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]); | |
| 3056 | 3073 | fossil_print("%s\n", blob_str(&ssh)); |
| 3057 | 3074 | sshIn = popen(blob_str(&ssh), "r"); |
| 3058 | 3075 | if( sshIn==0 ){ |
| 3059 | 3076 | fossil_fatal("unable to %s", blob_str(&ssh)); |
| 3060 | 3077 | } |
| 3061 | 3078 |
| --- 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 |