Fossil SCM
Fix the new --tree option so that it only shows diffs of files that prefix match arguments on the command-line.
Commit
df94a3538e006dbac02850ad98ab70c4f23545303cf8b1b5106313d567ea025d
Parent
07a699738a2f3e9…
1 file changed
+9
-5
+9
-5
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -1116,15 +1116,19 @@ | ||
| 1116 | 1116 | db_prepare(&q, |
| 1117 | 1117 | "SELECT pathname FROM vfile WHERE vid=%d ORDER BY pathname", |
| 1118 | 1118 | vid |
| 1119 | 1119 | ); |
| 1120 | 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; | |
| 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); | |
| 1126 | 1130 | if( file_size(zLhs, ExtFILE)<0 ){ |
| 1127 | 1131 | blob_zero(&lhs); |
| 1128 | 1132 | }else{ |
| 1129 | 1133 | blob_read_from_file(&lhs, zLhs, ExtFILE); |
| 1130 | 1134 | } |
| 1131 | 1135 |
| --- 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 |