##// END OF EJS Templates
upgrade: introduce a _copyrevlog method...
marmoute -
r42918:5535a220 default
parent child Browse files
Show More
@@ -533,6 +533,35 b' def _revlogfrompath(repo, path):'
533 #reverse of "/".join(("data", path + ".i"))
533 #reverse of "/".join(("data", path + ".i"))
534 return filelog.filelog(repo.svfs, path[5:-2])
534 return filelog.filelog(repo.svfs, path[5:-2])
535
535
536 def _copyrevlog(tr, destrepo, oldrl, unencodedname):
537 """copy all relevant files for `oldrl` into `destrepo` store
538
539 Files are copied "as is" without any transformation. The copy is performed
540 without extra checks. Callers are responsible for making sure the copied
541 content is compatible with format of the destination repository.
542 """
543 oldrl = getattr(oldrl, '_revlog', oldrl)
544 newrl = _revlogfrompath(destrepo, unencodedname)
545 newrl = getattr(newrl, '_revlog', newrl)
546
547 oldvfs = oldrl.opener
548 newvfs = newrl.opener
549 oldindex = oldvfs.join(oldrl.indexfile)
550 newindex = newvfs.join(newrl.indexfile)
551 olddata = oldvfs.join(oldrl.datafile)
552 newdata = newvfs.join(newrl.datafile)
553
554 newdir = newvfs.dirname(newrl.indexfile)
555 newvfs.makedirs(newdir)
556
557 util.copyfile(oldindex, newindex)
558 if oldrl.opener.exists(olddata):
559 util.copyfile(olddata, newdata)
560
561 if not (unencodedname.endswith('00changelog.i')
562 or unencodedname.endswith('00manifest.i')):
563 destrepo.svfs.fncache.add(unencodedname)
564
536 def _clonerevlogs(ui, srcrepo, dstrepo, tr, deltareuse, forcedeltabothparents):
565 def _clonerevlogs(ui, srcrepo, dstrepo, tr, deltareuse, forcedeltabothparents):
537 """Copy revlogs between 2 repos."""
566 """Copy revlogs between 2 repos."""
538 revcount = 0
567 revcount = 0
General Comments 0
You need to be logged in to leave comments. Login now