~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Robert Collins
  • Date: 2005-09-30 02:54:51 UTC
  • mfrom: (1395)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930025451-47b9e412202be44b
symlink and weaves, whaddya know

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from shutil import copyfile
20
20
from stat import (S_ISREG, S_ISDIR, S_ISLNK, ST_MODE, ST_SIZE,
21
21
                  S_ISCHR, S_ISBLK, S_ISFIFO, S_ISSOCK)
 
22
from cStringIO import StringIO
22
23
import errno
23
24
import os
24
25
import re
235
236
    return s.hexdigest()
236
237
 
237
238
 
 
239
 
 
240
def sha_strings(strings):
 
241
    """Return the sha-1 of concatenation of strings"""
 
242
    s = sha.new()
 
243
    map(s.update, strings)
 
244
    return s.hexdigest()
 
245
 
 
246
 
238
247
def sha_string(f):
239
248
    s = sha.new()
240
249
    s.update(f)
514
523
        raise
515
524
 
516
525
 
 
526
def split_lines(s):
 
527
    """Split s into lines, but without removing the newline characters."""
 
528
    return StringIO(s).readlines()
 
529
 
 
530
 
517
531
def hardlinks_good():
518
532
    return sys.platform not in ('win32', 'cygwin', 'darwin')
519
533