comparison hgext/rebase.py @ 45546:3d47b5c7fe8d

rebase: remove redundant isinmemory argument from _origrebase() The argument is redundant with `rbst.inmemory`, which makes it unclear what to do if they were somehow different. Differential Revision: https://phab.mercurial-scm.org/D9070
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 18 Sep 2020 15:37:03 -0700
parents b4abfe142ff6
children 2dcf595f6985
comparison
equal deleted inserted replaced
45545:e5e1285b6f6f 45546:3d47b5c7fe8d
1108 needsabort = True 1108 needsabort = True
1109 try: 1109 try:
1110 overrides = {(b'rebase', b'singletransaction'): True} 1110 overrides = {(b'rebase', b'singletransaction'): True}
1111 with ui.configoverride(overrides, b'rebase'): 1111 with ui.configoverride(overrides, b'rebase'):
1112 _origrebase( 1112 _origrebase(
1113 ui, 1113 ui, repo, action, opts, rbsrt, leaveunfinished=True,
1114 repo,
1115 action,
1116 opts,
1117 rbsrt,
1118 inmemory=True,
1119 leaveunfinished=True,
1120 ) 1114 )
1121 except error.InMemoryMergeConflictsError: 1115 except error.InMemoryMergeConflictsError:
1122 ui.status(_(b'hit a merge conflict\n')) 1116 ui.status(_(b'hit a merge conflict\n'))
1123 return 1 1117 return 1
1124 except error.Abort: 1118 except error.Abort:
1157 ) 1151 )
1158 1152
1159 1153
1160 def _dorebase(ui, repo, action, opts, inmemory=False): 1154 def _dorebase(ui, repo, action, opts, inmemory=False):
1161 rbsrt = rebaseruntime(repo, ui, inmemory, opts) 1155 rbsrt = rebaseruntime(repo, ui, inmemory, opts)
1162 return _origrebase(ui, repo, action, opts, rbsrt, inmemory=inmemory) 1156 return _origrebase(ui, repo, action, opts, rbsrt)
1163 1157
1164 1158
1165 def _origrebase( 1159 def _origrebase(ui, repo, action, opts, rbsrt, leaveunfinished=False):
1166 ui, repo, action, opts, rbsrt, inmemory=False, leaveunfinished=False
1167 ):
1168 assert action != b'stop' 1160 assert action != b'stop'
1169 with repo.wlock(), repo.lock(): 1161 with repo.wlock(), repo.lock():
1170 if opts.get(b'interactive'): 1162 if opts.get(b'interactive'):
1171 try: 1163 try:
1172 if extensions.find(b'histedit'): 1164 if extensions.find(b'histedit'):
1207 # used in the 'hg pull --rebase' case, see issue 5214. 1199 # used in the 'hg pull --rebase' case, see issue 5214.
1208 destspace = opts.get(b'_destspace') 1200 destspace = opts.get(b'_destspace')
1209 destmap = _definedestmap( 1201 destmap = _definedestmap(
1210 ui, 1202 ui,
1211 repo, 1203 repo,
1212 inmemory, 1204 rbsrt.inmemory,
1213 opts.get(b'dest', None), 1205 opts.get(b'dest', None),
1214 opts.get(b'source', []), 1206 opts.get(b'source', []),
1215 opts.get(b'base', []), 1207 opts.get(b'base', []),
1216 opts.get(b'rev', []), 1208 opts.get(b'rev', []),
1217 destspace=destspace, 1209 destspace=destspace,
1232 # committing each node, which is slower but allows partial success. 1224 # committing each node, which is slower but allows partial success.
1233 with util.acceptintervention(tr): 1225 with util.acceptintervention(tr):
1234 # Same logic for the dirstate guard, except we don't create one when 1226 # Same logic for the dirstate guard, except we don't create one when
1235 # rebasing in-memory (it's not needed). 1227 # rebasing in-memory (it's not needed).
1236 dsguard = None 1228 dsguard = None
1237 if singletr and not inmemory: 1229 if singletr and not rbsrt.inmemory:
1238 dsguard = dirstateguard.dirstateguard(repo, b'rebase') 1230 dsguard = dirstateguard.dirstateguard(repo, b'rebase')
1239 with util.acceptintervention(dsguard): 1231 with util.acceptintervention(dsguard):
1240 rbsrt._performrebase(tr) 1232 rbsrt._performrebase(tr)
1241 if not leaveunfinished: 1233 if not leaveunfinished:
1242 rbsrt._finishrebase() 1234 rbsrt._finishrebase()