570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
** Try to find the repository and open it. If we are in a local
** tree, then use the repository of the local tree. Otherwise,
** fall back to the -R or --repository option.
**
** Error out if the repository cannot be opened.
*/
void db_find_and_open_repository(void){
db_open_repository(find_option("repository", "R", 1));
if( g.repositoryOpen==0 ){
fossil_fatal("use --repository or -R to specific the repository database");
}
}
/*
** Open the local database. If unable, exit with an error.
*/
void db_must_be_within_tree(void){
if( db_open_local()==0 ){
fprintf(stderr,"%s: not within an open checkout\n", g.argv[0]);
exit(1);
}
db_open_repository(0);
}
/*
** Close the database connection.
*/
|
>
>
>
>
>
>
>
>
>
>
|
|
<
>
>
>
|
<
|
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
** Try to find the repository and open it. If we are in a local
** tree, then use the repository of the local tree. Otherwise,
** fall back to the -R or --repository option.
**
** Error out if the repository cannot be opened.
*/
void db_find_and_open_repository(void){
char *zRep = find_option("repository", "R", 1);
if( zRep==0 ){
if( db_open_local()==0 ){
goto rep_not_found;
}
zRep = db_lget("repository", 0);
if( zRep==0 ){
goto rep_not_found;
}
}
db_open_repository(zRep);
if( g.repositoryOpen ){
return;
}
rep_not_found:
fossil_fatal("use --repository or -R to specific the repository database");
}
/*
** Open the local database. If unable, exit with an error.
*/
void db_must_be_within_tree(void){
if( db_open_local()==0 ){
fossil_fatal("not within an open checkout");
}
db_open_repository(0);
}
/*
** Close the database connection.
*/
|