[PATCH] repoview: extract hideable revision computation in a dedicated function

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Thu Jan 10 03:44:54 CST 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357809902 -3600
# Node ID 034c5b46762bee1b902c4173152bf7bf1a42dbaf
# Parent  0d5a22f73a1f8d7b871c51bc8426264e8c629ce4
repoview: extract hideable revision computation in a dedicated function

This will help extensions to plug into the hidden mechanism.

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -10,16 +10,22 @@ import copy
 import phases
 import util
 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)
         revs = cl.revs(start=firsthideable)
         blockers = [r for r in revset._children(repo, revs, hideable)


More information about the Mercurial-devel mailing list