mercurial/changelog.py
changeset 46607 e9901d01d135
parent 46509 7a93b7b3dc2d
child 46631 230f73019e49
equal deleted inserted replaced
46606:ced66295ea90 46607:e9901d01d135
   378         extra = self.extra
   378         extra = self.extra
   379         return encoding.tolocal(extra.get(b"branch")), b'close' in extra
   379         return encoding.tolocal(extra.get(b"branch")), b'close' in extra
   380 
   380 
   381 
   381 
   382 class changelog(revlog.revlog):
   382 class changelog(revlog.revlog):
   383     def __init__(self, opener, trypending=False):
   383     def __init__(self, opener, trypending=False, concurrencychecker=None):
   384         """Load a changelog revlog using an opener.
   384         """Load a changelog revlog using an opener.
   385 
   385 
   386         If ``trypending`` is true, we attempt to load the index from a
   386         If ``trypending`` is true, we attempt to load the index from a
   387         ``00changelog.i.a`` file instead of the default ``00changelog.i``.
   387         ``00changelog.i.a`` file instead of the default ``00changelog.i``.
   388         The ``00changelog.i.a`` file contains index (and possibly inline
   388         The ``00changelog.i.a`` file contains index (and possibly inline
   389         revision) data for a transaction that hasn't been finalized yet.
   389         revision) data for a transaction that hasn't been finalized yet.
   390         It exists in a separate file to facilitate readers (such as
   390         It exists in a separate file to facilitate readers (such as
   391         hooks processes) accessing data before a transaction is finalized.
   391         hooks processes) accessing data before a transaction is finalized.
       
   392 
       
   393         ``concurrencychecker`` will be passed to the revlog init function, see
       
   394         the documentation there.
   392         """
   395         """
   393         if trypending and opener.exists(b'00changelog.i.a'):
   396         if trypending and opener.exists(b'00changelog.i.a'):
   394             indexfile = b'00changelog.i.a'
   397             indexfile = b'00changelog.i.a'
   395         else:
   398         else:
   396             indexfile = b'00changelog.i'
   399             indexfile = b'00changelog.i'
   402             indexfile,
   405             indexfile,
   403             datafile=datafile,
   406             datafile=datafile,
   404             checkambig=True,
   407             checkambig=True,
   405             mmaplargeindex=True,
   408             mmaplargeindex=True,
   406             persistentnodemap=opener.options.get(b'persistent-nodemap', False),
   409             persistentnodemap=opener.options.get(b'persistent-nodemap', False),
       
   410             concurrencychecker=concurrencychecker,
   407         )
   411         )
   408 
   412 
   409         if self._initempty and (self.version & 0xFFFF == revlog.REVLOGV1):
   413         if self._initempty and (self.version & 0xFFFF == revlog.REVLOGV1):
   410             # changelogs don't benefit from generaldelta.
   414             # changelogs don't benefit from generaldelta.
   411 
   415