~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-31 17:42:29 UTC
  • mto: This revision was merged to the branch mainline in revision 4611.
  • Revision ID: john@arbash-meinel.com-20090731174229-w2zdsdlfpeddk8gl
Now we got to the per-workingtree tests, etc.

The main causes seem to break down into:
  bzrdir.clone() is known to be broken wrt locking, this effects
  everything that tries to 'push'

  shelf code is not compatible with strict locking

  merge code seems to have an issue. This might actually be the
  root cause of the clone() problems.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
16
16
 
17
17
from bzrlib.xml_serializer import (
18
18
    Element,
 
19
    ElementTree,
19
20
    SubElement,
20
21
    XMLSerializer,
21
22
    escape_invalid_chars,
22
23
    )
23
 
from bzrlib.inventory import ROOT_ID, Inventory
 
24
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
24
25
import bzrlib.inventory as inventory
25
26
from bzrlib.revision import Revision
26
27
from bzrlib.errors import BzrError
62
63
        return e
63
64
 
64
65
 
65
 
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None,
66
 
                          return_from_cache=False):
 
66
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None):
67
67
        """Construct from XML Element
68
68
 
69
69
        :param revision_id: Ignored parameter used by xml5.
71
71
        root_id = elt.get('file_id') or ROOT_ID
72
72
        inv = Inventory(root_id)
73
73
        for e in elt:
74
 
            ie = self._unpack_entry(e, entry_cache=entry_cache,
75
 
                                    return_from_cache=return_from_cache)
 
74
            ie = self._unpack_entry(e, entry_cache=entry_cache)
76
75
            if ie.parent_id == ROOT_ID:
77
76
                ie.parent_id = root_id
78
77
            inv.add(ie)
79
78
        return inv
80
79
 
81
80
 
82
 
    def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
 
81
    def _unpack_entry(self, elt, entry_cache=None):
83
82
        ## original format inventories don't have a parent_id for
84
83
        ## nodes in the root directory, but it's cleaner to use one
85
84
        ## internally.