Fossil SCM

Fix the new --tree option so that it only shows diffs of files that prefix match arguments on the command-line.

drh 2024-12-14 19:57 diff-tree
Commit df94a3538e006dbac02850ad98ab70c4f23545303cf8b1b5106313d567ea025d
1 file changed +9 -5
+9 -5
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1116,15 +1116,19 @@
11161116
db_prepare(&q,
11171117
"SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname",
11181118
vid
11191119
);
11201120
while( db_step(&q)==SQLITE_ROW ){
1121
- const char *zTreename = db_column_text(&q,0);
1122
- char *zLhs = mprintf("%s/%s", zExternTree, zTreename);
1123
- char *zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
1124
- Blob rhs;
1125
- Blob lhs;
1121
+ const char *zTreename = db_column_text(&q,0); /* Repo tree name of file */
1122
+ char *zLhs; /* Full name of left-hand side file */
1123
+ char *zRhs; /* Full name of right-hand side file */
1124
+ Blob rhs; /* Full text of RHS */
1125
+ Blob lhs; /* Full text of LHS */
1126
+
1127
+ if( !file_dir_match(pFileDir, zTreename) ) continue;
1128
+ zLhs = mprintf("%s/%s", zExternTree, zTreename);
1129
+ zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
11261130
if( file_size(zLhs, ExtFILE)<0 ){
11271131
blob_zero(&lhs);
11281132
}else{
11291133
blob_read_from_file(&lhs, zLhs, ExtFILE);
11301134
}
11311135
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1116,15 +1116,19 @@
1116 db_prepare(&q,
1117 "SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname",
1118 vid
1119 );
1120 while( db_step(&q)==SQLITE_ROW ){
1121 const char *zTreename = db_column_text(&q,0);
1122 char *zLhs = mprintf("%s/%s", zExternTree, zTreename);
1123 char *zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
1124 Blob rhs;
1125 Blob lhs;
 
 
 
 
1126 if( file_size(zLhs, ExtFILE)<0 ){
1127 blob_zero(&lhs);
1128 }else{
1129 blob_read_from_file(&lhs, zLhs, ExtFILE);
1130 }
1131
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -1116,15 +1116,19 @@
1116 db_prepare(&q,
1117 "SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname",
1118 vid
1119 );
1120 while( db_step(&q)==SQLITE_ROW ){
1121 const char *zTreename = db_column_text(&q,0); /* Repo tree name of file */
1122 char *zLhs; /* Full name of left-hand side file */
1123 char *zRhs; /* Full name of right-hand side file */
1124 Blob rhs; /* Full text of RHS */
1125 Blob lhs; /* Full text of LHS */
1126
1127 if( !file_dir_match(pFileDir, zTreename) ) continue;
1128 zLhs = mprintf("%s/%s", zExternTree, zTreename);
1129 zRhs = mprintf("%s%s", g.zLocalRoot, zTreename);
1130 if( file_size(zLhs, ExtFILE)<0 ){
1131 blob_zero(&lhs);
1132 }else{
1133 blob_read_from_file(&lhs, zLhs, ExtFILE);
1134 }
1135

Keyboard Shortcuts

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