Fossil

Diff
Login

Differences From Artifact [fafbfe094b]:

To Artifact [13dcb9659a]:


101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
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;
  int rc;
  if( (rc = sqlite3_prepare(g.db, blob_buffer(&pStmt->sql), -1, &pNew, 0))!=0 ){
  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
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;
  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
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 new repository
** 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
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
** Create a new local repository.
** 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() ){