[PATCH] move util.opener to new opener.py

Matt Mackall mpm at selenic.com
Mon Mar 7 16:07:36 UTC 2011


On Mon, 2011-03-07 at 11:47 +0100, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1299494775 -3600
> # Node ID 9e5759970d0e793d39ae0f02d657942c84b35f68
> # Parent  c2eda93961ec30c984ea9244c8d8c72da72d405d
> move util.opener to new opener.py

I guess.

> and rename it to localopener

Why? We've gotten along fine with just "opener" for years.

> diff --git a/mercurial/opener.py b/mercurial/opener.py
> new file mode 100644
> --- /dev/null
> +++ b/mercurial/opener.py
> @@ -0,0 +1,138 @@
> +# opener.py - open files
> +#
> +#  Copyright Matt Mackall <mpm at selenic.com>
> +#
> +# This software may be used and distributed according to the terms of the
> +# GNU General Public License version 2 or any later version.
> +
> +import os, errno
> +import util
> +
> +propertycache = util.propertycache
> +
> +def _checknlink(testfile):
> +    '''check whether hardlink count reporting works properly'''

This should continue to live in util. The point of util is to isolate
the rest of the code as much as possible from OS specifics.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial-devel mailing list