Compare etag of path in source storage with remote.
352690
def has_matching_etag(remote_storage, source_storage, path, prefixed_path):
    
    storage_etag = get_etag(remote_storage, path, prefixed_path)
    local_etag = get_file_hash(source_storage, path)
    return storage_etag == local_etag
1195311
def exists(self, relpath):
    """"""
    if self.isignored(self._append_slash_if_dir_path(relpath)):
      return False
    return self._exists_raw(relpath)
746611
def check_local() -> None:
    
    to_check = ['./replay', './replay/toDo', './replay/archive']

    for i in to_check:
        if not os.path.exists(i):
            os.makedirs(i)
577627
def get_remote_url(path, remote="origin"):
    
    path = get_path(path)
    cmd = ["config", "--get", "remote.%s.url" % remote]
    return __run_git(cmd, path)[0]
746234
def walk(self, dirpath):
        """"""
        if self.is_ssh(dirpath):
            self._check_ftp()
            remotepath = self._get_remote(dirpath)
            return self._sftp_walk(remotepath)
        else:
            return os.walk(dirpath)
701886
def compare(self, path, prefixed_path, source_storage):
        
        # First try a method on the command named compare_<comparison_method>
        # If that doesn't exist, create a comparitor that calls methods on the
        # storage with the name <comparison_method>, passing them the name.
        comparitor = getattr(self, 'compare_%s' % self.comparison_method, None)
        if not comparitor:
            comparitor = self._create_comparitor(self.comparison_method)
        return comparitor(path, prefixed_path, source_storage)
287011
def _where(filename, dirs=[], env="PATH"):
    """"""
    if not isinstance(dirs, list):
        dirs = [dirs]
    if glob(filename):
        return filename
    paths = [os.curdir] + os.environ[env].split(os.path.pathsep) + dirs
    for path in paths:
        for match in glob(os.path.join(path, filename)):
            if match:
                return os.path.normpath(match)
    raise IOError("File not found: %s" % filename)
174368
def relative_to_remote_path(path)
      if path && path.length > 0
        File.join(remote_path, path)
      else
        remote_path
      end
    end
775822
def _get_relative_path(self):
    """"""
    param_string = self._get_query_string()
    if self.path is None:
      path = '/'
    else:
      path = self.path
    if param_string:
      return '?'.join([path, param_string])
    else:
      return path
674761
def RDirs(self, pathlist):
        """"""
        cwd = self.cwd or self.fs._cwd
        return cwd.Rfindalldirs(pathlist)
279840
def _match_real(filename, include, exclude, follow, symlinks):
    """"""

    sep = '\\' if util.platform() == "windows" else '/'
    if isinstance(filename, bytes):
        sep = os.fsencode(sep)
    if not filename.endswith(sep) and os.path.isdir(filename):
        filename += sep

    matched = False
    for pattern in include:
        if _fs_match(pattern, filename, sep, follow, symlinks):
            matched = True
            break

    if matched:
        matched = True
        if exclude:
            for pattern in exclude:
                if _fs_match(pattern, filename, sep, follow, symlinks):
                    matched = False
                    break
    return matched
246212
def find_repositories_with_locate(path):
    """"""
    command = [b'locate', b'-0']
    for dotdir in DOTDIRS:
        # Escaping the slash (using '\/' rather than '/') is an
        # important signal to locate(1) that these glob patterns are
        # supposed to match the full path, so that things like
        # '.hgignore' files do not show up in the result.
        command.append(br'%s\/%s' % (escape(path), escape(dotdir)))
        command.append(br'%s\/*/%s' % (escape(path), escape(dotdir)))
    try:
        paths = check_output(command).strip(b'\0').split(b'\0')
    except CalledProcessError:
        return []
    return [os.path.split(p) for p in paths
            if not os.path.islink(p) and os.path.isdir(p)]
683173
def abspath(self, path):
        """"""
        if self.is_ssh(path):
            return path
        else:
            return os.path.abspath(path)
815407
def read_remote_origin(repo_dir):
    """"""
    conf = ConfigParser()
    conf.read(os.path.join(repo_dir, '.git/config'))
    return conf.get('remote "origin"', 'url')
260864
def _remote_folder(dirpath, remotes, syn):
    
    if dirpath in remotes:
        return remotes[dirpath], remotes
    else:
        parent_dir, cur_dir = os.path.split(dirpath)
        parent_folder, remotes = _remote_folder(parent_dir, remotes, syn)
        s_cur_dir = syn.store(synapseclient.Folder(cur_dir, parent=parent_folder))
        remotes[dirpath] = s_cur_dir.id
        return s_cur_dir.id, remotes
1040677
def up_by_files(to_sync, remote_dir=DEFAULT_REMOTE_DIR, remote_files=None):
    """"""
    if remote_files is None:
        remote_files = command.map_files_raw(remote_dir=remote_dir)
    for local_file in to_sync:
        _sync_local_file(local_file, remote_dir, remote_files)
738575
def _check_proto(self, path):
        '''
        
        '''
        if not path.startswith('salt://'):
            raise MinionError('Unsupported path: {0}'.format(path))
        file_path, saltenv = salt.utils.url.parse(path)
        return file_path