Mercurial > public > mercurial-scm > hg
comparison contrib/phabricator.py @ 38336:bb7e3c6ef592
phabricator: preserve the phase when amending in the Differential fields
I have no idea if it's better to change scmutil.cleanupnodes() so that it has
the option to either apply a specific phase (e.g. for various --secret switches)
or carry over the phase of the old node. The benefit would be that the caller
doesn't have to remember to do this. The con is maybe inefficiency? I wrote
this up as issue5918. I'm leaving that open since Yuya flagged it as an API
bug.
Since most other callers already do this, it's the simplest fix. (It's not
obvious that `split`, `fix` and `rebase` are doing this, but there is test
coverage for `fix` and `rebase`, and experimenting with `split` shows it does
the right thing.)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 14 Jun 2018 12:35:04 -0400 |
parents | 5a7cf42ba6ef |
children | 81a4be7099fa |
comparison
equal
deleted
inserted
replaced
38332:7b12a2d2eedc | 38336:bb7e3c6ef592 |
---|---|
577 mapping.get(old.p2().node(), (old.p2(),))[0], | 577 mapping.get(old.p2().node(), (old.p2(),))[0], |
578 ] | 578 ] |
579 new = context.metadataonlyctx( | 579 new = context.metadataonlyctx( |
580 repo, old, parents=parents, text=newdesc, | 580 repo, old, parents=parents, text=newdesc, |
581 user=old.user(), date=old.date(), extra=old.extra()) | 581 user=old.user(), date=old.date(), extra=old.extra()) |
582 newnode = new.commit() | 582 |
583 overrides = {('phases', 'new-commit'): old.phase()} | |
584 with ui.configoverride(overrides, 'phabsend'): | |
585 newnode = new.commit() | |
586 | |
583 mapping[old.node()] = [newnode] | 587 mapping[old.node()] = [newnode] |
584 # Update diff property | 588 # Update diff property |
585 writediffproperties(unfi[newnode], diffmap[old.node()]) | 589 writediffproperties(unfi[newnode], diffmap[old.node()]) |
586 # Remove local tags since it's no longer necessary | 590 # Remove local tags since it's no longer necessary |
587 tagname = 'D%d' % drevid | 591 tagname = 'D%d' % drevid |