Mercurial > public > mercurial-scm > hg
comparison hgext/sparse.py @ 43506:9f70512ae2cf
cleanup: remove pointless r-prefixes on single-quoted strings
This is the promised second step on single-quoted strings. 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 -- \[\^b\]\[\^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/D7306
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 08 Nov 2019 11:19:20 -0800 |
parents | 66f2cc210a29 |
children | 9d2b2df2c2ba |
comparison
equal
deleted
inserted
replaced
43505:47fac1692ede | 43506:9f70512ae2cf |
---|---|
151 | 151 |
152 extensions.wrapfunction(logcmdutil, b'_initialrevs', _initialrevs) | 152 extensions.wrapfunction(logcmdutil, b'_initialrevs', _initialrevs) |
153 | 153 |
154 | 154 |
155 def _clonesparsecmd(orig, ui, repo, *args, **opts): | 155 def _clonesparsecmd(orig, ui, repo, *args, **opts): |
156 include_pat = opts.get(r'include') | 156 include_pat = opts.get('include') |
157 exclude_pat = opts.get(r'exclude') | 157 exclude_pat = opts.get('exclude') |
158 enableprofile_pat = opts.get(r'enable_profile') | 158 enableprofile_pat = opts.get('enable_profile') |
159 narrow_pat = opts.get(r'narrow') | 159 narrow_pat = opts.get('narrow') |
160 include = exclude = enableprofile = False | 160 include = exclude = enableprofile = False |
161 if include_pat: | 161 if include_pat: |
162 pat = include_pat | 162 pat = include_pat |
163 include = True | 163 include = True |
164 if exclude_pat: | 164 if exclude_pat: |
207 b'also include directories of added files in sparse config', | 207 b'also include directories of added files in sparse config', |
208 ) | 208 ) |
209 ) | 209 ) |
210 | 210 |
211 def _add(orig, ui, repo, *pats, **opts): | 211 def _add(orig, ui, repo, *pats, **opts): |
212 if opts.get(r'sparse'): | 212 if opts.get('sparse'): |
213 dirs = set() | 213 dirs = set() |
214 for pat in pats: | 214 for pat in pats: |
215 dirname, basename = util.split(pat) | 215 dirname, basename = util.split(pat) |
216 dirs.add(dirname) | 216 dirs.add(dirname) |
217 sparse.updateconfig(repo, list(dirs), opts, include=True) | 217 sparse.updateconfig(repo, list(dirs), opts, include=True) |