[gs-commits] ghostpdl branch, master, updated. ghostpdl-9.02-918-g69d0fee

Chris Liddell chrisl at ghostscript.com
Mon Jan 30 18:15:05 UTC 2012


The ghostpdl branch, master has been updated
       via  69d0fee61911ef6044b07cd7b36bc2148e6bb214 (commit)
       via  08a189c3b72e6bf89ae938b0bbacbbf113e0e346 (commit)
      from  5dd29e182ea1fec5e504558173bbb875501d04a1 (commit)

----------------------------------------------------------------------
commit 69d0fee61911ef6044b07cd7b36bc2148e6bb214
Author: Chris Liddell <chris.liddell at artifex.com>
Date:   Mon Jan 30 18:14:22 2012 +0000

    Tweak gitlog2changelog.py to avoid trailing whitespace
    
    CLUSTER_UNTESTED

diff --git a/gs/toolbin/gitlog2changelog.py b/gs/toolbin/gitlog2changelog.py
index a3dc5ce..0b4bc7f 100755
--- a/gs/toolbin/gitlog2changelog.py
+++ b/gs/toolbin/gitlog2changelog.py
@@ -79,7 +79,8 @@ else:
     for logline in log:
       if len(logline.strip()) == 0 and marked == 0 :
         continue
-      sys.stdout.write (logline.replace("<", "&lt;").replace(">", "&gt;") + "<br>\n")
+
+      sys.stdout.write (logline.replace("<", "&lt;").replace(">", "&gt;").rstrip() + "<br>\n")
       marked = 1
 
     sys.stdout.write ("<p>\n")

----------------------------------------------------------------------
commit 08a189c3b72e6bf89ae938b0bbacbbf113e0e346
Author: Chris Liddell <chris.liddell at artifex.com>
Date:   Mon Jan 30 17:41:35 2012 +0000

    Improve the html output of the changelog generator.
    
    There were some compatibility problems with the html from the git log to
    html changelog generator - such as including '<' and '>' characters in
    text to be displayed.
    
    Also, improve the actual formatting slightly.
    
    CLUSTER_UNTESTED

diff --git a/gs/toolbin/gitlog2changelog.py b/gs/toolbin/gitlog2changelog.py
index a20a861..a3dc5ce 100755
--- a/gs/toolbin/gitlog2changelog.py
+++ b/gs/toolbin/gitlog2changelog.py
@@ -16,6 +16,7 @@ import sys
 import string
 import datetime
 import time
+import codecs
 
 argc = len(sys.argv)
 if argc < 3:
@@ -52,7 +53,7 @@ else:
     res = os.popen(cmd, "r")
     commit=res.readlines()
     # This assumes the order of the lines.....
-    sys.stdout.write("<p><strong><a name=")
+    sys.stdout.write("<p><strong>")
     if str.find(commit[1], "Merge:") < 0:
       nm = commit[1]
       dt = commit[2]
@@ -63,21 +64,28 @@ else:
       logidx = 4
 
     sys.stdout.write (dt.split("Date:")[1].strip())
-    sys.stdout.write ("></a>\n")
-    sys.stdout.write (dt.split("Date:")[1].strip())
-    sys.stdout.write ("</strong>\n<br>" + nm.split("Author: ")[1].strip() + "<br>\n")
+    sys.stdout.write ("\n")
+    auth_name=nm.split("Author: ")[1].strip()
+    sys.stdout.write ("</strong>\n<br>" + auth_name.replace("<", "&lt;").replace(">", "&gt;") + "<br>\n")
     sys.stdout.write ("<a href=\"http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=" + commit[0].split("commit ")[1].strip() + "\">")
     sys.stdout.write (commit[0].split("commit ")[1].strip() + "</a>\n")
 
     sys.stdout.write ("<blockquote>\n")
+    sys.stdout.write ("<p>\n")
     log = commit[logidx:]
 
+    marked = 0
+    # this loop needs to skip initial blank lines
     for logline in log:
-      sys.stdout.write (logline + "<br>\n")
+      if len(logline.strip()) == 0 and marked == 0 :
+        continue
+      sys.stdout.write (logline.replace("<", "&lt;").replace(">", "&gt;") + "<br>\n")
+      marked = 1
 
     sys.stdout.write ("<p>\n")
     sys.stdout.write ("</blockquote>\n")
-    sys.stdout.write ("<hb>\n")
+    sys.stdout.write ("<hr>\n")
 
+  sys.stdout.write ("<hr size=20>\n\n\n")
   sys.stdout.write ("</body>\n")
   sys.stdout.write ("</html>\n")


Summary of changes:
 gs/toolbin/gitlog2changelog.py |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)



More information about the gs-commits mailing list