[PATCH 1 of 3] lfs: always exclude '.hg*' text files
Yuya Nishihara
yuya at tcha.org
Mon Jan 15 12:56:49 UTC 2018
On Sat, 13 Jan 2018 23:26:01 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1515892034 18000
> # Sat Jan 13 20:07:14 2018 -0500
> # Node ID 12187caa0688c05c7399f4a08df95f5b0630fa04
> # Parent c780e0649e4152180e892418f9879b82e51542c3
> lfs: always exclude '.hg*' text files
>
> I can't think of any problematic scenarios (though things might get interesting
> with .hgtags, since every head is consulted). The eol extension explicitly
> disables handling these files, and that seems reasonable here too.
>
> diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py
> --- a/hgext/lfs/wrapper.py
> +++ b/hgext/lfs/wrapper.py
> @@ -130,7 +130,9 @@
> textlen -= offset
>
> lfstrack = self.opener.options['lfstrack']
> - if lfstrack(self.filename, textlen):
> +
> + # Always exclude hg owned files
> + if not self.filename.startswith('.hg') and lfstrack(self.filename, textlen):
Seems fine. Queued, thanks.
CC-ed Jun since I'm not pretty sure if this is considered a nice feature.
More information about the Mercurial-devel
mailing list