Return a list of all modified files in a PR
437775
async function getPrFiles(mrNo) {
  logger.debug({ mrNo }, 'getPrFiles');
  if (!mrNo) {
    return [];
  }
  const files = (await get(
    `projects/${config.repository}/merge_requests/${mrNo}/changes`
  )).body.changes;
  return files.map(f => f.new_path);
}
921632
def find_upstream_changed(self, kind):
        
        output = subprocess.check_output([
            'git', 'log', '{}..origin/{}'.format(self.branch_name, self.branch_name),
            '--oneline', '--name-status'
        ], cwd=self.repo_dir).decode()
        files = []
        for line in output.split('\n'):
            if line.startswith(kind):
                files.append(os.path.join(self.repo_dir, line.split('\t', 1)[1]))

        return files
675824
def print_modified_files(opts, anchors):
    
    print("Files with modifications:")
    for file_path in anchors:
        print("  " + strip_prefix(file_path, opts.abs_input))
    print("--------------------")
    print(str(len(anchors)) + " total\n")
1162177
def _file_list(info_list) # :nodoc:
      files = Array.new
      info_list.each {|r|
        #p r.inspect
        # file is not modified, we don't want to see it (this is 'status')
        txt_stat = r[1].text_status
        next if ' ' == status_codes(txt_stat)
        f_rec = Hash.new
        f_rec[:path] = r[0]
        f_rec[:status] = status_codes(txt_stat)
        files.push f_rec
      }
      files
    end
830479
def _get_contents(self):
        """"""
        def files():
            for value in super(GlobBundle, self)._get_contents():
                for path in glob.glob(value):
                    yield path
        return list(files())
1316798
def files(self, *args, **kwargs):
        

        return [p for p in self.listdir(*args, **kwargs) if p.isfile()]
77870
def list_downloads():
    '''
    
    '''
    outfiles = []
    for root, subFolder, files in salt.utils.path.os_walk('/Library/Updates'):
        for f in files:
            outfiles.append(os.path.join(root, f))

    dist_files = []
    for f in outfiles:
        if f.endswith('.dist'):
            dist_files.append(f)

    ret = []
    for update in _get_available():
        for f in dist_files:
            with salt.utils.files.fopen(f) as fhr:
                if update.rsplit('-', 1)[0] in salt.utils.stringutils.to_unicode(fhr.read()):
                    ret.append(update)

    return ret
