File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ def graph(
48
48
49
49
data = []
50
50
state = State (config )
51
- abs_path = config .path / pathlib .Path (path )
52
51
53
52
if x_axis is None :
54
53
x_axis = "history"
@@ -58,12 +57,17 @@ def graph(
58
57
y_metric = resolve_metric (metrics [0 ])
59
58
title = f"{ x_axis .capitalize ()} of { y_metric .description } for { path } { ' aggregated' if aggregate else '' } "
60
59
61
- if abs_path .is_dir () and not aggregate :
62
- paths = [
63
- p .relative_to (config .path ) for p in pathlib .Path (abs_path ).glob ("**/*.py" )
64
- ]
60
+ if not aggregate :
61
+ tracked_files = set ()
62
+ for rev in state .index [state .default_archiver ].revisions :
63
+ tracked_files .update (rev .revision .tracked_files )
64
+ paths = {
65
+ tracked_file
66
+ for tracked_file in tracked_files
67
+ if tracked_file .startswith (path )
68
+ } or {path }
65
69
else :
66
- paths = [ path ]
70
+ paths = { path }
67
71
68
72
operator , key = metric_parts (metrics [0 ])
69
73
if len (metrics ) == 1 : # only y-axis
@@ -104,7 +108,9 @@ def graph(
104
108
x_key ,
105
109
)
106
110
)
107
- labels .append (f"{ rev .revision .author_name } <br>{ rev .revision .message } " )
111
+ labels .append (
112
+ f"{ rev .revision .author_name } <br>{ rev .revision .message } "
113
+ )
108
114
last_y = val
109
115
except KeyError :
110
116
# missing data
You can’t perform that action at this time.
0 commit comments