~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-09-13 08:19:01 UTC
  • Revision ID: mbp@sourcefrog.net-20050913081901-9b8d449d97e9f23d
- split sha_strings into osutils

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
from bzrlib.osutils import (local_time_offset, username,
41
41
                            rand_bytes, compact_date, user_email,
42
42
                            kind_marker, is_inside_any, quotefn,
43
 
                            sha_string, sha_file, isdir, isfile)
 
43
                            sha_string, sha_strings, sha_file, isdir, isfile)
44
44
from bzrlib.branch import gen_file_id, INVENTORY_FILEID, ANCESTRY_FILEID
45
45
from bzrlib.errors import BzrError, PointlessCommit
46
46
from bzrlib.revision import Revision, RevisionReference
330
330
        self._add_text_to_weave(file_id, new_lines, file_parents)
331
331
        # make a new inventory entry for this file, using whatever
332
332
        # it had in the working copy, plus details on the new text
333
 
        ie.text_sha1 = _sha_strings(new_lines)
 
333
        ie.text_sha1 = sha_strings(new_lines)
334
334
        ie.text_size = sum(map(len, new_lines))
335
335
        ie.text_version = self.rev_id
336
336
        ie.entry_version = self.rev_id
348
348
    s += hexlify(rand_bytes(8))
349
349
    return s
350
350
 
351
 
 
352
 
def _sha_strings(strings):
353
 
    """Return the sha-1 of concatenation of strings"""
354
 
    s = sha.new()
355
 
    map(s.update, strings)
356
 
    return s.hexdigest()