Moved comment.list_to_root() to Bug.add_comments() with some cleanups.
authorW. Trevor King <wking@drexel.edu>
Sun, 29 Nov 2009 08:19:30 +0000 (03:19 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 29 Nov 2009 08:19:30 +0000 (03:19 -0500)
commit759c69d8c8a4bbd7ba9c42bb3a813cd0d06a52b7
treeaa0392af2fe22663b873a544df37f3c48c605be6
parent832843d26eed9023f4cf4fc431527c63ca1d533d
Moved comment.list_to_root() to Bug.add_comments() with some cleanups.

This makes Bug.add_comment simpler.  Also makes Bug.from_xml() more
robust, since it no longer depends on the order in which the XML file
lists the comments.  The previous Bug.from_xml() would have choked on
  <be-xml>
    <bug>
      <comment>
        <uuid>B</uuid>
        <in-reply-to>A</in-reply-to>
      </comment>
      <comment>
        <uuid>A</uuid>
      </comment>
    </bug>
  </be-xml>
because when B was being added, the referenced A hadn't yet been
noticed.
libbe/bug.py
libbe/comment.py