Sun Jul 24 01:05:22 UTC 2005 Alberto Bertogli * Ignore created_as tag in changes' xml output. diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi --- old-darcsweb/darcsweb.cgi 2015-09-30 20:09:16.000000000 +0000 +++ new-darcsweb/darcsweb.cgi 2015-09-30 20:09:16.000000000 +0000 @@ -347,6 +347,18 @@ self.cur_file = '' def startElement(self, name, attrs): + # When you ask for changes to a given file, the xml output + # begins with the patch that creates it is enclosed in a + # "created_as" tag; then, later, it gets shown again in its + # usual place. The following two "if"s take care of ignoring + # everything inside the "created_as" tag, since we don't care. + if name == 'created_as': + self.cur_elem = 'created_as' + return + if self.cur_elem == 'created_as': + return + + # now parse the tags normally if name == 'patch': p = Patch() p.hash = fixu8(attrs.get('hash')) @@ -422,6 +434,14 @@ self.cur_val += s def endElement(self, name): + # See the comment in startElement() + if name == 'created_as': + self.cur_elem = None + self.cur_val = '' + return + if self.cur_elem == 'created_as': + return + if name == 'name': p = self.db[self.current] p.name = fixu8(self.cur_val)