hgext/largefiles/wirestore.py
changeset 45942 89a2afe31e82
parent 43077 687b865b95ad
child 48875 6000f5b25c9b
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
    28 
    28 
    29     def _get(self, hash):
    29     def _get(self, hash):
    30         return self.remote.getlfile(hash)
    30         return self.remote.getlfile(hash)
    31 
    31 
    32     def _stat(self, hashes):
    32     def _stat(self, hashes):
    33         '''For each hash, return 0 if it is available, other values if not.
    33         """For each hash, return 0 if it is available, other values if not.
    34         It is usually 2 if the largefile is missing, but might be 1 the server
    34         It is usually 2 if the largefile is missing, but might be 1 the server
    35         has a corrupted copy.'''
    35         has a corrupted copy."""
    36 
    36 
    37         with self.remote.commandexecutor() as e:
    37         with self.remote.commandexecutor() as e:
    38             fs = []
    38             fs = []
    39             for hash in hashes:
    39             for hash in hashes:
    40                 fs.append((hash, e.callcommand(b'statlfile', {b'sha': hash,})))
    40                 fs.append(
       
    41                     (
       
    42                         hash,
       
    43                         e.callcommand(
       
    44                             b'statlfile',
       
    45                             {
       
    46                                 b'sha': hash,
       
    47                             },
       
    48                         ),
       
    49                     )
       
    50                 )
    41 
    51 
    42             return {hash: f.result() for hash, f in fs}
    52             return {hash: f.result() for hash, f in fs}