##// END OF EJS Templates
localrepo: remove all internal uses of localrepo.sopener...
Angel Ezquerra -
r23853:0cc663e4 default
parent child Browse files
Show More
@@ -315,14 +315,14 class localrepository(object):
315
315
316 def _applyrequirements(self, requirements):
316 def _applyrequirements(self, requirements):
317 self.requirements = requirements
317 self.requirements = requirements
318 self.sopener.options = dict((r, 1) for r in requirements
318 self.svfs.options = dict((r, 1) for r in requirements
319 if r in self.openerreqs)
319 if r in self.openerreqs)
320 chunkcachesize = self.ui.configint('format', 'chunkcachesize')
320 chunkcachesize = self.ui.configint('format', 'chunkcachesize')
321 if chunkcachesize is not None:
321 if chunkcachesize is not None:
322 self.sopener.options['chunkcachesize'] = chunkcachesize
322 self.svfs.options['chunkcachesize'] = chunkcachesize
323 maxchainlen = self.ui.configint('format', 'maxchainlen')
323 maxchainlen = self.ui.configint('format', 'maxchainlen')
324 if maxchainlen is not None:
324 if maxchainlen is not None:
325 self.sopener.options['maxchainlen'] = maxchainlen
325 self.svfs.options['maxchainlen'] = maxchainlen
326
326
327 def _writerequirements(self):
327 def _writerequirements(self):
328 reqfile = self.vfs("requires", "w")
328 reqfile = self.vfs("requires", "w")
@@ -414,7 +414,7 class localrepository(object):
414 if defaultformat is not None:
414 if defaultformat is not None:
415 kwargs['defaultformat'] = defaultformat
415 kwargs['defaultformat'] = defaultformat
416 readonly = not obsolete.isenabled(self, obsolete.createmarkersopt)
416 readonly = not obsolete.isenabled(self, obsolete.createmarkersopt)
417 store = obsolete.obsstore(self.sopener, readonly=readonly,
417 store = obsolete.obsstore(self.svfs, readonly=readonly,
418 **kwargs)
418 **kwargs)
419 if store and readonly:
419 if store and readonly:
420 # message is rare enough to not be translated
420 # message is rare enough to not be translated
@@ -424,7 +424,7 class localrepository(object):
424
424
425 @storecache('00changelog.i')
425 @storecache('00changelog.i')
426 def changelog(self):
426 def changelog(self):
427 c = changelog.changelog(self.sopener)
427 c = changelog.changelog(self.svfs)
428 if 'HG_PENDING' in os.environ:
428 if 'HG_PENDING' in os.environ:
429 p = os.environ['HG_PENDING']
429 p = os.environ['HG_PENDING']
430 if p.startswith(self.root):
430 if p.startswith(self.root):
@@ -433,7 +433,7 class localrepository(object):
433
433
434 @storecache('00manifest.i')
434 @storecache('00manifest.i')
435 def manifest(self):
435 def manifest(self):
436 return manifest.manifest(self.sopener)
436 return manifest.manifest(self.svfs)
437
437
438 @repofilecache('dirstate')
438 @repofilecache('dirstate')
439 def dirstate(self):
439 def dirstate(self):
@@ -782,7 +782,7 class localrepository(object):
782 def file(self, f):
782 def file(self, f):
783 if f[0] == '/':
783 if f[0] == '/':
784 f = f[1:]
784 f = f[1:]
785 return filelog.filelog(self.sopener, f)
785 return filelog.filelog(self.svfs, f)
786
786
787 def changectx(self, changeid):
787 def changectx(self, changeid):
788 return self[changeid]
788 return self[changeid]
@@ -910,7 +910,7 class localrepository(object):
910 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
910 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
911 rp = report and report or self.ui.warn
911 rp = report and report or self.ui.warn
912 vfsmap = {'plain': self.vfs} # root of .hg/
912 vfsmap = {'plain': self.vfs} # root of .hg/
913 tr = transaction.transaction(rp, self.sopener, vfsmap,
913 tr = transaction.transaction(rp, self.svfs, vfsmap,
914 "journal",
914 "journal",
915 aftertrans(renames),
915 aftertrans(renames),
916 self.store.createmode)
916 self.store.createmode)
@@ -941,17 +941,17 class localrepository(object):
941 "%d\n%s\n" % (len(self), desc))
941 "%d\n%s\n" % (len(self), desc))
942 self.vfs.write("journal.bookmarks",
942 self.vfs.write("journal.bookmarks",
943 self.vfs.tryread("bookmarks"))
943 self.vfs.tryread("bookmarks"))
944 self.sopener.write("journal.phaseroots",
944 self.svfs.write("journal.phaseroots",
945 self.sopener.tryread("phaseroots"))
945 self.svfs.tryread("phaseroots"))
946
946
947 def recover(self):
947 def recover(self):
948 lock = self.lock()
948 lock = self.lock()
949 try:
949 try:
950 if self.svfs.exists("journal"):
950 if self.svfs.exists("journal"):
951 self.ui.status(_("rolling back interrupted transaction\n"))
951 self.ui.status(_("rolling back interrupted transaction\n"))
952 vfsmap = {'': self.sopener,
952 vfsmap = {'': self.svfs,
953 'plain': self.vfs,}
953 'plain': self.vfs,}
954 transaction.rollback(self.sopener, vfsmap, "journal",
954 transaction.rollback(self.svfs, vfsmap, "journal",
955 self.ui.warn)
955 self.ui.warn)
956 self.invalidate()
956 self.invalidate()
957 return True
957 return True
@@ -1008,7 +1008,7 class localrepository(object):
1008 parents = self.dirstate.parents()
1008 parents = self.dirstate.parents()
1009 self.destroying()
1009 self.destroying()
1010 vfsmap = {'plain': self.vfs}
1010 vfsmap = {'plain': self.vfs}
1011 transaction.rollback(self.sopener, vfsmap, 'undo', ui.warn)
1011 transaction.rollback(self.svfs, vfsmap, 'undo', ui.warn)
1012 if self.vfs.exists('undo.bookmarks'):
1012 if self.vfs.exists('undo.bookmarks'):
1013 self.vfs.rename('undo.bookmarks', 'bookmarks')
1013 self.vfs.rename('undo.bookmarks', 'bookmarks')
1014 if self.svfs.exists('undo.phaseroots'):
1014 if self.svfs.exists('undo.phaseroots'):
@@ -1693,7 +1693,7 class localrepository(object):
1693 self.ui.debug('adding %s (%s)\n' %
1693 self.ui.debug('adding %s (%s)\n' %
1694 (name, util.bytecount(size)))
1694 (name, util.bytecount(size)))
1695 # for backwards compat, name was partially encoded
1695 # for backwards compat, name was partially encoded
1696 ofp = self.sopener(store.decodedir(name), 'w')
1696 ofp = self.svfs(store.decodedir(name), 'w')
1697 for chunk in util.filechunkiter(fp, limit=size):
1697 for chunk in util.filechunkiter(fp, limit=size):
1698 handled_bytes += len(chunk)
1698 handled_bytes += len(chunk)
1699 self.ui.progress(_('clone'), handled_bytes,
1699 self.ui.progress(_('clone'), handled_bytes,
General Comments 0
You need to be logged in to leave comments. Login now