/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/textinv.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
17
 
19
 
from .errors import BzrError
20
 
from .inventory import Inventory
 
18
from bzrlib.errors import BzrError
 
19
from bzrlib.inventory import Inventory
21
20
 
22
21
 
23
22
START_MARK = "# bzr inventory format 3\n"
35
34
            .replace('\n', r'\x0a'))
36
35
 
37
36
 
 
37
 
38
38
def unescape(s):
39
39
    if s.find(' ') != -1:
40
40
        raise AssertionError()
48
48
    return s
49
49
 
50
50
 
 
51
 
 
52
 
51
53
def write_text_inventory(inv, outf):
52
54
    """Write out inv in a simple trad-unix text format."""
53
55
    outf.write(START_MARK)
83
85
              'name': unescape(fields[1]),
84
86
              'kind': fields[2],
85
87
              'parent_id': fields[3]}
86
 
        # inv.add(ie)
 
88
        ##inv.add(ie)
87
89
 
88
90
    if l != END_MARK:
89
91
        raise BzrError("missing end mark")