mercurial/changelog.py
changeset 8499 fb9b83df45f3
parent 8443 53ff4a5af284
child 8644 c2ef478b2efa
--- a/mercurial/changelog.py	Mon May 18 17:36:24 2009 -0500
+++ b/mercurial/changelog.py	Mon May 18 17:36:24 2009 -0500
@@ -209,6 +209,10 @@
         if "\n" in user:
             raise error.RevlogError(_("username %s contains a newline")
                                     % repr(user))
+
+        # strip trailing whitespace and leading and trailing empty lines
+        desc = '\n'.join([l.rstrip() for l in desc.splitlines()]).strip('\n')
+
         user, desc = encoding.fromlocal(user), encoding.fromlocal(desc)
 
         if date: