repoview: extract hideable revision computation in a dedicated function
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 10 Jan 2013 10:25:02 +0100
changeset 18293 1f35d6737ed8
parent 18291 5db16424142c
child 18294 65cec7fa5472
repoview: extract hideable revision computation in a dedicated function This will help extensions to plug into the hidden mechanism.
mercurial/repoview.py
--- a/mercurial/repoview.py	Wed Jan 09 19:10:44 2013 -0600
+++ b/mercurial/repoview.py	Thu Jan 10 10:25:02 2013 +0100
@@ -12,12 +12,18 @@
 import obsolete, bookmarks, revset
 
 
+def hideablerevs(repo):
+    """Revisions candidates to be hidden
+
+    This is a standalone function to help extensions to wrap it."""
+    return obsolete.getrevs(repo, 'obsolete')
+
 def computehidden(repo):
     """compute the set of hidden revision to filter
 
     During most operation hidden should be filtered."""
     assert not repo.changelog.filteredrevs
-    hideable = obsolete.getrevs(repo, 'obsolete')
+    hideable = hideablerevs(repo)
     if hideable:
         cl = repo.changelog
         firsthideable = min(hideable)