hgext/largefiles/proto.py
changeset 37414 2d965bfeb8f6
parent 37293 d5d665f6615a
child 37484 c22fd3c4c23e
equal deleted inserted replaced
37413:33af46d639b4 37414:2d965bfeb8f6
    39         path = lfutil.storepath(repo, sha)
    39         path = lfutil.storepath(repo, sha)
    40         util.makedirs(os.path.dirname(path))
    40         util.makedirs(os.path.dirname(path))
    41         tmpfp = util.atomictempfile(path, createmode=repo.store.createmode)
    41         tmpfp = util.atomictempfile(path, createmode=repo.store.createmode)
    42 
    42 
    43         try:
    43         try:
    44             proto.forwardpayload(tmpfp)
    44             for p in proto.getpayload():
       
    45                 tmpfp.write(p)
    45             tmpfp._fp.seek(0)
    46             tmpfp._fp.seek(0)
    46             if sha != lfutil.hexsha1(tmpfp._fp):
    47             if sha != lfutil.hexsha1(tmpfp._fp):
    47                 raise IOError(0, _('largefile contents do not match hash'))
    48                 raise IOError(0, _('largefile contents do not match hash'))
    48             tmpfp.close()
    49             tmpfp.close()
    49             lfutil.linktousercache(repo, sha)
    50             lfutil.linktousercache(repo, sha)