/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/versionedfile.py

  • Committer: Robert Collins
  • Date: 2009-05-23 20:57:12 UTC
  • mfrom: (4371 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4441.
  • Revision ID: robertc@robertcollins.net-20090523205712-lcwbfqk6vwavinuv
MergeĀ .dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with this program; if not, write to the Free Software
18
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 
20
20
"""Versioned text file storage api."""
21
21
 
31
31
 
32
32
from bzrlib import (
33
33
    errors,
 
34
    groupcompress,
34
35
    index,
35
36
    knit,
36
37
    osutils,
794
795
        check_content=True):
795
796
        """Add a text to the store.
796
797
 
797
 
        :param key: The key tuple of the text to add.
 
798
        :param key: The key tuple of the text to add. If the last element is
 
799
            None, a CHK string will be generated during the addition.
798
800
        :param parents: The parents key tuples of the text to add.
799
801
        :param lines: A list of lines. Each line must be a bytestring. And all
800
802
            of them except the last must be terminated with \n and contain no
1401
1403
            elif state == 'conflicted-b':
1402
1404
                ch_b = ch_a = True
1403
1405
                lines_b.append(line)
 
1406
            elif state == 'killed-both':
 
1407
                # This counts as a change, even though there is no associated
 
1408
                # line
 
1409
                ch_b = ch_a = True
1404
1410
            else:
1405
1411
                if state not in ('irrelevant', 'ghost-a', 'ghost-b',
1406
 
                        'killed-base', 'killed-both'):
 
1412
                        'killed-base'):
1407
1413
                    raise AssertionError(state)
1408
1414
        for struct in outstanding_struct():
1409
1415
            yield struct
1484
1490
        """See VersionedFile.iter_lines_added_or_present_in_versions()."""
1485
1491
        for i, (key,) in enumerate(keys):
1486
1492
            if pb is not None:
1487
 
                pb.update("iterating texts", i, len(keys))
 
1493
                pb.update("Finding changed lines", i, len(keys))
1488
1494
            for l in self._get_lines(key):
1489
1495
                yield (l, key)
1490
1496
 
1517
1523
            'knit-annotated-delta-gz':knit.knit_network_to_record,
1518
1524
            'knit-delta-closure':knit.knit_delta_closure_to_records,
1519
1525
            'fulltext':fulltext_network_to_record,
 
1526
            'groupcompress-block':groupcompress.network_block_to_records,
1520
1527
            }
1521
1528
 
1522
1529
    def read(self):