Fossil SCM

Better outlining of output from "fossil status", "fossil changes" and "fossil ls --verbose". Let "fossil ls --verbose" differentiate between EDITED, CONFLICT, UPD_BY_MERGE and ADD_BY_MERGE, just like "fossil status" and "fossil changes"

jan.nijtmans 2013-07-22 08:55 trunk
Commit c41d70dccd14b619ebbe5a6069b8e4f37aec0987
1 file changed +31 -23
+31 -23
--- src/checkin.c
+++ src/checkin.c
@@ -84,41 +84,41 @@
8484
zDisplayName += 2; /* no unnecessary ./ prefix */
8585
}
8686
}
8787
blob_append(report, zPrefix, nPrefix);
8888
if( isDeleted ){
89
- blob_appendf(report, "DELETED %s\n", zDisplayName);
89
+ blob_appendf(report, "DELETED %s\n", zDisplayName);
9090
}else if( !file_wd_isfile_or_link(zFullName) ){
9191
if( file_access(zFullName, 0)==0 ){
92
- blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
92
+ blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
9393
if( missingIsFatal ){
9494
fossil_warning("not a file: %s", zDisplayName);
9595
nErr++;
9696
}
9797
}else{
98
- blob_appendf(report, "MISSING %s\n", zDisplayName);
98
+ blob_appendf(report, "MISSING %s\n", zDisplayName);
9999
if( missingIsFatal ){
100100
fossil_warning("missing file: %s", zDisplayName);
101101
nErr++;
102102
}
103103
}
104104
}else if( isNew ){
105
- blob_appendf(report, "ADDED %s\n", zDisplayName);
105
+ blob_appendf(report, "ADDED %s\n", zDisplayName);
106106
}else if( isDeleted ){
107
- blob_appendf(report, "DELETED %s\n", zDisplayName);
108
- }else if( isChnged==2 ){
109
- blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
110
- }else if( isChnged==3 ){
111
- blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
112
- }else if( isChnged==1 ){
113
- if( file_contains_merge_marker(zFullName) ){
114
- blob_appendf(report, "CONFLICT %s\n", zDisplayName);
107
+ blob_appendf(report, "DELETED %s\n", zDisplayName);
108
+ }else if( isChnged ){
109
+ if( isChnged==2 ){
110
+ blob_appendf(report, "UPD_BY_MERGE %s\n", zDisplayName);
111
+ }else if( isChnged==3 ){
112
+ blob_appendf(report, "ADD_BY_MERGE %s\n", zDisplayName);
113
+ }else if( file_contains_merge_marker(zFullName) ){
114
+ blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115115
}else{
116
- blob_appendf(report, "EDITED %s\n", zDisplayName);
116
+ blob_appendf(report, "EDITED %s\n", zDisplayName);
117117
}
118118
}else if( isRenamed ){
119
- blob_appendf(report, "RENAMED %s\n", zDisplayName);
119
+ blob_appendf(report, "RENAMED %s\n", zDisplayName);
120120
}else{
121121
report->nUsed -= nPrefix;
122122
}
123123
free(zFullName);
124124
}
@@ -127,12 +127,12 @@
127127
db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
128128
" WHERE id<=0");
129129
while( db_step(&q)==SQLITE_ROW ){
130130
const char *zLabel = "MERGED_WITH";
131131
switch( db_column_int(&q, 1) ){
132
- case -1: zLabel = "CHERRYPICK"; break;
133
- case -2: zLabel = "BACKOUT "; break;
132
+ case -1: zLabel = "CHERRYPICK "; break;
133
+ case -2: zLabel = "BACKOUT "; break;
134134
}
135135
blob_append(report, zPrefix, nPrefix);
136136
blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137137
}
138138
db_finalize(&q);
@@ -318,25 +318,33 @@
318318
int renamed = db_column_int(&q,4);
319319
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
320320
const char *type = "";
321321
if( verboseFlag ){
322322
if( isNew ){
323
- type = "ADDED ";
323
+ type = "ADDED ";
324324
}else if( isDeleted ){
325
- type = "DELETED ";
325
+ type = "DELETED ";
326326
}else if( !file_wd_isfile_or_link(zFullName) ){
327327
if( file_access(zFullName, 0)==0 ){
328
- type = "NOT_A_FILE ";
328
+ type = "NOT_A_FILE ";
329329
}else{
330
- type = "MISSING ";
330
+ type = "MISSING ";
331331
}
332332
}else if( chnged ){
333
- type = "EDITED ";
333
+ if( chnged==2 ){
334
+ type = "UPD_BY_MERGE ";
335
+ }else if( chnged==3 ){
336
+ type = "ADD_BY_MERGE ";
337
+ }else if( file_contains_merge_marker(zFullName) ){
338
+ type = "CONFLICT ";
339
+ }else{
340
+ type = "EDITED ";
341
+ }
334342
}else if( renamed ){
335
- type = "RENAMED ";
343
+ type = "RENAMED ";
336344
}else{
337
- type = "UNCHANGED ";
345
+ type = "UNCHANGED ";
338346
}
339347
}
340348
if( showAge ){
341349
fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname);
342350
}else{
343351
--- src/checkin.c
+++ src/checkin.c
@@ -84,41 +84,41 @@
84 zDisplayName += 2; /* no unnecessary ./ prefix */
85 }
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, 0)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
97 }else{
98 blob_appendf(report, "MISSING %s\n", zDisplayName);
99 if( missingIsFatal ){
100 fossil_warning("missing file: %s", zDisplayName);
101 nErr++;
102 }
103 }
104 }else if( isNew ){
105 blob_appendf(report, "ADDED %s\n", zDisplayName);
106 }else if( isDeleted ){
107 blob_appendf(report, "DELETED %s\n", zDisplayName);
108 }else if( isChnged==2 ){
109 blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName);
110 }else if( isChnged==3 ){
111 blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName);
112 }else if( isChnged==1 ){
113 if( file_contains_merge_marker(zFullName) ){
114 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115 }else{
116 blob_appendf(report, "EDITED %s\n", zDisplayName);
117 }
118 }else if( isRenamed ){
119 blob_appendf(report, "RENAMED %s\n", zDisplayName);
120 }else{
121 report->nUsed -= nPrefix;
122 }
123 free(zFullName);
124 }
@@ -127,12 +127,12 @@
127 db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
128 " WHERE id<=0");
129 while( db_step(&q)==SQLITE_ROW ){
130 const char *zLabel = "MERGED_WITH";
131 switch( db_column_int(&q, 1) ){
132 case -1: zLabel = "CHERRYPICK"; break;
133 case -2: zLabel = "BACKOUT "; break;
134 }
135 blob_append(report, zPrefix, nPrefix);
136 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137 }
138 db_finalize(&q);
@@ -318,25 +318,33 @@
318 int renamed = db_column_int(&q,4);
319 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
320 const char *type = "";
321 if( verboseFlag ){
322 if( isNew ){
323 type = "ADDED ";
324 }else if( isDeleted ){
325 type = "DELETED ";
326 }else if( !file_wd_isfile_or_link(zFullName) ){
327 if( file_access(zFullName, 0)==0 ){
328 type = "NOT_A_FILE ";
329 }else{
330 type = "MISSING ";
331 }
332 }else if( chnged ){
333 type = "EDITED ";
 
 
 
 
 
 
 
 
334 }else if( renamed ){
335 type = "RENAMED ";
336 }else{
337 type = "UNCHANGED ";
338 }
339 }
340 if( showAge ){
341 fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname);
342 }else{
343
--- src/checkin.c
+++ src/checkin.c
@@ -84,41 +84,41 @@
84 zDisplayName += 2; /* no unnecessary ./ prefix */
85 }
86 }
87 blob_append(report, zPrefix, nPrefix);
88 if( isDeleted ){
89 blob_appendf(report, "DELETED %s\n", zDisplayName);
90 }else if( !file_wd_isfile_or_link(zFullName) ){
91 if( file_access(zFullName, 0)==0 ){
92 blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName);
93 if( missingIsFatal ){
94 fossil_warning("not a file: %s", zDisplayName);
95 nErr++;
96 }
97 }else{
98 blob_appendf(report, "MISSING %s\n", zDisplayName);
99 if( missingIsFatal ){
100 fossil_warning("missing file: %s", zDisplayName);
101 nErr++;
102 }
103 }
104 }else if( isNew ){
105 blob_appendf(report, "ADDED %s\n", zDisplayName);
106 }else if( isDeleted ){
107 blob_appendf(report, "DELETED %s\n", zDisplayName);
108 }else if( isChnged ){
109 if( isChnged==2 ){
110 blob_appendf(report, "UPD_BY_MERGE %s\n", zDisplayName);
111 }else if( isChnged==3 ){
112 blob_appendf(report, "ADD_BY_MERGE %s\n", zDisplayName);
113 }else if( file_contains_merge_marker(zFullName) ){
114 blob_appendf(report, "CONFLICT %s\n", zDisplayName);
115 }else{
116 blob_appendf(report, "EDITED %s\n", zDisplayName);
117 }
118 }else if( isRenamed ){
119 blob_appendf(report, "RENAMED %s\n", zDisplayName);
120 }else{
121 report->nUsed -= nPrefix;
122 }
123 free(zFullName);
124 }
@@ -127,12 +127,12 @@
127 db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid"
128 " WHERE id<=0");
129 while( db_step(&q)==SQLITE_ROW ){
130 const char *zLabel = "MERGED_WITH";
131 switch( db_column_int(&q, 1) ){
132 case -1: zLabel = "CHERRYPICK "; break;
133 case -2: zLabel = "BACKOUT "; break;
134 }
135 blob_append(report, zPrefix, nPrefix);
136 blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0));
137 }
138 db_finalize(&q);
@@ -318,25 +318,33 @@
318 int renamed = db_column_int(&q,4);
319 char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
320 const char *type = "";
321 if( verboseFlag ){
322 if( isNew ){
323 type = "ADDED ";
324 }else if( isDeleted ){
325 type = "DELETED ";
326 }else if( !file_wd_isfile_or_link(zFullName) ){
327 if( file_access(zFullName, 0)==0 ){
328 type = "NOT_A_FILE ";
329 }else{
330 type = "MISSING ";
331 }
332 }else if( chnged ){
333 if( chnged==2 ){
334 type = "UPD_BY_MERGE ";
335 }else if( chnged==3 ){
336 type = "ADD_BY_MERGE ";
337 }else if( file_contains_merge_marker(zFullName) ){
338 type = "CONFLICT ";
339 }else{
340 type = "EDITED ";
341 }
342 }else if( renamed ){
343 type = "RENAMED ";
344 }else{
345 type = "UNCHANGED ";
346 }
347 }
348 if( showAge ){
349 fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname);
350 }else{
351

Keyboard Shortcuts

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