Skip to content

Commit 7758e01

Browse files
authored
Provide the reason why a document is out of date in all cases (#11572)
1 parent e7cd97e commit 7758e01

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Features added
3737
Patch by Rouslan Korneychuk.
3838
* #10938: doctest: Add :confval:`doctest_show_successes` option.
3939
Patch by Trey Hunner.
40+
* #11572: Improve ``debug`` logging of reasons why files are detected as out of
41+
date.
42+
Patch by Eric Larson.
4043

4144
Bugs fixed
4245
----------

sphinx/environment/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,24 @@ def get_outdated_files(self, config_changed: bool) -> tuple[set[str], set[str],
502502
# this will do the right thing when dep is absolute too
503503
deppath = path.join(self.srcdir, dep)
504504
if not path.isfile(deppath):
505+
logger.debug(
506+
'[build target] changed %r missing dependency %r',
507+
docname, deppath,
508+
)
505509
changed.add(docname)
506510
break
507511
depmtime = _last_modified_time(deppath)
508512
if depmtime > mtime:
513+
mtime_dt = datetime.fromtimestamp(
514+
mtime / 1_000_000, tz=timezone.utc,
515+
)
516+
depmtime_dt = datetime.fromtimestamp(
517+
depmtime / 1_000_000, tz=timezone.utc,
518+
)
519+
logger.debug(
520+
'[build target] outdated %r from dependency %r: %s -> %s',
521+
docname, deppath, mtime_dt, depmtime_dt,
522+
)
509523
changed.add(docname)
510524
break
511525
except OSError:

0 commit comments

Comments
 (0)