1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
|
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
|
-
-
-
-
+
+
+
+
-
+
|
*/
void move_repo_cmd(void){
Blob repo;
char *zRepo;
if( g.argc!=3 ){
usage("PATHNAME");
}
if( db_open_local()==0 ){
fossil_fatal("not in a local checkout");
return;
}
file_canonical_name(g.argv[2], &repo, 0);
zRepo = blob_str(&repo);
if( file_access(zRepo, 0) ){
fossil_fatal("no such file: %s", zRepo);
}
if( db_open_local(zRepo)==0 ){
fossil_fatal("not in a local checkout");
return;
}
db_open_or_attach(zRepo, "test_repo", 0);
db_lset("repository", blob_str(&repo));
db_close(1);
}
/*
** Open the local database. If unable, exit with an error.
*/
void db_must_be_within_tree(void){
if( db_open_local()==0 ){
if( db_open_local(0)==0 ){
fossil_fatal("current directory is not within an open checkout");
}
db_open_repository(0);
db_verify_schema();
}
/*
|
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
|
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
|
-
-
+
-
-
+
-
+
-
+
|
** Options:
** --keep Only modify the manifest and manifest.uuid files
** --nested Allow opening a repository inside an opened checkout
**
** See also: close
*/
void cmd_open(void){
Blob path;
int vid;
int keepFlag;
int allowNested;
static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
url_proxy_options();
keepFlag = find_option("keep",0,0)!=0;
allowNested = find_option("nested",0,0)!=0;
if( g.argc!=3 && g.argc!=4 ){
usage("REPOSITORY-FILENAME ?VERSION?");
}
if( !allowNested && db_open_local() ){
if( !allowNested && db_open_local(0) ){
fossil_panic("already within an open tree rooted at %s", g.zLocalRoot);
}
file_canonical_name(g.argv[2], &path, 0);
db_open_repository(blob_str(&path));
db_open_repository(g.argv[2]);
#if defined(_WIN32) || defined(__CYGWIN__)
# define LOCALDB_NAME "./_FOSSIL_"
#else
# define LOCALDB_NAME "./.fslckout"
#endif
db_init_database(LOCALDB_NAME, zLocalSchema,
#ifdef FOSSIL_LOCAL_WAL
"COMMIT; PRAGMA journal_mode=WAL; BEGIN;",
#endif
(char*)0);
db_delete_on_failure(LOCALDB_NAME);
db_open_local();
db_open_local(0);
db_lset("repository", g.argv[2]);
db_record_repository_filename(blob_str(&path));
db_record_repository_filename(g.argv[2]);
vid = db_int(0, "SELECT pid FROM plink y"
" WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)");
if( vid==0 ){
db_lset_int("checkout", 1);
}else{
char **oldArgv = g.argv;
int oldArgc = g.argc;
|
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
|
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
|
-
-
-
|
{ "http-port", 0, 16, 0, "8080" },
{ "https-login", 0, 0, 0, "off" },
{ "ignore-glob", 0, 40, 1, "" },
{ "keep-glob", 0, 40, 1, "" },
{ "localauth", 0, 0, 0, "off" },
{ "main-branch", 0, 40, 0, "trunk" },
{ "manifest", 0, 0, 1, "off" },
#ifdef FOSSIL_ENABLE_MARKDOWN
{ "markdown", 0, 0, 0, "off" },
#endif
{ "max-upload", 0, 25, 0, "250000" },
{ "mtime-changes", 0, 0, 0, "on" },
{ "pgp-command", 0, 40, 0, "gpg --clearsign -o " },
{ "proxy", 0, 32, 0, "off" },
{ "relative-paths",0, 0, 0, "on" },
{ "repo-cksum", 0, 0, 0, "on" },
{ "self-register", 0, 0, 0, "off" },
|
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
|
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
|
-
+
-
-
+
+
|
** binary-glob The VALUE is a comma or newline-separated list of
** (versionable) GLOB patterns that should be treated as binary files
** for committing and merging purposes. Example: *.jpg
**
** case-sensitive If TRUE, the files whose names differ only in case
** care considered distinct. If FALSE files whose names
** differ only in case are the same file. Defaults to
** TRUE for unix and FALSE for windows and mac.
** TRUE for unix and FALSE for Cygwin, Mac and Windows.
**
** clearsign When enabled, fossil will attempt to sign all commits
** with gpg. When disabled (the default), commits will
** be unsigned. Default: off
**
** crnl-glob A comma or newline-separated list of GLOB patterns for
** (versionable) text files in which it is ok to have CR+NL line endings.
** Set to "*" to disable CR+NL checking.
** (versionable) text files in which it is ok to have CR, CR+NL or mixed
** line endings. Set to "*" to disable CR+NL checking.
**
** default-perms Permissions given automatically to new users. For more
** information on permissions see Users page in Server
** Administration of the HTTP UI. Default: u.
**
** diff-binary If TRUE (the default), permit files that may be binary
** or that match the "binary-glob" setting to be used with
|