[Differential] [Requested Changes] D21: rebase: rewrite defineparents

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Jul 14 19:17:10 UTC 2017


durin42 requested changes to this revision.
durin42 added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> rebase.py:910
>  
> -    p1n = parents[0].rev()
> -    if p1n in destancestors:
> -        p1 = dest
> -    elif p1n in state:
> -        if state[p1n] == nullmerge:
> -            p1 = dest
> -        elif state[p1n] in revskipped:
> -            p1 = nearestrebased(repo, p1n, state)
> -            if p1 is None:
> -                p1 = dest
> -        else:
> -            p1 = state[p1n]
> -    else: # p1n external
> -        p1 = dest
> -        p2 = p1n
> +        B' <- written during the rebase
> +        |

I can't figure out what this comment is trying to tell me. Why on earth would, given the graph I see, rebase rewrite my explicit 'hg rebase -r E -d F' into having B' as the destination?

> rebase.py:928
> +
> +    Besides, adjust dest according to existing rebase information. For example,
> +

Again, I'm confused. What's the rebase operation in play that is linearizing here? I don't even know how I'd spell that on the command line.

> rebase.py:964
> +def defineparents(repo, rev, dest, state):
> +    'Return the new parent relationship of the revision that will be rebased'
> +    cl = repo.changelog

Could you expand this docstring to explain what this means? I think that might make the whole change easier to review.

> rebase.py:1044
> +    else:
> +        # Prefer merge base candidates in (ALLSRC::). Because they are usually
> +        # not calculable from changelog DAG alone. For example,

Define ALLSRC - it's not in the codebase prior to this change.

REPOSITORY
  rHG Mercurial

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

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: quark, durin42
Cc: durin42, mercurial-devel


More information about the Mercurial-devel mailing list