Patchwork [5,of,8] eol: cache needs update, also if it has same timestamp as the source

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 14, 2019, 12:13 a.m.
Message ID <844fa54a1ffbc052fbcd.1571012019@xps>
Download mbox | patch
Permalink /patch/42304/
State Accepted
Headers show

Comments

Mads Kiilerich - Oct. 14, 2019, 12:13 a.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1570925493 -7200
#      Sun Oct 13 02:11:33 2019 +0200
# Node ID 844fa54a1ffbc052fbcd76f103b3db6b02a84690
# Parent  5670699747c92d725927e25754817d5aa498d728
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.

Patch

diff --git a/hgext/eol.py b/hgext/eol.py
--- a/hgext/eol.py
+++ b/hgext/eol.py
@@ -401,7 +401,7 @@  def reposetup(ui, repo):
             except OSError:
                 eolmtime = 0
 
-            if eolmtime > cachemtime:
+            if eolmtime >= cachemtime and eolmtime > 0:
                 self.ui.debug(b"eol: detected change in .hgeol\n")
 
                 hgeoldata = self.wvfs.read(b'.hgeol')