Commit f3cc7cb
committed
Update resource and codebase processing
- When you create a VirtualCodebase with multiple scans, we now prefix each
scan path with a codebase-1/, codebase-2/, etc. directory in addition to the
"virtual_root" shared root directory. Otherwise files data was overwritten
and inconsistent when each location "files" were sharing leading path
segments.
- When you create a VirtualCodebase with more than one Resource, we now recreate
the directory tree for any intermediary directory used in a path that is
otherwise missing from files path list.
In particular this behaviour changed when you create a VirtualCodebase from
a pervious Codebase created with a "full_root" argument. Previously, the
missing paths of a "full_root" Codebase were kept unchanged.
Noet that the VirtualCodebase has always ignored the "full_root" argument.
- The Resource has no rid (resource id) and no pid (parent id). Instead
we now use internally a simpler mapping of {path: Resource} object.
- The Codebase and VirtualCodebase are now iterable. Iterating on a codebase
is the same as a top-down walk.
- The Resource.path now never contains leading or trailing slash. We also
normalize the path everywhere. In particular this behaviour is visible when
you create a Codebase with a "full_root" argument. Previously, the paths of a
"full_root" Codebase were prefixed with a slash "/".
Signed-off-by: Philippe Ombredanne <[email protected]>1 parent 017b4e5 commit f3cc7cb
File tree
15 files changed
+2153
-426
lines changed- src/commoncode
- tests
- data/resource/virtual_codebase
15 files changed
+2153
-426
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
7 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
8 | 53 | | |
9 | 54 | | |
10 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
216 | | - | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
0 commit comments