##// END OF EJS Templates
revlog: deal with special "postfix" explicitely...
marmoute -
r47916:c6b8d5d9 default
parent child Browse files
Show More
@@ -395,16 +395,19 class changelog(revlog.revlog):
395 ``concurrencychecker`` will be passed to the revlog init function, see
395 ``concurrencychecker`` will be passed to the revlog init function, see
396 the documentation there.
396 the documentation there.
397 """
397 """
398
399 indexfile = b'00changelog.i'
398 if trypending and opener.exists(b'00changelog.i.a'):
400 if trypending and opener.exists(b'00changelog.i.a'):
399 indexfile = b'00changelog.i.a'
401 postfix = b'a'
400 else:
402 else:
401 indexfile = b'00changelog.i'
403 postfix = None
402
404
403 datafile = b'00changelog.d'
405 datafile = b'00changelog.d'
404 revlog.revlog.__init__(
406 revlog.revlog.__init__(
405 self,
407 self,
406 opener,
408 opener,
407 target=(revlog_constants.KIND_CHANGELOG, None),
409 target=(revlog_constants.KIND_CHANGELOG, None),
410 postfix=postfix,
408 indexfile=indexfile,
411 indexfile=indexfile,
409 datafile=datafile,
412 datafile=datafile,
410 checkambig=True,
413 checkambig=True,
@@ -289,6 +289,7 class revlog(object):
289 self,
289 self,
290 opener,
290 opener,
291 target,
291 target,
292 postfix=None,
292 indexfile=None,
293 indexfile=None,
293 datafile=None,
294 datafile=None,
294 checkambig=False,
295 checkambig=False,
@@ -312,9 +313,20 class revlog(object):
312 accurate value.
313 accurate value.
313 """
314 """
314 self.upperboundcomp = upperboundcomp
315 self.upperboundcomp = upperboundcomp
316 if not indexfile.endswith(b'.i'):
317 raise error.ProgrammingError(
318 b"revlog's indexfile should end with `.i`"
319 )
320 if datafile is None:
321 datafile = indexfile[:-2] + b".d"
322 if postfix is not None:
323 datafile = b'%s.%s' % (datafile, postfix)
324 if postfix is not None:
325 indexfile = b'%s.%s' % (indexfile, postfix)
315 self.indexfile = indexfile
326 self.indexfile = indexfile
316 self.datafile = datafile or (indexfile[:-2] + b".d")
327 self.datafile = datafile
317 self.nodemap_file = None
328 self.nodemap_file = None
329 self.postfix = postfix
318 if persistentnodemap:
330 if persistentnodemap:
319 self.nodemap_file = nodemaputil.get_nodemap_file(
331 self.nodemap_file = nodemaputil.get_nodemap_file(
320 opener, self.indexfile
332 opener, self.indexfile
@@ -2881,16 +2893,13 class revlog(object):
2881 # Rewriting the revlog in place is hard. Our strategy for censoring is
2893 # Rewriting the revlog in place is hard. Our strategy for censoring is
2882 # to create a new revlog, copy all revisions to it, then replace the
2894 # to create a new revlog, copy all revisions to it, then replace the
2883 # revlogs on transaction close.
2895 # revlogs on transaction close.
2884
2896 #
2885 newindexfile = self.indexfile + b'.tmpcensored'
2886 newdatafile = self.datafile + b'.tmpcensored'
2887
2888 # This is a bit dangerous. We could easily have a mismatch of state.
2897 # This is a bit dangerous. We could easily have a mismatch of state.
2889 newrl = revlog(
2898 newrl = revlog(
2890 self.opener,
2899 self.opener,
2891 target=self.target,
2900 target=self.target,
2892 indexfile=newindexfile,
2901 postfix=b'tmpcensored',
2893 datafile=newdatafile,
2902 indexfile=self.indexfile,
2894 censorable=True,
2903 censorable=True,
2895 )
2904 )
2896 newrl._format_version = self._format_version
2905 newrl._format_version = self._format_version
General Comments 0
You need to be logged in to leave comments. Login now