D10246: rebase: let _handleskippingobsolete(self) read directly from self

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Mon Mar 22 17:36:55 UTC 2021


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The function already has `self` as an argument, so there's no need to
  pass data from `self` into it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -348,12 +348,9 @@
 
         return data
 
-    def _handleskippingobsolete(self, obsoleterevs, destmap):
-        """Compute structures necessary for skipping obsolete revisions
-
-        obsoleterevs:   iterable of all obsolete revisions in rebaseset
-        destmap:        {srcrev: destrev} destination revisions
-        """
+    def _handleskippingobsolete(self):
+        """Compute structures necessary for skipping obsolete revisions"""
+        obsoleterevs = {r for r in self.state if self.repo[r].obsolete()}
         self.obsoletenotrebased = {}
         if not self.ui.configbool(b'experimental', b'rebaseskipobsolete'):
             return
@@ -361,7 +358,7 @@
         (
             self.obsoletenotrebased,
             self.obsoletewithoutsuccessorindestination,
-        ) = _computeobsoletenotrebased(self.repo, obsoleteset, destmap)
+        ) = _computeobsoletenotrebased(self.repo, obsoleteset, self.destmap)
         skippedset = set(self.obsoletenotrebased)
         skippedset.update(self.obsoletewithoutsuccessorindestination)
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
@@ -472,8 +469,7 @@
                         )
 
         # Calculate self.obsoletenotrebased
-        obsrevs = {r for r in self.state if self.repo[r].obsolete()}
-        self._handleskippingobsolete(obsrevs, self.destmap)
+        self._handleskippingobsolete()
 
         # Keep track of the active bookmarks in order to reset them later
         self.activebookmark = self.activebookmark or repo._activebookmark



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


More information about the Mercurial-devel mailing list