changeset 18293:1f35d6737ed8

repoview: extract hideable revision computation in a dedicated function This will help extensions to plug into the hidden mechanism.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 10 Jan 2013 10:25:02 +0100
parents 5db16424142c
children 65cec7fa5472
files mercurial/repoview.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)