[PATCH 3 of 3] eol: on update, only re-check files if filtering changed

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Oct 9 10:45:27 EDT 2016



On 10/09/2016 04:19 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski at unity3d.com>
> # Date 1476021289 -7200
> #      Sun Oct 09 15:54:49 2016 +0200
> # Node ID 956e0c953cca045fc2bb57867b8c95f123d66841
> # Parent  5240a8c9b6289838592f24f4e41a1158a48b951a
> eol: on update, only re-check files if filtering changed
>
> Before, update would mark all files as 'normallookup' in dirstate if .hgeol
> changed so all files would get the new filtering applied. That takes some time
> ... and is pointless if the filtering for that file didn't change.
>
> Instead, keep track of the old filtering and only check files where the
> filtering is changed.
>
> To keep the old filtering, change to write the applied .hgeol content to
> .hg/eol.cache instead of just touching it. That change is backwards/forwards
> compatible.
>
> In a real world test, this takes an update that is changing .hgeol and 30000
> files from 12s to 4s - where the remaining eol overhead is 1-2s.
>
> diff --git a/hgext/eol.py b/hgext/eol.py
> --- a/hgext/eol.py
> +++ b/hgext/eol.py
> @@ -312,10 +312,15 @@ def reposetup(ui, repo):
>                  self._eolmatch = util.never
>                  return
>
> +            oldeol = None
>              try:
>                  cachemtime = os.path.getmtime(self.join("eol.cache"))

This seems like it should live in the "cache/" directory. Any reason not 
to ?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list