[PATCH 2 of 3] rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)

Yuya Nishihara yuya at tcha.org
Fri May 5 22:19:09 EDT 2017


On Thu, 04 May 2017 13:20:11 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1489219466 28800
> #      Sat Mar 11 00:04:26 2017 -0800
> # Node ID 2765672140ea50f5587be486b25af10509a3d35b
> # Parent  5af88edb7a0bbafad999a2cef8968efbfd64becf
> rebase: allow rebase even if some revisions need no rebase (BC) (issue5422)
> 
> This allows you to do e.g. "hg rebase -d @ -r 'draft()'" even if some
> drafts are already based off of @. You'd still need to exclude
> obsolete and troubled revisions, though. We will deal with those cases
> later.
> 
> Implemented by treating state[rev]==rev as "no need to rebase". I
> considered adding another fake revision number like revdone=-6. That
> would make the code clearer in a few places, but would add extra code
> in other places.

Perhaps updatebookmarks() will need a guard to not flag
tr.hookargs['bookmark_moved'] by null move.

I'm not sure if the fake revision is better. Using 'state[rev] = rev' makes
sense, but we'll have to check all places where state[rev] are used anyway.


More information about the Mercurial-devel mailing list