mercurial/patch.py
changeset 4104 ed46895aa38c
parent 4092 4ced663bebf0
child 4105 797dbdd4d7e1
equal deleted inserted replaced
4103:0934fef871f3 4104:ed46895aa38c
   410         i = 0
   410         i = 0
   411         while i < l:
   411         while i < l:
   412             yield text[i:i+csize]
   412             yield text[i:i+csize]
   413             i += csize
   413             i += csize
   414 
   414 
   415     if to == tn:
   415     tohash = gitindex(to)
       
   416     tnhash = gitindex(tn)
       
   417     if tohash == tnhash:
   416         return
   418         return
   417     # TODO: deltas
   419     # TODO: deltas
   418     l = len(tn)
       
   419     fp.write('index %s..%s\nGIT binary patch\nliteral %s\n' %
   420     fp.write('index %s..%s\nGIT binary patch\nliteral %s\n' %
   420              (gitindex(to), gitindex(tn), len(tn)))
   421              (tohash, tnhash, len(tn)))
   421 
   422 
   422     tn = ''.join([fmtline(l) for l in chunk(zlib.compress(tn))])
   423     tn = ''.join([fmtline(l) for l in chunk(zlib.compress(tn))])
   423     fp.write(tn)
   424     fp.write(tn)
   424     fp.write('\n')
   425     fp.write('\n')
   425 
   426