# HG changeset patch # User Franz Glasner # Date 1563396477 -7200 # Node ID 299fec856e23a67fb2351133096b06ed97115d10 # Parent 1c1a360edc86c5b5b08b7ab781a1de557b2a0ee9 Rename parameter "tsconfig" to "tsconfigname" in _gen_matcher_from_tsconfig diff -r 1c1a360edc86 -r 299fec856e23 extensions/timestamps.py --- a/extensions/timestamps.py Wed Jul 17 09:01:49 2019 +0200 +++ b/extensions/timestamps.py Wed Jul 17 22:47:57 2019 +0200 @@ -476,7 +476,7 @@ repo = ctx.repo() if not repo.local(): raise error.Abort(_(b"repository is not local")) - tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfig=tsconfig, ui=ui) + tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfigname=tsconfig, ui=ui) if tsconfmatch is None: raise error.Abort(_(b"timestamps are not activated/configured")) if amend: @@ -500,7 +500,7 @@ repo = ctx.repo() if not repo.local(): raise error.Abort(_(b"repository is not local")) - tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfig=tsconfig, ui=ui) + tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfigname=tsconfig, ui=ui) if tsconfmatch is None: raise error.Abort(_(b"timestamps are not activated/configured")) if destdir is None: @@ -524,7 +524,7 @@ # # NOTE: no need for a local repo here # - tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfig=tsconfig, ui=ui) \ + tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfigname=tsconfig, ui=ui) \ or _matchmod_never(ctx.repo().root, b"") ts = _Timestamps.from_ctx(ctx, ui, name=TIMESTAMPS_DATABASE) if ts is None: @@ -574,7 +574,7 @@ repo = ctx.repo() if not repo.local(): raise error.Abort(_(b"repository is not local")) - tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfig=tsconfig, ui=ui) + tsconfmatch = _gen_matcher_from_tsconfig(ctx, tsconfigname=tsconfig, ui=ui) if tsconfmatch is None: raise error.Abort(_(b"timestamps are not activated/configured")) if amend: @@ -600,7 +600,7 @@ ts.write(fp) -def _gen_matcher_from_tsconfig(ctx, tsconfig=None, ui=None): +def _gen_matcher_from_tsconfig(ctx, tsconfigname=None, ui=None): """Read the configuration file and return a Mercurial matcher which is configured. @@ -611,14 +611,14 @@ repo = ctx.repo() ui = ui or repo.ui configdata = configname = None - if tsconfig: + if tsconfigname: try: - with io.open(tsconfig, "rb") as fp: + with io.open(tsconfigname, "rb") as fp: configdata = fp.read() except IOError: pass else: - configname = tsconfig + configname = tsconfigname else: try: configdata = ctx[TIMESTAMPS_CONFIGFILE].data()