Mercurial > public > mercurial-scm > hg-stable
diff mercurial/statprof.py @ 43551:313e3a279828
cleanup: remove pointless r-prefixes on double-quoted strings
This is only double-quoted strings. I'll do single-quoted strings as a
second step. These had existed because our source transformer didn't
turn r"" into b"", so we had tagged some strings as r-strings to get
"native" strings on both Pythons. Now that the transformer is gone, we
can dispense with this nonsense.
Methodology:
I ran
hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$' | xargs egrep --color=never -n -- \[\^a-z\]r\"\[\^\"\\\\\]\*\"\[\^\"\]
in an emacs grep-mode buffer, and then used a keyboard macro to
iterate over the results and remove the r prefix as needed.
# skip-blame removing unneeded r prefixes left over from Python 3 migration.
Differential Revision: https://phab.mercurial-scm.org/D7305
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 07 Nov 2019 13:18:19 -0500 |
parents | 5c9daf7df2b4 |
children | 9f70512ae2cf |
line wrap: on
line diff
--- a/mercurial/statprof.py Thu Nov 07 03:59:22 2019 -0800 +++ b/mercurial/statprof.py Thu Nov 07 13:18:19 2019 -0500 @@ -126,20 +126,20 @@ __all__ = [b'start', b'stop', b'reset', b'display', b'profile'] skips = { - r"util.py:check", - r"extensions.py:closure", - r"color.py:colorcmd", - r"dispatch.py:checkargs", - r"dispatch.py:<lambda>", - r"dispatch.py:_runcatch", - r"dispatch.py:_dispatch", - r"dispatch.py:_runcommand", - r"pager.py:pagecmd", - r"dispatch.py:run", - r"dispatch.py:dispatch", - r"dispatch.py:runcommand", - r"hg.py:<module>", - r"evolve.py:warnobserrors", + "util.py:check", + "extensions.py:closure", + "color.py:colorcmd", + "dispatch.py:checkargs", + "dispatch.py:<lambda>", + "dispatch.py:_runcatch", + "dispatch.py:_dispatch", + "dispatch.py:_runcommand", + "pager.py:pagecmd", + "dispatch.py:run", + "dispatch.py:dispatch", + "dispatch.py:runcommand", + "hg.py:<module>", + "evolve.py:warnobserrors", } ########################################################################### @@ -1061,15 +1061,15 @@ displayargs[b'limit'] = 0.05 path = None for o, value in opts: - if o in (r"-l", r"--limit"): + if o in ("-l", "--limit"): displayargs[b'limit'] = float(value) - elif o in (r"-f", r"--file"): + elif o in ("-f", "--file"): path = value - elif o in (r"-o", r"--output-file"): + elif o in ("-o", "--output-file"): displayargs[b'outputfile'] = value - elif o in (r"-p", r"--script-path"): + elif o in ("-p", "--script-path"): displayargs[b'scriptpath'] = value - elif o in (r"-h", r"help"): + elif o in ("-h", "help"): printusage() return 0 else: @@ -1086,5 +1086,5 @@ return 0 -if __name__ == r"__main__": +if __name__ == "__main__": sys.exit(main())