D645: rebase: remove unnecessary '.unfiltered()' calls

quark (Jun Wu) phabricator at mercurial-scm.org
Mon Sep 11 14:01:09 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7471193be725: rebase: remove unnecessary '.unfiltered()' calls (authored by quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D645?vs=1645&id=1720

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

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
@@ -192,7 +192,8 @@
                 self._writestatus(f)
 
     def _writestatus(self, f):
-        repo = self.repo.unfiltered()
+        repo = self.repo
+        assert repo.filtername is None
         f.write(repo[self.originalwd].hex() + '\n')
         # was "dest". we now write dest per src root below.
         f.write('\n')
@@ -215,7 +216,8 @@
     def restorestatus(self):
         """Restore a previously stored status"""
         self.prepared = True
-        repo = self.repo.unfiltered()
+        repo = self.repo
+        assert repo.filtername is None
         keepbranches = None
         legacydest = None
         collapse = False
@@ -1067,9 +1069,9 @@
               "experimental.allowdivergence=True")
         raise error.Abort(msg % (",".join(divhashes),), hint=h)
 
-def successorrevs(repo, rev):
+def successorrevs(unfi, rev):
     """yield revision numbers for successors of rev"""
-    unfi = repo.unfiltered()
+    assert unfi.filtername is None
     nodemap = unfi.changelog.nodemap
     for s in obsutil.allsuccessors(unfi.obsstore, [unfi[rev].node()]):
         if s in nodemap:
@@ -1091,7 +1093,8 @@
     block below.
     """
     # use unfiltered changelog since successorrevs may return filtered nodes
-    cl = repo.unfiltered().changelog
+    assert repo.filtername is None
+    cl = repo.changelog
     def isancestor(a, b):
         # take revision numbers instead of nodes
         if a == b:
@@ -1607,7 +1610,8 @@
     obsolete => None entries in the mapping indicate nodes with no successor"""
     obsoletenotrebased = {}
 
-    cl = repo.unfiltered().changelog
+    assert repo.filtername is None
+    cl = repo.changelog
     nodemap = cl.nodemap
     for srcrev in rebaseobsrevs:
         srcnode = cl.node(srcrev)



To: quark, #hg-reviewers, durham
Cc: mercurial-devel


More information about the Mercurial-devel mailing list