# HG changeset patch # User Pierre-Yves David # Date 1675394680 -3600 # Node ID 584fc92dd8d78ce889cc4bf31c49a2c6847e1f07 # Parent dde4b55a07854c4d0919db51f53dc84db26334d8 wrapfunction: use sysstr instead of bytes as argument in "narrow" This is as valid and simpler, it will help us to eventually get ride of `safehasattr`. diff -r dde4b55a0785 -r 584fc92dd8d7 hgext/largefiles/__init__.py --- a/hgext/largefiles/__init__.py Fri Feb 03 04:23:12 2023 +0100 +++ b/hgext/largefiles/__init__.py Fri Feb 03 04:24:40 2023 +0100 @@ -193,7 +193,7 @@ if name == b'rebase': # TODO: teach exthelper to handle this extensions.wrapfunction( - module, b'rebase', overrides.overriderebasecmd + module, 'rebase', overrides.overriderebasecmd ) diff -r dde4b55a0785 -r 584fc92dd8d7 hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Fri Feb 03 04:23:12 2023 +0100 +++ b/hgext/largefiles/overrides.py Fri Feb 03 04:24:40 2023 +0100 @@ -485,10 +485,10 @@ return lambda ctx: match wrappedmatchandpats = extensions.wrappedfunction( - scmutil, b'matchandpats', overridematchandpats + scmutil, 'matchandpats', overridematchandpats ) wrappedmakefilematcher = extensions.wrappedfunction( - logcmdutil, b'_makenofollowfilematcher', overridemakefilematcher + logcmdutil, '_makenofollowfilematcher', overridemakefilematcher ) with wrappedmatchandpats, wrappedmakefilematcher: return orig(ui, repo, *pats, **opts) @@ -793,7 +793,7 @@ match = orig(ctx, pats, opts, globbed, default, badfn=badfn) return composenormalfilematcher(match, manifest) - with extensions.wrappedfunction(scmutil, b'match', normalfilesmatchfn): + with extensions.wrappedfunction(scmutil, 'match', normalfilesmatchfn): try: result = orig(ui, repo, pats, opts, rename) except error.Abort as e: @@ -887,8 +887,8 @@ copiedfiles.append((src, dest)) orig(src, dest, *args, **kwargs) - with extensions.wrappedfunction(util, b'copyfile', overridecopyfile): - with extensions.wrappedfunction(scmutil, b'match', overridematch): + with extensions.wrappedfunction(util, 'copyfile', overridecopyfile): + with extensions.wrappedfunction(scmutil, 'match', overridematch): result += orig(ui, repo, listpats, opts, rename) lfdirstate = lfutil.openlfdirstate(ui, repo) @@ -999,7 +999,7 @@ m.matchfn = matchfn return m - with extensions.wrappedfunction(scmutil, b'match', overridematch): + with extensions.wrappedfunction(scmutil, 'match', overridematch): orig(ui, repo, ctx, *pats, **opts) newstandins = lfutil.getstandinsstate(repo) diff -r dde4b55a0785 -r 584fc92dd8d7 hgext/narrow/narrowcommands.py --- a/hgext/narrow/narrowcommands.py Fri Feb 03 04:23:12 2023 +0100 +++ b/hgext/narrow/narrowcommands.py Fri Feb 03 04:24:40 2023 +0100 @@ -128,7 +128,7 @@ kwargs[b'depth'] = opts[b'depth'] wrappedextraprepare = extensions.wrappedfunction( - exchange, b'_pullbundle2extraprepare', pullbundle2extraprepare_widen + exchange, '_pullbundle2extraprepare', pullbundle2extraprepare_widen ) with wrappedextraprepare: @@ -146,7 +146,7 @@ kwargs[b'depth'] = opts['depth'] wrappedextraprepare = extensions.wrappedfunction( - exchange, b'_pullbundle2extraprepare', pullbundle2extraprepare_widen + exchange, '_pullbundle2extraprepare', pullbundle2extraprepare_widen ) with wrappedextraprepare: @@ -201,7 +201,7 @@ extensions.wrapfunction( - exchange, b'_pullbundle2extraprepare', pullbundle2extraprepare + exchange, '_pullbundle2extraprepare', pullbundle2extraprepare ) @@ -366,7 +366,7 @@ kwargs[b'excludepats'] = newexcludes wrappedextraprepare = extensions.wrappedfunction( - exchange, b'_pullbundle2extraprepare', pullbundle2extraprepare_widen + exchange, '_pullbundle2extraprepare', pullbundle2extraprepare_widen ) # define a function that narrowbundle2 can call after creating the diff -r dde4b55a0785 -r 584fc92dd8d7 hgext/narrow/narrowwirepeer.py --- a/hgext/narrow/narrowwirepeer.py Fri Feb 03 04:23:12 2023 +0100 +++ b/hgext/narrow/narrowwirepeer.py Fri Feb 03 04:24:40 2023 +0100 @@ -36,7 +36,7 @@ kwargs["excludepats"] = b','.join(exclude) return orig(cmd, *args, **kwargs) - extensions.wrapfunction(peer, b'_calltwowaystream', wrapped) + extensions.wrapfunction(peer, '_calltwowaystream', wrapped) hg.wirepeersetupfuncs.append(wirereposetup)