Commits

tma...@google.com  committed 968110a

Make dot output for import graph predictable and not depend
on ordering of strings in hashes.

  • Participants
  • Parent commits 2fac75f

Comments (0)

Files changed (2)

     * Changed the regular expression for inline options so that it must be
       preceeded by a # (patch by Torsten Marek)
 
+    * Make dot output for import graph predictable and not depend
+      on ordering of strings in hashes. (patch by Torsten Marek)
+
 2012-10-05  --  0.26.0
     * #106534: add --ignore-imports option to code similarity checking
       and 'symilar' command line tool (patch by Ry4an Brase)

File checkers/imports.py

     done = {}
     printer = DotBackend(filename[:-4], rankdir = "LR")
     printer.emit('URL="." node[shape="box"]')
-    for modname, dependencies in dep_info.iteritems():
+    for modname, dependencies in sorted(dep_info.iteritems()):
         done[modname] = 1
         printer.emit_node(modname)
         for modname in dependencies:
             if modname not in done:
                 done[modname] = 1
                 printer.emit_node(modname)
-    for depmodname, dependencies in dep_info.iteritems():
+    for depmodname, dependencies in sorted(dep_info.iteritems()):
         for modname in dependencies:
             printer.emit_edge(modname, depmodname)
     printer.generate(filename)