/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 git/objects.py

  • Committer: James Westby
  • Date: 2007-03-25 17:31:58 UTC
  • mto: (0.215.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jw+debian@jameswestby.net-20070325173158-r1mm8vvnyzwp8sjy
Drop the restriction on having objects writeable for the mmap.

Git creates objects read only, so this would have been a problem in the wild,
and was annoying and unnecessary anyway.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
  def from_file(cls, filename):
124
124
    """Get the contents of a SHA file on disk"""
125
125
    size = os.path.getsize(filename)
126
 
    f = open(filename, 'rb+')
 
126
    f = open(filename, 'rb')
127
127
    try:
128
 
      map = mmap.mmap(f.fileno(), size)
 
128
      map = mmap.mmap(f.fileno(), size, access=mmap.ACCESS_READ)
129
129
      shafile = cls._parse_file(map)
130
130
      shafile._parse_text()
131
131
      return shafile