~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
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
16
16
 
17
 
from bzrlib.xml_serializer import ElementTree, SubElement, Element, Serializer
 
17
from bzrlib.xml_serializer import (
 
18
    Element,
 
19
    ElementTree,
 
20
    SubElement,
 
21
    XMLSerializer,
 
22
    )
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
22
27
 
23
28
 
24
 
class _Serializer_v4(Serializer):
 
29
class _Serializer_v4(XMLSerializer):
25
30
    """Version 0.0.4 serializer
26
31
 
27
32
    You should use the serializer_v4 singleton.
28
 
    
 
33
 
29
34
    v4 serialisation is no longer supported, only deserialisation.
30
35
    """
31
 
    
 
36
 
32
37
    __slots__ = []
33
 
    
 
38
 
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])
135
140
        return root
136
141
 
137
 
    
 
142
 
138
143
    def _unpack_revision(self, elt):
139
144
        """XML Element -> Revision object"""
140
 
        
 
145
 
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)