~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 19:58:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713195822-965e2c4422506a75
cleanup pass, allow pycurl connections to be shared between transports.

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
 
            entries = inv.iter_entries()
1561
 
            entries.next()
1562
 
            for path, ie in entries:
 
1560
            for file_id in inv:
 
1561
                ie = inv[file_id]
 
1562
                if ie.kind == 'root_directory':
 
1563
                    continue
1563
1564
                assert hasattr(ie, 'revision'), \
1564
1565
                    'no revision on {%s} in {%s}' % \
1565
1566
                    (file_id, rev.revision_id)
1578
1579
        mutter('converting texts of revision {%s}',
1579
1580
               rev_id)
1580
1581
        parent_invs = map(self._load_updated_inventory, present_parents)
1581
 
        entries = inv.iter_entries()
1582
 
        entries.next()
1583
 
        for path, ie in entries:
 
1582
        for file_id in inv:
 
1583
            ie = inv[file_id]
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
1592
1594
        file_id = ie.file_id
1593
1595
        rev_id = rev.revision_id
1594
1596
        w = self.text_weaves.get(file_id)