changeset 50863:180ac919f062

locate: migrate `opts` to native kwargs
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 20 Aug 2023 01:27:36 -0400
parents 2bbc76528733
children 2c78ebaf4c2a
files mercurial/commands.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Aug 20 01:24:29 2023 -0400
+++ b/mercurial/commands.py	Sun Aug 20 01:27:36 2023 -0400
@@ -4497,16 +4497,19 @@
 
     Returns 0 if a match is found, 1 otherwise.
     """
-    opts = pycompat.byteskwargs(opts)
-    if opts.get(b'print0'):
+    if opts.get('print0'):
         end = b'\0'
     else:
         end = b'\n'
-    ctx = logcmdutil.revsingle(repo, opts.get(b'rev'), None)
+    ctx = logcmdutil.revsingle(repo, opts.get('rev'), None)
 
     ret = 1
     m = scmutil.match(
-        ctx, pats, opts, default=b'relglob', badfn=lambda x, y: False
+        ctx,
+        pats,
+        pycompat.byteskwargs(opts),
+        default=b'relglob',
+        badfn=lambda x, y: False,
     )
 
     ui.pager(b'locate')
@@ -4518,7 +4521,7 @@
         filesgen = ctx.matches(m)
     uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=bool(pats))
     for abs in filesgen:
-        if opts.get(b'fullpath'):
+        if opts.get('fullpath'):
             ui.write(repo.wjoin(abs), end)
         else:
             ui.write(uipathfn(abs), end)