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