mercurial/util.py
changeset 5975 75d9fe70c654
parent 5949 48d01b1e315f
child 6006 3c9dbb743d20
--- a/mercurial/util.py	Thu Jan 31 14:44:19 2008 -0600
+++ b/mercurial/util.py	Thu Jan 31 14:44:19 2008 -0600
@@ -1636,6 +1636,12 @@
         user = user[:f]
     return user
 
+def email(author):
+    '''get email of author.'''
+    r = author.find('>')
+    if r == -1: r = None
+    return author[author.find('<')+1:r]
+
 def ellipsis(text, maxlength=400):
     """Trim string to at most maxlength (default: 400) characters."""
     if len(text) <= maxlength: