obsolete: improve revset online help
authorPatrick Mezard <patrick@mezard.eu>
Sun, 29 Jul 2012 17:10:43 +0200
changeset 397 0bd63f294a6f
parent 393 ac8213faeda8
child 398 42828b0ace98
obsolete: improve revset online help
hgext/obsolete.py
--- a/hgext/obsolete.py	Thu Jul 26 15:17:34 2012 +0200
+++ b/hgext/obsolete.py	Sun Jul 29 17:10:43 2012 +0200
@@ -124,44 +124,60 @@
 #############################
 
 def revsethidden(repo, subset, x):
-    """hidden changesets"""
+    """``hidden()``
+    Changeset is hidden.
+    """
     args = revset.getargs(x, 0, 0, 'hidden takes no argument')
     return [r for r in subset if r in repo.changelog.hiddenrevs]
 
 def revsetobsolete(repo, subset, x):
-    """obsolete changesets"""
+    """``obsolete()``
+    Changeset is obsolete.
+    """
     args = revset.getargs(x, 0, 0, 'obsolete takes no argument')
     return [r for r in subset if r in repo._obsoleteset and repo._phasecache.phase(repo, r) > 0]
 
 # XXX Backward compatibility, to be removed once stabilized
 if '_phasecache' not in vars(localrepo.localrepository): # new api
     def revsetobsolete(repo, subset, x):
-        """obsolete changesets"""
+        """``obsolete()``
+        Changeset is obsolete.
+        """
         args = revset.getargs(x, 0, 0, 'obsolete takes no argument')
         return [r for r in subset if r in repo._obsoleteset and repo._phaserev[r] > 0]
 
 def revsetunstable(repo, subset, x):
-    """non obsolete changesets descendant of obsolete one"""
+    """``unstable()``
+    Unstable changesets are non-obsolete with obsolete ancestors.
+    """
     args = revset.getargs(x, 0, 0, 'unstable takes no arguments')
     return [r for r in subset if r in repo._unstableset]
 
 def revsetsuspended(repo, subset, x):
-    """obsolete changesets with non obsolete descendants"""
+    """``suspended()``
+    Obsolete changesets with non-obsolete descendants.
+    """
     args = revset.getargs(x, 0, 0, 'suspended takes no arguments')
     return [r for r in subset if r in repo._suspendedset]
 
 def revsetextinct(repo, subset, x):
-    """obsolete changesets without obsolete descendants"""
+    """``extinct()``
+    Obsolete changesets with obsolete descendants only.
+    """
     args = revset.getargs(x, 0, 0, 'extinct takes no arguments')
     return [r for r in subset if r in repo._extinctset]
 
 def revsetlatecomer(repo, subset, x):
-    """latecomer, Try to succeed to public change"""
+    """``latecomer()``
+    Changesets marked as successors of public changesets.
+    """
     args = revset.getargs(x, 0, 0, 'latecomer takes no arguments')
     return [r for r in subset if r in repo._latecomerset]
 
 def revsetconflicting(repo, subset, x):
-    """conflicting, Try to succeed to public change"""
+    """``conflicting()``
+    Changesets marked as successors of a same changeset.
+    """
     args = revset.getargs(x, 0, 0, 'conflicting takes no arguments')
     return [r for r in subset if r in repo._conflictingset]
 
@@ -178,7 +194,9 @@
     return cs
 
 def revsetprecursors(repo, subset, x):
-    """precursors of a subset"""
+    """``precursors(set)``
+    Immediate precursors of changesets in set.
+    """
     s = revset.getset(repo, range(len(repo)), x)
     cs = _precursors(repo, s)
     return [r for r in subset if r in cs]
@@ -204,7 +222,9 @@
     return cs
 
 def revsetallprecursors(repo, subset, x):
-    """obsolete parents"""
+    """``allprecursors(set)``
+    Transitive precursors of changesets in set.
+    """
     s = revset.getset(repo, range(len(repo)), x)
     cs = _allprecursors(repo, s)
     return [r for r in subset if r in cs]
@@ -223,7 +243,9 @@
     return cs
 
 def revsetsuccessors(repo, subset, x):
-    """successors of a subset"""
+    """``successors(set)``
+    Immediate successors of changesets in set.
+    """
     s = revset.getset(repo, range(len(repo)), x)
     cs = _successors(repo, s)
     return [r for r in subset if r in cs]
@@ -249,7 +271,9 @@
     return cs
 
 def revsetallsuccessors(repo, subset, x):
-    """obsolete parents"""
+    """``allsuccessors(set)``
+    Transitive successors of changesets in set.
+    """
     s = revset.getset(repo, range(len(repo)), x)
     cs = _allsuccessors(repo, s)
     return [r for r in subset if r in cs]