Mercurial > public > mercurial-scm > hg
comparison mercurial/cmd_impls/graft.py @ 52333:da216ed31c3d
graft: explicitly pass the "tool" argument
That one is not preserved in the statefile, so we can explicitly pass it as
argument.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 20 Nov 2024 04:13:13 +0100 |
parents | 8d7029218a61 |
children | 77cb5d8643b3 |
comparison
equal
deleted
inserted
replaced
52332:8d7029218a61 | 52333:da216ed31c3d |
---|---|
218 revs.remove(r) | 218 revs.remove(r) |
219 if not revs: | 219 if not revs: |
220 return None | 220 return None |
221 | 221 |
222 dry_run = bool(opts.get("dry_run")) | 222 dry_run = bool(opts.get("dry_run")) |
223 return "GRAFT", [graftstate, statedata, revs, editor, cont, dry_run, opts] | 223 tool = opts.get('tool', b'') |
224 return "GRAFT", [graftstate, statedata, revs, editor, cont, dry_run, tool] | |
224 | 225 |
225 | 226 |
226 def _graft_revisions( | 227 def _graft_revisions( |
227 ui, | 228 ui, |
228 repo, | 229 repo, |
230 statedata, | 231 statedata, |
231 revs, | 232 revs, |
232 editor, | 233 editor, |
233 cont=False, | 234 cont=False, |
234 dry_run=False, | 235 dry_run=False, |
235 opts, | 236 tool=b'', |
236 ): | 237 ): |
237 """actually graft some revisions""" | 238 """actually graft some revisions""" |
238 for pos, ctx in enumerate(repo.set(b"%ld", revs)): | 239 for pos, ctx in enumerate(repo.set(b"%ld", revs)): |
239 desc = b'%d:%s "%s"' % ( | 240 desc = b'%d:%s "%s"' % ( |
240 ctx.rev(), | 241 ctx.rev(), |
262 message += b'\n(grafted from %s)' % ctx.hex() | 263 message += b'\n(grafted from %s)' % ctx.hex() |
263 | 264 |
264 # we don't merge the first commit when continuing | 265 # we don't merge the first commit when continuing |
265 if not cont: | 266 if not cont: |
266 # perform the graft merge with p1(rev) as 'ancestor' | 267 # perform the graft merge with p1(rev) as 'ancestor' |
267 overrides = {(b'ui', b'forcemerge'): opts.get('tool', b'')} | 268 overrides = {(b'ui', b'forcemerge'): tool} |
268 if b'base' in statedata: | 269 if b'base' in statedata: |
269 base = repo[statedata[b'base']] | 270 base = repo[statedata[b'base']] |
270 else: | 271 else: |
271 base = ctx.p1() | 272 base = ctx.p1() |
272 with ui.configoverride(overrides, b'graft'): | 273 with ui.configoverride(overrides, b'graft'): |