mercurial/revset.py
changeset 12929 515c2786e1cf
parent 12928 a5f7f1e9340e
child 12935 98b79c892768
--- a/mercurial/revset.py	Thu Nov 04 16:59:03 2010 -0500
+++ b/mercurial/revset.py	Thu Nov 04 17:09:00 2010 -0500
@@ -232,9 +232,13 @@
     return [r for r in subset if r in ps]
 
 def parents(repo, subset, x):
-    """``parents(set)``
-    The set of all parents for all changesets in set.
+    """``parents([set])``
+    The set of all parents for all changesets in set, or the working directory.
     """
+    repo.ui.debug(repr(x), '\n')
+    if x is None:
+        return [r.rev() for r in repo[x].parents()]
+
     ps = set()
     cl = repo.changelog
     for r in getset(repo, range(len(repo)), x):