~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 22:00:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1942.
  • Revision ID: john@arbash-meinel.com-20060816220019-541cb90093258ac3
Using real utf8 and cache_utf8 has similar performance, 272ms, and 363ms

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
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
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
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
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
460
460
        _unsupported is a private parameter to the BzrDir class.
461
461
        """
462
462
        t = get_transport(base)
463
 
        mutter("trying to open %r with transport %r", base, t)
 
463
        # mutter("trying to open %r with transport %r", base, t)
464
464
        format = BzrDirFormat.find_format(t)
465
465
        BzrDir._check_supported(format, _unsupported)
466
466
        return format.open(t, _found=True)
1557
1557
    def _store_new_weave(self, rev, inv, present_parents):
1558
1558
        # the XML is now updated with text versions
1559
1559
        if __debug__:
1560
 
            for file_id in inv:
1561
 
                ie = inv[file_id]
1562
 
                if ie.kind == 'root_directory':
1563
 
                    continue
 
1560
            entries = inv.iter_entries()
 
1561
            entries.next()
 
1562
            for path, ie in entries:
1564
1563
                assert hasattr(ie, 'revision'), \
1565
1564
                    'no revision on {%s} in {%s}' % \
1566
1565
                    (file_id, rev.revision_id)
1579
1578
        mutter('converting texts of revision {%s}',
1580
1579
               rev_id)
1581
1580
        parent_invs = map(self._load_updated_inventory, present_parents)
1582
 
        for file_id in inv:
1583
 
            ie = inv[file_id]
 
1581
        entries = inv.iter_entries()
 
1582
        entries.next()
 
1583
        for path, ie in entries:
1584
1584
            self._convert_file_version(rev, ie, parent_invs)
1585
1585
 
1586
1586
    def _convert_file_version(self, rev, ie, parent_invs):
1589
1589
        The file needs to be added into the weave if it is a merge
1590
1590
        of >=2 parents or if it's changed from its parent.
1591
1591
        """
1592
 
        if ie.kind == 'root_directory':
1593
 
            return
1594
1592
        file_id = ie.file_id
1595
1593
        rev_id = rev.revision_id
1596
1594
        w = self.text_weaves.get(file_id)