Fossil SCM

Make the "ls" command report MISSING instead of EDITED for files that do not exist in the tree. Ticket [ce458c35ca].

drh 2008-10-31 14:01 trunk
Commit 89d100b8451bda7fcf82acdbb70999d866175900
1 file changed +4
--- src/checkin.c
+++ src/checkin.c
@@ -134,19 +134,23 @@
134134
while( db_step(&q)==SQLITE_ROW ){
135135
const char *zPathname = db_column_text(&q,0);
136136
int isDeleted = db_column_int(&q, 1);
137137
int isNew = db_column_int(&q,2)==0;
138138
int chnged = db_column_int(&q,3);
139
+ char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
139140
if( isNew ){
140141
printf("ADDED %s\n", zPathname);
142
+ }else if( access(zFullName, 0) ){
143
+ printf("MISSING %s\n", zPathname);
141144
}else if( isDeleted ){
142145
printf("DELETED %s\n", zPathname);
143146
}else if( chnged ){
144147
printf("EDITED %s\n", zPathname);
145148
}else{
146149
printf("UNCHANGED %s\n", zPathname);
147150
}
151
+ free(zFullName);
148152
}
149153
db_finalize(&q);
150154
}
151155
152156
/*
153157
--- src/checkin.c
+++ src/checkin.c
@@ -134,19 +134,23 @@
134 while( db_step(&q)==SQLITE_ROW ){
135 const char *zPathname = db_column_text(&q,0);
136 int isDeleted = db_column_int(&q, 1);
137 int isNew = db_column_int(&q,2)==0;
138 int chnged = db_column_int(&q,3);
 
139 if( isNew ){
140 printf("ADDED %s\n", zPathname);
 
 
141 }else if( isDeleted ){
142 printf("DELETED %s\n", zPathname);
143 }else if( chnged ){
144 printf("EDITED %s\n", zPathname);
145 }else{
146 printf("UNCHANGED %s\n", zPathname);
147 }
 
148 }
149 db_finalize(&q);
150 }
151
152 /*
153
--- src/checkin.c
+++ src/checkin.c
@@ -134,19 +134,23 @@
134 while( db_step(&q)==SQLITE_ROW ){
135 const char *zPathname = db_column_text(&q,0);
136 int isDeleted = db_column_int(&q, 1);
137 int isNew = db_column_int(&q,2)==0;
138 int chnged = db_column_int(&q,3);
139 char *zFullName = mprintf("%s/%s", g.zLocalRoot, zPathname);
140 if( isNew ){
141 printf("ADDED %s\n", zPathname);
142 }else if( access(zFullName, 0) ){
143 printf("MISSING %s\n", zPathname);
144 }else if( isDeleted ){
145 printf("DELETED %s\n", zPathname);
146 }else if( chnged ){
147 printf("EDITED %s\n", zPathname);
148 }else{
149 printf("UNCHANGED %s\n", zPathname);
150 }
151 free(zFullName);
152 }
153 db_finalize(&q);
154 }
155
156 /*
157

Keyboard Shortcuts

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