473687
def _file_lists(load, form):
    '''
    
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    if 'saltenv' not in load or load['saltenv'] not in envs():
        return []

    list_cachedir = os.path.join(__opts__['cachedir'], 'file_lists/svnfs')
    if not os.path.isdir(list_cachedir):
        try:
            os.makedirs(list_cachedir)
        except os.error:
            log.critical('Unable to make cachedir %s', list_cachedir)
            return []
    list_cache = os.path.join(list_cachedir, '{0}.p'.format(load['saltenv']))
    w_lock = os.path.join(list_cachedir, '.{0}.w'.format(load['saltenv']))
    cache_match, refresh_cache, save_cache = \
        salt.fileserver.check_file_list_cache(
            __opts__, form, list_cache, w_lock
        )
    if cache_match is not None:
        return cache_match
    if refresh_cache:
        ret = {
            'files': set(),
            'dirs': set(),
            'empty_dirs': set()
        }
        for repo in init():
            env_root = _env_root(repo, load['saltenv'])
            if env_root is None:
                # Environment not found, try the next repo
                continue
            if repo['root']:
                env_root = \
                    os.path.join(env_root, repo['root']).rstrip(os.path.sep)
                if not os.path.isdir(env_root):
                    # svnfs root (global or per-remote) does not exist in env
                    continue

            for root, dirs, files in salt.utils.path.os_walk(env_root):
                relpath = os.path.relpath(root, env_root)
                dir_rel_fn = os.path.join(repo['mountpoint'], relpath)
                if relpath != '.':
                    ret['dirs'].add(dir_rel_fn)
                    if not dirs and not files:
                        ret['empty_dirs'].add(dir_rel_fn)
                for fname in files:
                    rel_fn = os.path.relpath(
                                os.path.join(root, fname),
                                env_root
                            )
                    ret['files'].add(os.path.join(repo['mountpoint'], rel_fn))
        if repo['mountpoint']:
            ret['dirs'].add(repo['mountpoint'])
        # Convert all compiled sets to lists
        for key in ret:
            ret[key] = sorted(ret[key])
        if save_cache:
            salt.fileserver.write_file_list_cache(
                __opts__, ret, list_cache, w_lock
            )
        return ret.get(form, [])
    # Shouldn't get here, but if we do, this prevents a TypeError
    return []
1106607
def get_raw(self):
        
        return [self.name, self.size, self.last_modified, self.location]
1212854
def export_modifications(self):
        
        if self.__modified_data__ is not None:
            return self.export_data()

        result = {}

        for key, value in enumerate(self.__original_data__):
            try:
                if not value.is_modified():
                    continue
                modifications = value.export_modifications()
            except AttributeError:
                continue

            try:
                result.update({'{}.{}'.format(key, f): v for f, v in modifications.items()})
            except AttributeError:
                result[key] = modifications

        return result
118885
def listing(self):
        ""
        return ['.'.join([f,ext]) if ext else f for (f,ext) in self._files.keys()]
1170570
def _get_paths_for_status(self, status):
        
        added, modified, deleted = self._changes_cache
        return sorted({
            'added': list(added),
            'modified': list(modified),
            'deleted': list(deleted)}[status]
        )
1098288
def find_manifest_changes(new_file_state, old_file_state):
    
    prev_state_dict = copy.deepcopy(old_file_state)
    changed_files = {}

    # Find files which are new on the server
    for itm in new_file_state:
        if itm['path'] in prev_state_dict:
            d_itm = prev_state_dict.pop(itm['path'])

            # If the file has been modified
            if itm['last_mod'] != d_itm['last_mod']:
                n_itm = itm.copy()
                n_itm['status'] = 'changed'
                changed_files[itm['path']] = n_itm
            else:
                pass # The file has not changed

        else:
            n_itm = itm.copy()
            n_itm['status'] = 'new'
            changed_files[itm['path']] = n_itm

    # any files remaining in the old file state have been deleted locally
    for itm in prev_state_dict.itervalues():
        n_itm = itm.copy()
        n_itm['status'] = 'deleted'
        changed_files[itm['path']] = n_itm

    return changed_files
732824
function getStagedFiles(callback) {

    const options = [ 'diff', '--cached', '--name-only', '--diff-filter=ACM' ]

    execFile('git', options, (err, stdout) => {

        if (err) return callback(err)

        const stagedFiles = stdout
            .split('\n')
            .filter(filename => filename.match(/.js$/))

        callback(null, stagedFiles)

    })

}
313230
def get_output_files(self):
        
        # Lazily load info
        if self.info is None:
            self.get_info()

        if 'outputFiles' in self.info:
            return [GPFile(self.server_data, f['link']['href']) for f in self.info['outputFiles']]
        else:
            return []
211572
def _fetch_templates(src):
    '''
    
    '''
    templates = []
    log.debug('Listing contents of %s', src)
    for item in os.listdir(src):
        s = os.path.join(src, item)
        if os.path.isdir(s):
            template_path = os.path.join(s, TEMPLATE_FILE_NAME)
            if os.path.isfile(template_path):
                templates.append(_get_template(template_path, item))
            else:
                log.debug("Directory does not contain %s %s", template_path,
                          TEMPLATE_FILE_NAME)
    return templates
969893
def all_files(self):
        """"""
        return set([entry.decode() for entry, _ in self.git.open_index().items()])