13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
from bzrlib.xml_serializer import ElementTree, SubElement, Element, Serializer
17
from bzrlib.xml_serializer import (
18
23
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
19
24
import bzrlib.inventory as inventory
20
25
from bzrlib.revision import Revision
21
26
from bzrlib.errors import BzrError
24
class _Serializer_v4(Serializer):
29
class _Serializer_v4(XMLSerializer):
25
30
"""Version 0.0.4 serializer
27
32
You should use the serializer_v4 singleton.
29
34
v4 serialisation is no longer supported, only deserialisation.
34
39
def _pack_entry(self, ie):
35
40
"""Convert InventoryEntry to XML element"""
36
41
e = Element('entry')
134
139
p.set('revision_sha1', rev.parent_sha1s[i])
138
143
def _unpack_revision(self, elt):
139
144
"""XML Element -> Revision object"""
141
146
# <changeset> is deprecated...
142
147
if elt.tag not in ('revision', 'changeset'):
143
148
raise BzrError("unexpected tag in revision file: %r" % elt)