comparison hgext/rebase.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 8ff1ecfadcd1
children 054846d213ba
comparison
equal deleted inserted replaced
43505:47fac1692ede 43506:9f70512ae2cf
2125 scmutil.cleanupnodes(repo, replacements, b'rebase', moves, backup=backup) 2125 scmutil.cleanupnodes(repo, replacements, b'rebase', moves, backup=backup)
2126 2126
2127 2127
2128 def pullrebase(orig, ui, repo, *args, **opts): 2128 def pullrebase(orig, ui, repo, *args, **opts):
2129 b'Call rebase after pull if the latter has been invoked with --rebase' 2129 b'Call rebase after pull if the latter has been invoked with --rebase'
2130 if opts.get(r'rebase'): 2130 if opts.get('rebase'):
2131 if ui.configbool(b'commands', b'rebase.requiredest'): 2131 if ui.configbool(b'commands', b'rebase.requiredest'):
2132 msg = _(b'rebase destination required by configuration') 2132 msg = _(b'rebase destination required by configuration')
2133 hint = _(b'use hg pull followed by hg rebase -d DEST') 2133 hint = _(b'use hg pull followed by hg rebase -d DEST')
2134 raise error.Abort(msg, hint=hint) 2134 raise error.Abort(msg, hint=hint)
2135 2135
2136 with repo.wlock(), repo.lock(): 2136 with repo.wlock(), repo.lock():
2137 if opts.get(r'update'): 2137 if opts.get('update'):
2138 del opts[r'update'] 2138 del opts['update']
2139 ui.debug( 2139 ui.debug(
2140 b'--update and --rebase are not compatible, ignoring ' 2140 b'--update and --rebase are not compatible, ignoring '
2141 b'the update flag\n' 2141 b'the update flag\n'
2142 ) 2142 )
2143 2143
2163 commands.postincoming = origpostincoming 2163 commands.postincoming = origpostincoming
2164 revspostpull = len(repo) 2164 revspostpull = len(repo)
2165 if revspostpull > revsprepull: 2165 if revspostpull > revsprepull:
2166 # --rev option from pull conflict with rebase own --rev 2166 # --rev option from pull conflict with rebase own --rev
2167 # dropping it 2167 # dropping it
2168 if r'rev' in opts: 2168 if 'rev' in opts:
2169 del opts[r'rev'] 2169 del opts['rev']
2170 # positional argument from pull conflicts with rebase's own 2170 # positional argument from pull conflicts with rebase's own
2171 # --source. 2171 # --source.
2172 if r'source' in opts: 2172 if 'source' in opts:
2173 del opts[r'source'] 2173 del opts['source']
2174 # revsprepull is the len of the repo, not revnum of tip. 2174 # revsprepull is the len of the repo, not revnum of tip.
2175 destspace = list(repo.changelog.revs(start=revsprepull)) 2175 destspace = list(repo.changelog.revs(start=revsprepull))
2176 opts[r'_destspace'] = destspace 2176 opts['_destspace'] = destspace
2177 try: 2177 try:
2178 rebase(ui, repo, **opts) 2178 rebase(ui, repo, **opts)
2179 except error.NoMergeDestAbort: 2179 except error.NoMergeDestAbort:
2180 # we can maybe update instead 2180 # we can maybe update instead
2181 rev, _a, _b = destutil.destupdate(repo) 2181 rev, _a, _b = destutil.destupdate(repo)
2185 ui.status(_(b'nothing to rebase - updating instead\n')) 2185 ui.status(_(b'nothing to rebase - updating instead\n'))
2186 # not passing argument to get the bare update behavior 2186 # not passing argument to get the bare update behavior
2187 # with warning and trumpets 2187 # with warning and trumpets
2188 commands.update(ui, repo) 2188 commands.update(ui, repo)
2189 else: 2189 else:
2190 if opts.get(r'tool'): 2190 if opts.get('tool'):
2191 raise error.Abort(_(b'--tool can only be used with --rebase')) 2191 raise error.Abort(_(b'--tool can only be used with --rebase'))
2192 ret = orig(ui, repo, *args, **opts) 2192 ret = orig(ui, repo, *args, **opts)
2193 2193
2194 return ret 2194 return ret
2195 2195