Patchwork D10198: rebase: inline simple function for finding obsolete subset of commits

login
register
mail settings
Submitter phabricator
Date March 12, 2021, 11:50 p.m.
Message ID <differential-rev-PHID-DREV-zefvtcpruj3pmnfrsbug-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48513/
State Superseded
Headers show

Comments

phabricator - March 12, 2021, 11:50 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `_filterobsoleterevs()` is just one line long. It was introduced in
  2d294dada4f8 <https://phab.mercurial-scm.org/rHG2d294dada4f833d12ec0a7fbfde4c6d1c58cb800> (rebase: small refactoring to allow better extensibility
  from extensions, 2016-01-14), for use by the "inhibit" extension. That
  extension was removed from the evolve repo in 87e87881059d (compat:
  drop the inhibit hacky extension, 2017-10-24).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -474,7 +474,7 @@ 
                         )
 
         # Calculate self.obsoletenotrebased
-        obsrevs = _filterobsoleterevs(self.repo, self.state)
+        obsrevs = {r for r in self.state if self.repo[r].obsolete()}
         self._handleskippingobsolete(obsrevs, self.destmap)
 
         # Keep track of the active bookmarks in order to reset them later
@@ -2184,11 +2184,6 @@ 
     return ret
 
 
-def _filterobsoleterevs(repo, revs):
-    """returns a set of the obsolete revisions in revs"""
-    return {r for r in revs if repo[r].obsolete()}
-
-
 def _computeobsoletenotrebased(repo, rebaseobsrevs, destmap):
     """Return (obsoletenotrebased, obsoletewithoutsuccessorindestination).