Mercurial > hg
comparison hgext/rebase.py @ 45792:1703a7f9d5b8
rebase: update commit hash references in the new commits
This excludes the --collapse case because degenerating to p1 is almost certainly
as wrong as leaving the old hashes in place. I expect most people to amend the
message explicitly when using that.
Differential Revision: https://phab.mercurial-scm.org/D9229
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 13 Oct 2020 14:16:21 -0400 |
parents | f90a5c211251 |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45791:1f9736eb0e65 | 45792:1703a7f9d5b8 |
---|---|
513 Return node of committed revision.''' | 513 Return node of committed revision.''' |
514 repo = self.repo | 514 repo = self.repo |
515 ctx = repo[rev] | 515 ctx = repo[rev] |
516 if commitmsg is None: | 516 if commitmsg is None: |
517 commitmsg = ctx.description() | 517 commitmsg = ctx.description() |
518 | |
519 # Skip replacement if collapsing, as that degenerates to p1 for all | |
520 # nodes. | |
521 if not self.collapsef: | |
522 cl = repo.changelog | |
523 commitmsg = rewriteutil.update_hash_refs( | |
524 repo, | |
525 commitmsg, | |
526 { | |
527 cl.node(oldrev): [cl.node(newrev)] | |
528 for oldrev, newrev in self.state.items() | |
529 if newrev != revtodo | |
530 }, | |
531 ) | |
532 | |
518 date = self.date | 533 date = self.date |
519 if date is None: | 534 if date is None: |
520 date = ctx.date() | 535 date = ctx.date() |
521 extra = {b'rebase_source': ctx.hex()} | 536 extra = {b'rebase_source': ctx.hex()} |
522 for c in self.extrafns: | 537 for c in self.extrafns: |