[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#901180: release notes fails to build in a clean checkout



Hello all,

It could be good to build again the release-notes.

If nobody objects, I can commit the proposed changes, and then ask -www
team to update the cron/parts/7release-notes script.

>The attached patch works, but the statistics for ca & cs are wrong
>because the svn revision tracked now don't match the actual git hash.
>And ca & cs translators will need to find the git hash
>corresponding to the old svn revision to know where to look back to
>update the translation. This have to be done only once, but before to
>keep correct stats.
I'm Cc-ing the last translators for ca & cs, if they want to give some
input. But there were no update in 7 years, so these translations could
be marked as obsolete ?

Baptiste

diff --git a/transcount b/transcount
index 2d8c9be2..f8db4ece 100755
--- a/transcount
+++ b/transcount
@@ -21,12 +21,10 @@ if __name__ == "__main__":
     total = sum(sizes.values())
     revisions = {}
     for fn in filenames:
-        for attr in os.popen("svn info %s/%s" % (origlang, fn)).readlines():
-            if attr.startswith("Last Changed Rev:"):
-                _, revision = attr.split(":", 1)
-                revisions[fn] = int(revision)
+        for attr in os.popen("git log --format=%%H -n 1 %s/%s" % (origlang, fn)).readlines():
+            revisions[fn] = attr
     # looking for marker: "^<!-- English version: 1234 -->$"
-    rev_re = re.compile("^\s*<!--\s+English version:\s+([0-9]+)\s+-->\s*$")
+    rev_re = re.compile("^\s*<!--\s+English version:\s+([0-9a-z]+)\s+-->\s*$")
     for lng in targetlangs:
         stats = 0
         for fn in filenames:
@@ -34,11 +32,11 @@ if __name__ == "__main__":
                 match = rev_re.match(line)
                 if match:
                     revision = int(rev_re.match(line).group(1))
-                    if revision >= revisions[fn]:
+                    if revision == revisions[fn]:
                         # Current! Count 100%.
                         stats += sizes[fn]
                     else:
-                        # SVN revision not current. Count 50%.
+                        # Git revision not current. Count 50%.
                         stats += sizes[fn]/2.
         value = float(stats)/(total/100.)
         print "%s: ~%d%% (~%.2f%%)." % (lng, int(round(value)), value)

Attachment: pgpikng6ypMKo.pgp
Description: Signature digitale OpenPGP


Reply to: