mercurial/revset.py
changeset 17003 42c472877825
parent 17002 0eb522625eb2
child 17100 ee2370d866fc
--- a/mercurial/revset.py	Sun May 13 01:12:26 2012 -0400
+++ b/mercurial/revset.py	Tue Jun 05 20:35:34 2012 -0400
@@ -186,6 +186,16 @@
         raise error.ParseError(_("missing argument"))
     return methods[x[0]](repo, subset, *x[1:])
 
+def _getrevsource(repo, r):
+    extra = repo[r].extra()
+    for label in ('source', 'transplant_source', 'rebase_source'):
+        if label in extra:
+            try:
+                return repo[extra[label]].rev()
+            except error.RepoLookupError:
+                pass
+    return None
+
 # operator methods
 
 def stringset(repo, subset, x):