60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
-
+
+
|
(blob_size(&where)>0) ? "OR" : "AND", zName,
filename_collation(), zName, filename_collation(),
zName, filename_collation()
);
}
db_prepare(&q,
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0)"
"SELECT pathname, deleted, chnged, rid, coalesce(origname!=pathname,0), islink"
" FROM vfile "
" WHERE is_selected(id) %s"
" AND (chnged OR deleted OR rid=0 OR pathname!=origname)"
" ORDER BY 1 /*scan*/",
blob_sql_text(&where)
);
blob_zero(&rewrittenPathname);
while( db_step(&q)==SQLITE_ROW ){
const char *zPathname = db_column_text(&q,0);
const char *zDisplayName = zPathname;
int isDeleted = db_column_int(&q, 1);
int isChnged = db_column_int(&q,2);
int isNew = db_column_int(&q,3)==0;
int isRenamed = db_column_int(&q,4);
int isLink = db_column_int(&q,5);
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
if( cwdRelative ){
file_relative_name(zFullName, &rewrittenPathname, 0);
zDisplayName = blob_str(&rewrittenPathname);
if( zDisplayName[0]=='.' && zDisplayName[1]=='/' ){
zDisplayName += 2; /* no unnecessary ./ prefix */
}
|
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
-
+
|
blob_appendf(report, "EXECUTABLE %s\n", zDisplayName);
}else if( isChnged==7 ){
blob_appendf(report, "SYMLINK %s\n", zDisplayName);
}else if( isChnged==8 ){
blob_appendf(report, "UNEXEC %s\n", zDisplayName);
}else if( isChnged==9 ){
blob_appendf(report, "UNLINK %s\n", zDisplayName);
}else if( file_contains_merge_marker(zFullName) ){
}else if( !isLink && file_contains_merge_marker(zFullName) ){
blob_appendf(report, "CONFLICT %s\n", zDisplayName);
}else{
blob_appendf(report, "EDITED %s\n", zDisplayName);
}
}else if( isRenamed ){
blob_appendf(report, "RENAMED %s\n", zDisplayName);
}else{
|
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
|
-
+
+
|
" datetime(checkin_mtime(%d,rid),'unixepoch'%s)"
" FROM vfile %s"
" ORDER BY %s",
vid, timeline_utc(), blob_sql_text(&where), zOrderBy /*safe-for-%s*/
);
}else{
db_prepare(&q,
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0)"
"SELECT pathname, deleted, rid, chnged, coalesce(origname!=pathname,0), islink"
" FROM vfile %s"
" ORDER BY %s", blob_sql_text(&where), zOrderBy /*safe-for-%s*/
);
}
blob_reset(&where);
while( db_step(&q)==SQLITE_ROW ){
const char *zPathname = db_column_text(&q,0);
int isDeleted = db_column_int(&q, 1);
int isNew = db_column_int(&q,2)==0;
int chnged = db_column_int(&q,3);
int renamed = db_column_int(&q,4);
int isLink = db_column_int(&q,5);
char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname);
const char *type = "";
if( verboseFlag ){
if( isNew ){
type = "ADDED ";
}else if( isDeleted ){
type = "DELETED ";
|
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
|
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
-
+
|
type = "UPDATED_BY_MERGE ";
}else if( chnged==3 ){
type = "ADDED_BY_MERGE ";
}else if( chnged==4 ){
type = "UPDATED_BY_INTEGRATE ";
}else if( chnged==5 ){
type = "ADDED_BY_INTEGRATE ";
}else if( file_contains_merge_marker(zFullName) ){
}else if( !isLink && file_contains_merge_marker(zFullName) ){
type = "CONFLICT ";
}else{
type = "EDITED ";
}
}else if( renamed ){
type = "RENAMED ";
}else{
|