# HG changeset patch # User jdc@uwo.ca # Date 1125514618 25200 # Node ID a7abffa4b19fe5f3bc8923f08b3ea03d13a6b662 # Parent 862f53c1d0f93399e4c57fabbbebc17db43dad0b Adjust hg-strip and hg-chomp regexps. diff -r 862f53c1d0f9 -r a7abffa4b19f contrib/mercurial.el --- a/contrib/mercurial.el Wed Aug 31 11:19:20 2005 -0700 +++ b/contrib/mercurial.el Wed Aug 31 11:56:58 2005 -0700 @@ -283,13 +283,13 @@ (replace-regexp-in-string regexp newtext str nil literal))) (defsubst hg-strip (str) - "Strip leading and trailing white space from a string." - (hg-replace-in-string (hg-replace-in-string str "[ \t\r\n]+$" "") - "^[ \t\r\n]+" "")) + "Strip leading and trailing blank lines from a string." + (hg-replace-in-string (hg-replace-in-string str "[\r\n][ \t\r\n]*\\'" "") + "\\`[ \t\r\n]*[\r\n]" "")) (defsubst hg-chomp (str) "Strip trailing newlines from a string." - (hg-replace-in-string str "[\r\n]+$" "")) + (hg-replace-in-string str "[\r\n]+\'" "")) (defun hg-run-command (command &rest args) "Run the shell command COMMAND, returning (EXIT-CODE . COMMAND-OUTPUT).