def gen_diff_header(paths, modes, shas):
 (old_path, new_path) = paths
 (old_mode, new_mode) = modes
 (old_sha, new_sha) = shas
 (yield (((('diff --git ' + old_path) + ' ') + new_path) + '\n'))
 if (old_mode != new_mode):
  if (new_mode is not None):
   if (old_mode is not None):
    (yield ('old mode %o\n' % old_mode).encode('ascii'))
   (yield ('new mode %o\n' % new_mode).encode('ascii'))
  else:
   (yield ('deleted mode %o\n' % old_mode).encode('ascii'))
 (yield ((('index ' + shortid(old_sha)) + '..') + shortid(new_sha)))
 if (new_mode is not None):
  (yield (' %o' % new_mode).encode('ascii'))
 (yield '\n')

def gen_diff_header ( paths , modes , shas ) : ( old_path , new_path ) = paths ( old_mode , new_mode ) = modes ( old_sha , new_sha ) = shas ( yield ( ( ( ( 'diff --git ' + old_path ) + ' ' ) + new_path ) + '\n' ) ) if ( old_mode != new_mode ) : if ( new_mode is not None ) : if ( old_mode is not None ) : ( yield ( 'old mode %o\n' % old_mode ) . encode ( 'ascii' ) ) ( yield ( 'new mode %o\n' % new_mode ) . encode ( 'ascii' ) ) else : ( yield ( 'deleted mode %o\n' % old_mode ) . encode ( 'ascii' ) ) ( yield ( ( ( 'index ' + shortid ( old_sha ) ) + '..' ) + shortid ( new_sha ) ) ) if ( new_mode is not None ) : ( yield ( ' %o' % new_mode ) . encode ( 'ascii' ) ) ( yield '\n' )
write a blob diff header .