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

login
register
mail settings
Submitter phabricator
Date Sept. 11, 2017, 6:01 p.m.
Message ID <6c63947cb510f1579dda9186e4ccc307@localhost.localdomain>
Download mbox | patch
Permalink /patch/23785/
State Not Applicable
Headers show

Comments

phabricator - Sept. 11, 2017, 6:01 p.m.
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




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

Patch

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)