101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
}
/*
** Prepare or reprepare the sqlite3 statement from the raw SQL text.
*/
static void reprepare(Stmt *pStmt){
sqlite3_stmt *pNew;
int rc;
if( (rc = sqlite3_prepare(g.db, blob_buffer(&pStmt->sql), -1, &pNew, 0))!=0 ){
db_err("%s\n%s", blob_str(&pStmt->sql), sqlite3_errmsg(g.db));
}
if( pStmt->pStmt ){
sqlite3_transfer_bindings(pStmt->pStmt, pNew);
sqlite3_finalize(pStmt->pStmt);
}
pStmt->pStmt = pNew;
|
<
|
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
}
/*
** Prepare or reprepare the sqlite3 statement from the raw SQL text.
*/
static void reprepare(Stmt *pStmt){
sqlite3_stmt *pNew;
if( sqlite3_prepare(g.db, blob_buffer(&pStmt->sql), -1, &pNew, 0)!=0 ){
db_err("%s\n%s", blob_str(&pStmt->sql), sqlite3_errmsg(g.db));
}
if( pStmt->pStmt ){
sqlite3_transfer_bindings(pStmt->pStmt, pNew);
sqlite3_finalize(pStmt->pStmt);
}
pStmt->pStmt = pNew;
|
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
}
/*
** Step the SQL statement. Return either SQLITE_ROW or an error code
** or SQLITE_OK if the statement finishes successfully.
*/
int db_step(Stmt *pStmt){
int rc;
int limit = 3;
while( limit-- ){
rc = sqlite3_step(pStmt->pStmt);
if( rc==SQLITE_ERROR ){
rc = sqlite3_reset(pStmt->pStmt);
}
if( rc==SQLITE_SCHEMA ){
|
|
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
}
/*
** Step the SQL statement. Return either SQLITE_ROW or an error code
** or SQLITE_OK if the statement finishes successfully.
*/
int db_step(Stmt *pStmt){
int rc = SQLITE_OK;
int limit = 3;
while( limit-- ){
rc = sqlite3_step(pStmt->pStmt);
if( rc==SQLITE_ERROR ){
rc = sqlite3_reset(pStmt->pStmt);
}
if( rc==SQLITE_SCHEMA ){
|
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
|
);
}
/*
** COMMAND: new
**
** Create a new repository
*/
void create_repository_cmd(void){
char *zDate;
char *zUser;
Blob hash;
Blob manifest;
|
>
|
>
>
|
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
|
);
}
/*
** COMMAND: new
**
** Usage: %fossil new FILENAME
** Create a repository for a new project in the file named FILENAME.
** This command is distinct from "clone". The "clone" command makes
** a copy of an existing project. This command starts a new project.
*/
void create_repository_cmd(void){
char *zDate;
char *zUser;
Blob hash;
Blob manifest;
|
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
|
void db_lset_int(const char *zName, int value){
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
}
/*
** COMMAND: open
**
** Create a new local repository.
*/
void cmd_open(void){
Blob path;
if( g.argc!=3 ){
usage("REPOSITORY-FILENAME");
}
if( db_open_local() ){
|
>
|
>
>
|
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
|
void db_lset_int(const char *zName, int value){
db_multi_exec("REPLACE INTO vvar(name,value) VALUES(%Q,%d)", zName, value);
}
/*
** COMMAND: open
**
** Usage: open FILENAME
** Open a connection to the local repository in FILENAME. A checkout
** for the repository is created with its root at the working directory.
** See also the "close" command.
*/
void cmd_open(void){
Blob path;
if( g.argc!=3 ){
usage("REPOSITORY-FILENAME");
}
if( db_open_local() ){
|