Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Get cloning working for local files without the use of network I/O. Ticket [b3482d580e]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
9236f0c086010e7c7704fccdc5845e7c |
| User & Date: | drh 2008-10-05 12:34:14.000 |
Context
|
2008-10-05
| ||
| 13:13 | The UNIQUE constraint on the default TICKET table was wrong. The tkt_uuid column should be unique unto itself, not in combination with tkt_time. Existing servers will need to fix their TICKET implementations using the setup menu. This check-in changes the default. check-in: fb8dc7d07f user: drh tags: trunk | |
| 12:34 | Get cloning working for local files without the use of network I/O. Ticket [b3482d580e]. check-in: 9236f0c086 user: drh tags: trunk | |
| 01:03 | Documentation updates. check-in: c8893c69ac user: drh tags: trunk | |
Changes
Changes to src/clone.c.
| ︙ | ︙ | |||
43 44 45 46 47 48 49 |
usage("FILE-OR-URL NEW-REPOSITORY");
}
db_open_config();
if( file_size(g.argv[3])>0 ){
fossil_panic("file already exists: %s", g.argv[3]);
}
url_parse(g.argv[2]);
| > > > > > > > > > > | | | | | | | < < | | | | < < < < < < < < < < < < < < < | | | | > | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
usage("FILE-OR-URL NEW-REPOSITORY");
}
db_open_config();
if( file_size(g.argv[3])>0 ){
fossil_panic("file already exists: %s", g.argv[3]);
}
url_parse(g.argv[2]);
if( g.urlIsFile ){
file_copy(g.urlName, g.argv[3]);
db_close();
db_open_repository(g.argv[3]);
db_multi_exec(
"REPLACE INTO config(name,value)"
" VALUES('server-code', lower(hex(randomblob(20))));"
);
printf("Repository cloned into %s\n", g.argv[3]);
}else{
db_create_repository(g.argv[3]);
db_open_repository(g.argv[3]);
db_begin_transaction();
db_initial_setup(0, 0);
user_select();
db_set("content-schema", CONTENT_SCHEMA, 0);
db_set("aux-schema", AUX_SCHEMA, 0);
db_set("last-sync-url", g.argv[2], 0);
db_multi_exec(
"REPLACE INTO config(name,value)"
" VALUES('server-code', lower(hex(randomblob(20))));"
);
url_enable_proxy(0);
g.xlinkClusterOnly = 1;
client_sync(0,0,1,CONFIGSET_ALL);
g.xlinkClusterOnly = 0;
verify_cancel();
db_end_transaction(0);
db_close();
db_open_repository(g.argv[3]);
}
db_begin_transaction();
printf("Rebuilding repository meta-data...\n");
rebuild_db(0, 1);
db_end_transaction(0);
}
|
Changes to src/file.c.
| ︙ | ︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
i64 file_mtime(const char *zFilename){
struct stat buf;
if( stat(zFilename, &buf)!=0 ){
return -1;
}
return buf.st_mtime;
}
/*
** Return TRUE if the named file is an ordinary file. Return false
** for directories, devices, fifos, symlinks, etc.
*/
int file_isfile(const char *zFilename){
struct stat buf;
| > > > > > > > > > > > > > > > > > > | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
i64 file_mtime(const char *zFilename){
struct stat buf;
if( stat(zFilename, &buf)!=0 ){
return -1;
}
return buf.st_mtime;
}
/*
** Copy the content of a file from one place to another.
*/
void file_copy(const char *zFrom, const char *zTo){
FILE *in, *out;
int got;
char zBuf[8192];
in = fopen(zFrom, "rb");
if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom);
out = fopen(zTo, "wb");
if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo);
while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
fwrite(zBuf, 1, got, out);
}
fclose(in);
fclose(out);
}
/*
** Return TRUE if the named file is an ordinary file. Return false
** for directories, devices, fifos, symlinks, etc.
*/
int file_isfile(const char *zFilename){
struct stat buf;
|
| ︙ | ︙ |