D2668: rebase: introduce support for automatically rebasing orphan changes

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sun Mar 4 17:08:41 EST 2018


indygreg requested changes to this revision.
indygreg added a comment.
This revision now requires changes to proceed.


  I'm +1 on the feature. We should bikeshed the naming.

INLINE COMMENTS

> rebase.py:123
>  
> +def _possibledestination(repo, rev):
> +    """Return all changesets that may be a new parent for `rev`."""

Let's add this to `destutil.py` instead of adding more code to `rebase.py`.

> rebase.py:147
> +                    dr = torev(n)
> +                    if dr != -1:
> +                        dest.add(dr)

This should use the `node.nullrev` constant.

> rebase.py:702
> +    ('a', 'abort', False, _('abort an interrupted rebase')),
> +    ('', 'auto', '', _('automatically rebase orphan revisions '
> +                       'in the specified revset (EXPERIMENTAL)')),

The fact that `auto` takes an argument makes it... not very //auto//.

I have a slight preference for ``--orphans <rev>``. All the other arguments that take revsets are nouns describing what will be operated on, what the revisions are being used for, etc.

> rebase.py:837
> +    if opts.get('auto'):
> +        for disallowed in 'rev', 'source', 'base', 'dest':
> +            if opts.get(disallowed):

An allow list is better. But I could let this slide.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list