original_docstring: Build FUSE inode hierarchy from archive metadata
          
docstring: Build FUSE inode hierarchy from archive metadata
docstring_tokens: Build FUSE inode hierarchy from archive metadata
code: def _process_archive(self, archive_name, prefix=[]):
          """Build FUSE inode hierarchy from archive metadata
          """
          self.file_versions = {}  # for versions mode: original path -> version
          t0 = time.perf_counter()
          archive = Archive(self.repository_uncached, self.key, self._manifest, archive_name,
                            consider_part_files=self._args.consider_part_files)
          strip_components = self._args.strip_components
          matcher = Archiver.build_matcher(self._args.patterns, self._args.paths)
          partial_extract = not matcher.empty() or strip_components
          hardlink_masters = {} if partial_extract else None
  
          def peek_and_store_hardlink_masters(item, matched):
              if (partial_extract and not matched and hardlinkable(item.mode) and
                      item.get('hardlink_master', True) and 'source' not in item):
                  hardlink_masters[item.get('path')] = (item.get('chunks'), None)
  
          filter = Archiver.build_filter(matcher, peek_and_store_hardlink_masters, strip_components)
          for item_inode, item in self.cache.iter_archive_items(archive.metadata.items, filter=filter,
                                                                consider_part_files=self._args.consider_part_files):
              if strip_components:
                  item.path = os.sep.join(item.path.split(os.sep)[strip_components:])
              path = os.fsencode(item.path)
              is_dir = stat.S_ISDIR(item.mode)
              if is_dir:
                  try:
                      # This can happen if an archive was created with a command line like
                      # $ borg create ... dir1/file dir1
                      # In this case the code below will have created a default_dir inode for dir1 already.
                      inode = self.find_inode(path, prefix)
                  except KeyError:
                      pass
                  else:
                      self._items[inode] = item
                      continue
              segments = prefix + path.split(b'/')
              parent = 1
              for segment in segments[:-1]:
                  parent = self._process_inner(segment, parent)
              self._process_leaf(segments[-1], item, parent, prefix, is_dir, item_inode,
                                 hardlink_masters, strip_components)
          duration = time.perf_counter() - t0
          logger.debug('fuse: _process_archive completed in %.1f s for archive %s', duration, archive.name)
code_tokens: def _process_archive ( self , archive_name , prefix = [ ] ) : self . file_versions = { } t0 = time . perf_counter ( ) archive = Archive ( self . repository_uncached , self . key , self . _manifest , archive_name , consider_part_files = self . _args . consider_part_files ) strip_components = self . _args . strip_components matcher = Archiver . build_matcher ( self . _args . patterns , self . _args . paths ) partial_extract = not matcher . empty ( ) or strip_components hardlink_masters = { } if partial_extract else None def peek_and_store_hardlink_masters ( item , matched ) : if ( partial_extract and not matched and hardlinkable ( item . mode ) and item . get ( 'hardlink_master' , True ) and 'source' not in item ) : hardlink_masters [ item . get ( 'path' ) ] = ( item . get ( 'chunks' ) , None ) filter = Archiver . build_filter ( matcher , peek_and_store_hardlink_masters , strip_components ) for item_inode , item in self . cache . iter_archive_items ( archive . metadata . items , filter = filter , consider_part_files = self . _args . consider_part_files ) : if strip_components : item . path = os . sep . join ( item . path . split ( os . sep ) [ strip_components : ] ) path = os . fsencode ( item . path ) is_dir = stat . S_ISDIR ( item . mode ) if is_dir : try : inode = self . find_inode ( path , prefix ) except KeyError : pass else : self . _items [ inode ] = item continue segments = prefix + path . split ( b'/' ) parent = 1 for segment in segments [ : - 1 ] : parent = self . _process_inner ( segment , parent ) self . _process_leaf ( segments [ - 1 ] , item , parent , prefix , is_dir , item_inode , hardlink_masters , strip_components ) duration = time . perf_counter ( ) - t0 logger . debug ( 'fuse: _process_archive completed in %.1f s for archive %s' , duration , archive . name )
short_docstring: Build FUSE inode hierarchy from archive metadata
short_docstring_tokens: Build FUSE inode hierarchy from archive metadata
comment: """Build FUSE inode hierarchy from archive metadata
          """$SEP$# for versions mode: original path -> version$SEP$# This can happen if an archive was created with a command line like$SEP$# $ borg create ... dir1/file dir1$SEP$# In this case the code below will have created a default_dir inode for dir1 already.