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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from bzrlib.xml_serializer import (
17
from bzrlib.xml_serializer import ElementTree, SubElement, Element, Serializer
24
18
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
25
19
import bzrlib.inventory as inventory
26
20
from bzrlib.revision import Revision
27
21
from bzrlib.errors import BzrError
30
class _Serializer_v4(XMLSerializer):
24
class _Serializer_v4(Serializer):
31
25
"""Version 0.0.4 serializer
33
27
You should use the serializer_v4 singleton.
35
29
v4 serialisation is no longer supported, only deserialisation.
40
34
def _pack_entry(self, ie):
41
35
"""Convert InventoryEntry to XML element"""
42
36
e = Element('entry')
140
134
p.set('revision_sha1', rev.parent_sha1s[i])
144
138
def _unpack_revision(self, elt):
145
139
"""XML Element -> Revision object"""
147
141
# <changeset> is deprecated...
148
142
if elt.tag not in ('revision', 'changeset'):
149
143
raise BzrError("unexpected tag in revision file: %r" % elt)