D7631: absorb: allowing committed changes to be absorbed into their ancestors

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Jan 13 12:31:41 EST 2020


martinvonz added a comment.


  In D7631#112604 <https://phab.mercurial-scm.org/D7631#112604>, @rdamazio wrote:
  
  > In D7631#112414 <https://phab.mercurial-scm.org/D7631#112414>, @quark wrote:
  >
  >> `--rev` seems ambiguous since there might be different kinds of revisions to specify - target and revisions to edit. Maybe something like `--source`, `--from`, `--target`?
  >
  > Done. Used `--source` to match `rebase`.
  
  Sorry I didn't notice until now, but `--source` makes me think it will behave like `hg rebase --source` and absorb from the given commit and all its descendants. I would have preferred `--from` (and maybe a `--into` for choosing which commits to absorb into in the future).

INLINE COMMENTS

> pulkit wrote in absorb.py:993
> Sorry, I misunderstood the patch earlier. `rewriteutil.precheck` on target rev is not very helpful as we are not obsolete-ing that in this rev, but we are re-writing it's ancestors. So, if target-rev is a head, and `evolution.alloworphans=False` is set, it will still create orphans.
> 
> Not sure what's the best way forward, maybe we should do `rewriteutil.precheck` for the parent instead until we start obsoleting this rev.

Maybe I'm also misunderstanding what this patch does in that case. `hg absorb -r A` will not obsolete A? I would think it definitely should do that. Perhaps the successors or the absorbed commit should be all the nodes absorbed into as well as any potential leftovers (which were not absorbed).

> test-absorb-rev.t:63
> +
> +  $ hg absorb --apply-changes -s .^+.
> +  abort: revision set matched multiple revisions

nit: I think I've heard that `^` needs to be quoted on Windows, so maybe `-s '.^+.'`

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7631/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7631

To: rdamazio, #hg-reviewers
Cc: mharbison72, martinvonz, pulkit, quark, mercurial-devel


More information about the Mercurial-devel mailing list