comparison hgsubversion/maps.py @ 1424:a794cbc174a9

maps: document RevMap.batchset will not update internal state Judging from the name, RevMap.batchset seems to be equivalent to multiple "__setitem__"s. But it neither calls dict.__setitem__ nor updates "_hashes". Update the docstring to make it clear the in-memory state is not updated.
author Jun Wu <quark@fb.com>
date Tue, 24 May 2016 00:11:50 +0100
parents 372afb75f465
children 5b9002d28418
comparison
equal deleted inserted replaced
1423:52749d8aba99 1424:a794cbc174a9
382 def batchset(self, items): 382 def batchset(self, items):
383 '''Set items in batches 383 '''Set items in batches
384 384
385 items is an array of (rev num, branch, binary hash) 385 items is an array of (rev num, branch, binary hash)
386 386
387 For performance reason, meta.lastpulled and meta.firstpulled 387 For performance reason, internal in-memory state is not updated.
388 are not updated. 388 To get an up-to-date RevMap, reconstruct the object.
389 ''' 389 '''
390 f = open(self.meta.revmap_file, 'a') 390 f = open(self.meta.revmap_file, 'a')
391 f.write(''.join('%s %s %s\n' % (revnum, hex(binhash), br or '') 391 f.write(''.join('%s %s %s\n' % (revnum, hex(binhash), br or '')
392 for revnum, br, binhash in items)) 392 for revnum, br, binhash in items))
393 f.close() 393 f.close()