# HG changeset patch # User Martin von Zweigbergk # Date 2021-02-13 00:05:02 # Node ID d95edcbe5c99e8f489022f7627f27304c06c90b3 # Parent 7d80622fc21276aa17b0cc958c3d2494eb6ddf0e rebase: calculate obsolescense-related info earlier My goal is to use `rewriteutil.precheck()` in the rebase code. Since rebase does its own handling of divergent commits (it skips them instead of erroring out), we need to have divergence-causing commits filtered out early. This patch helps prepare for that. Differential Revision: https://phab.mercurial-scm.org/D10247 diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -368,6 +368,8 @@ class rebaseruntime(object): self.resume = True try: self.restorestatus() + # Calculate self.obsoletenotrebased + self._handleskippingobsolete() self.collapsemsg = restorecollapsemsg(self.repo, isabort) except error.RepoLookupError: if isabort: @@ -434,6 +436,9 @@ class rebaseruntime(object): self.prepared = True + # Calculate self.obsoletenotrebased + self._handleskippingobsolete() + def _assignworkingcopy(self): if self.inmemory: from mercurial.context import overlayworkingctx @@ -467,9 +472,6 @@ class rebaseruntime(object): _(b'cannot collapse multiple named branches') ) - # Calculate self.obsoletenotrebased - self._handleskippingobsolete() - # Keep track of the active bookmarks in order to reset them later self.activebookmark = self.activebookmark or repo._activebookmark if self.activebookmark: