Mercurial > hg
comparison hgext/eol.py @ 43204:fd8c3f59b544
eol: cache needs update, also if it has same timestamp as the source
Ignoring same timestamp could (in theory?) cause changes to not be detected.
It might happen quite often that the cache is populated right after .hgeol has
been updated and they thus have the same time stamp second. But we want
correctness, and if it populates the cache so fast, then it can also not be a
big problem to run it again next time when the timestamp has moved on.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 13 Oct 2019 02:11:33 +0200 |
parents | d38f9117ee15 |
children | dfaa477e37a8 |
comparison
equal
deleted
inserted
replaced
43203:d38f9117ee15 | 43204:fd8c3f59b544 |
---|---|
399 try: | 399 try: |
400 eolmtime = os.path.getmtime(self.wjoin(b".hgeol")) | 400 eolmtime = os.path.getmtime(self.wjoin(b".hgeol")) |
401 except OSError: | 401 except OSError: |
402 eolmtime = 0 | 402 eolmtime = 0 |
403 | 403 |
404 if eolmtime > cachemtime: | 404 if eolmtime >= cachemtime and eolmtime > 0: |
405 self.ui.debug(b"eol: detected change in .hgeol\n") | 405 self.ui.debug(b"eol: detected change in .hgeol\n") |
406 | 406 |
407 hgeoldata = self.wvfs.read(b'.hgeol') | 407 hgeoldata = self.wvfs.read(b'.hgeol') |
408 neweol = eolfile(self.ui, self.root, hgeoldata) | 408 neweol = eolfile(self.ui, self.root, hgeoldata) |
409 | 409 |