Fossil SCM

Merged in trunk [9bfa186be09f]. Fixed an inexplicable duplicate call to db_find_and_open_repository() which has since disappeared from the trunk.

stephan 2011-09-30 09:01 UTC json merge
Commit 8185bddf2e6c01caafd3b3bda7806c685e104768
+8 -1
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
5757
*/
5858
static const char *azManifest[] = {
5959
"manifest",
6060
"manifest.uuid",
6161
};
62
+
63
+ /* Cached setting "manifest" */
64
+ static int cachedManifest = -1;
65
+
66
+ if( cachedManifest == -1 ){
67
+ cachedManifest = db_get_boolean("manifest",0);
68
+ }
6269
6370
if( N>=0 && N<count(azName) ) return azName[N];
6471
if( N>=count(azName) && N<count(azName)+count(azManifest)
65
- && db_get_boolean("manifest",0) ){
72
+ && cachedManifest ){
6673
return azManifest[N-count(azName)];
6774
}
6875
return 0;
6976
}
7077
7178
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
57 */
58 static const char *azManifest[] = {
59 "manifest",
60 "manifest.uuid",
61 };
 
 
 
 
 
 
 
62
63 if( N>=0 && N<count(azName) ) return azName[N];
64 if( N>=count(azName) && N<count(azName)+count(azManifest)
65 && db_get_boolean("manifest",0) ){
66 return azManifest[N-count(azName)];
67 }
68 return 0;
69 }
70
71
--- src/add.c
+++ src/add.c
@@ -57,14 +57,21 @@
57 */
58 static const char *azManifest[] = {
59 "manifest",
60 "manifest.uuid",
61 };
62
63 /* Cached setting "manifest" */
64 static int cachedManifest = -1;
65
66 if( cachedManifest == -1 ){
67 cachedManifest = db_get_boolean("manifest",0);
68 }
69
70 if( N>=0 && N<count(azName) ) return azName[N];
71 if( N>=count(azName) && N<count(azName)+count(azManifest)
72 && cachedManifest ){
73 return azManifest[N-count(azName)];
74 }
75 return 0;
76 }
77
78
+11 -10
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658658
while( db_step(&q)==SQLITE_ROW ){
659659
const char *zName = db_column_text(&q, 0);
660660
const char *zUuid = db_column_text(&q, 1);
661661
const char *zOrig = db_column_text(&q, 2);
662662
int frid = db_column_int(&q, 3);
663
- int isexe = db_column_int(&q, 4);
663
+ int isExe = db_column_int(&q, 4);
664664
int isLink = db_column_int(&q, 5);
665665
int isSelected = db_column_int(&q, 6);
666666
const char *zPerm;
667667
int cmp;
668668
#if !defined(_WIN32)
669
- /* For unix, extract the "executable" permission bit directly from
670
- ** the filesystem. On windows, the "executable" bit is retained
669
+ int mPerm;
670
+
671
+ /* For unix, extract the "executable" and "symlink" permissions
672
+ ** directly from the filesystem. On windows, permissions are
671673
** unchanged from the original.
672674
*/
675
+
673676
blob_resize(&filename, nBasename);
674677
blob_append(&filename, zName, -1);
675
- isexe = file_wd_isexe(blob_str(&filename));
676
-
677
- /* For unix, check if the file on the filesystem is symlink.
678
- ** On windows, the bit is retained unchanged from original.
679
- */
680
- isLink = file_wd_islink(blob_str(&filename));
678
+
679
+ mPerm = file_wd_perm(blob_str(&filename));
680
+ isExe = ( mPerm==PERM_EXE );
681
+ isLink = ( mPerm==PERM_LNK );
681682
#endif
682
- if( isexe ){
683
+ if( isExe ){
683684
zPerm = " x";
684685
}else if( isLink ){
685686
zPerm = " l"; /* note: symlinks don't have executable bit on unix */
686687
}else{
687688
zPerm = "";
688689
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658 while( db_step(&q)==SQLITE_ROW ){
659 const char *zName = db_column_text(&q, 0);
660 const char *zUuid = db_column_text(&q, 1);
661 const char *zOrig = db_column_text(&q, 2);
662 int frid = db_column_int(&q, 3);
663 int isexe = db_column_int(&q, 4);
664 int isLink = db_column_int(&q, 5);
665 int isSelected = db_column_int(&q, 6);
666 const char *zPerm;
667 int cmp;
668 #if !defined(_WIN32)
669 /* For unix, extract the "executable" permission bit directly from
670 ** the filesystem. On windows, the "executable" bit is retained
 
 
671 ** unchanged from the original.
672 */
 
673 blob_resize(&filename, nBasename);
674 blob_append(&filename, zName, -1);
675 isexe = file_wd_isexe(blob_str(&filename));
676
677 /* For unix, check if the file on the filesystem is symlink.
678 ** On windows, the bit is retained unchanged from original.
679 */
680 isLink = file_wd_islink(blob_str(&filename));
681 #endif
682 if( isexe ){
683 zPerm = " x";
684 }else if( isLink ){
685 zPerm = " l"; /* note: symlinks don't have executable bit on unix */
686 }else{
687 zPerm = "";
688
--- src/checkin.c
+++ src/checkin.c
@@ -658,30 +658,31 @@
658 while( db_step(&q)==SQLITE_ROW ){
659 const char *zName = db_column_text(&q, 0);
660 const char *zUuid = db_column_text(&q, 1);
661 const char *zOrig = db_column_text(&q, 2);
662 int frid = db_column_int(&q, 3);
663 int isExe = db_column_int(&q, 4);
664 int isLink = db_column_int(&q, 5);
665 int isSelected = db_column_int(&q, 6);
666 const char *zPerm;
667 int cmp;
668 #if !defined(_WIN32)
669 int mPerm;
670
671 /* For unix, extract the "executable" and "symlink" permissions
672 ** directly from the filesystem. On windows, permissions are
673 ** unchanged from the original.
674 */
675
676 blob_resize(&filename, nBasename);
677 blob_append(&filename, zName, -1);
678
679 mPerm = file_wd_perm(blob_str(&filename));
680 isExe = ( mPerm==PERM_EXE );
681 isLink = ( mPerm==PERM_LNK );
 
 
682 #endif
683 if( isExe ){
684 zPerm = " x";
685 }else if( isLink ){
686 zPerm = " l"; /* note: symlinks don't have executable bit on unix */
687 }else{
688 zPerm = "";
689
+1 -1
--- src/file.c
+++ src/file.c
@@ -899,11 +899,11 @@
899899
int file_is_the_same(Blob *pContent, const char *zName){
900900
i64 iSize;
901901
int rc;
902902
Blob onDisk;
903903
904
- iSize = file_size(zName);
904
+ iSize = file_wd_size(zName);
905905
if( iSize<0 ) return 0;
906906
if( iSize!=blob_size(pContent) ) return 0;
907907
if( file_wd_islink(zName) ){
908908
blob_read_link(&onDisk, zName);
909909
}else{
910910
--- src/file.c
+++ src/file.c
@@ -899,11 +899,11 @@
899 int file_is_the_same(Blob *pContent, const char *zName){
900 i64 iSize;
901 int rc;
902 Blob onDisk;
903
904 iSize = file_size(zName);
905 if( iSize<0 ) return 0;
906 if( iSize!=blob_size(pContent) ) return 0;
907 if( file_wd_islink(zName) ){
908 blob_read_link(&onDisk, zName);
909 }else{
910
--- src/file.c
+++ src/file.c
@@ -899,11 +899,11 @@
899 int file_is_the_same(Blob *pContent, const char *zName){
900 i64 iSize;
901 int rc;
902 Blob onDisk;
903
904 iSize = file_wd_size(zName);
905 if( iSize<0 ) return 0;
906 if( iSize!=blob_size(pContent) ) return 0;
907 if( file_wd_islink(zName) ){
908 blob_read_link(&onDisk, zName);
909 }else{
910
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
14421442
Blob sql;
14431443
int objid = 0;
14441444
Blob uuid;
14451445
int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
14461446
int showfilesFlag = 0 ;
1447
-
1448
- db_find_and_open_repository(0, 0);
14491447
showfilesFlag = find_option("showfiles","f", 0)!=0;
14501448
db_find_and_open_repository(0, 0);
14511449
zCount = find_option("count","n",1);
14521450
zType = find_option("type","t",1);
14531451
if( zCount ){
14541452
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
1442 Blob sql;
1443 int objid = 0;
1444 Blob uuid;
1445 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1446 int showfilesFlag = 0 ;
1447
1448 db_find_and_open_repository(0, 0);
1449 showfilesFlag = find_option("showfiles","f", 0)!=0;
1450 db_find_and_open_repository(0, 0);
1451 zCount = find_option("count","n",1);
1452 zType = find_option("type","t",1);
1453 if( zCount ){
1454
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
1442 Blob sql;
1443 int objid = 0;
1444 Blob uuid;
1445 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1446 int showfilesFlag = 0 ;
 
 
1447 showfilesFlag = find_option("showfiles","f", 0)!=0;
1448 db_find_and_open_repository(0, 0);
1449 zCount = find_option("count","n",1);
1450 zType = find_option("type","t",1);
1451 if( zCount ){
1452
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
14421442
Blob sql;
14431443
int objid = 0;
14441444
Blob uuid;
14451445
int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
14461446
int showfilesFlag = 0 ;
1447
-
1448
- db_find_and_open_repository(0, 0);
14491447
showfilesFlag = find_option("showfiles","f", 0)!=0;
14501448
db_find_and_open_repository(0, 0);
14511449
zCount = find_option("count","n",1);
14521450
zType = find_option("type","t",1);
14531451
if( zCount ){
14541452
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
1442 Blob sql;
1443 int objid = 0;
1444 Blob uuid;
1445 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1446 int showfilesFlag = 0 ;
1447
1448 db_find_and_open_repository(0, 0);
1449 showfilesFlag = find_option("showfiles","f", 0)!=0;
1450 db_find_and_open_repository(0, 0);
1451 zCount = find_option("count","n",1);
1452 zType = find_option("type","t",1);
1453 if( zCount ){
1454
--- src/timeline.c
+++ src/timeline.c
@@ -1442,12 +1442,10 @@
1442 Blob sql;
1443 int objid = 0;
1444 Blob uuid;
1445 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1446 int showfilesFlag = 0 ;
 
 
1447 showfilesFlag = find_option("showfiles","f", 0)!=0;
1448 db_find_and_open_repository(0, 0);
1449 zCount = find_option("count","n",1);
1450 zType = find_option("type","t",1);
1451 if( zCount ){
1452

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button