Gets the list of change log file filters
505358
@RequestMapping(value = "changeLog/fileFilter/{projectId}", method = RequestMethod.GET)
    public Resources<Resource<SCMFileChangeFilter>> getChangeLogFileFilters(@PathVariable ID projectId) {
        // Gets the store
        SCMFileChangeFilters config = loadStore(projectId);
        // Resources
        return Resources.of(
                config.getFilters().stream().map(f -> toResource(projectId, f)),
                uri(on(getClass()).getChangeLogFileFilters(projectId))
        )
                .with(
                        Link.CREATE,
                        uri(on(getClass()).createChangeLogFileFilterForm(projectId)),
                        securityService.isProjectFunctionGranted(projectId.get(), ProjectConfig.class)
                )
                ;
    }
1292677
public List<EditLogFile> getLogFiles(long fromTxId, boolean enforceBoundary)
      throws IOException {
    File currentDir = sd.getCurrentDir();
    List<EditLogFile> allLogFiles = matchEditLogs(currentDir.listFiles());
    List<EditLogFile> logFiles = new ArrayList<EditLogFile>();
    
    for (EditLogFile elf : allLogFiles) {
      if (enforceBoundary && fromTxId > elf.getFirstTxId()
          && fromTxId <= elf.getLastTxId()) {
        throw new IOException("Asked for fromTxId " + fromTxId
            + " which is in middle of file " + elf.file);
      }
      if (fromTxId <= elf.getFirstTxId()) {
        logFiles.add(elf);
      }
    }
    
    Collections.sort(logFiles, EditLogFile.COMPARE_BY_START_TXID);

    return logFiles;
  }
9302
public static List<String> getFilesByChange(GerritQueryHandler gerritQueryHandler, String changeId) {
        try {
            List<JSONObject> jsonList = gerritQueryHandler.queryFiles("change:" + changeId);
            for (JSONObject json : jsonList) {
                if (json.has("type") && "stats".equalsIgnoreCase(json.getString("type"))) {
                    continue;
                }
                if (json.has("currentPatchSet")) {
                    JSONObject currentPatchSet = json.getJSONObject("currentPatchSet");
                    if (currentPatchSet.has("files")) {
                        JSONArray changedFiles = currentPatchSet.optJSONArray("files");
                        int numberOfFiles = changedFiles.size();

                        if (numberOfFiles > 0) {
                            List<String> files = new ArrayList<String>(numberOfFiles);
                            for (int i = 0; i < changedFiles.size(); i++) {
                                JSONObject file = changedFiles.getJSONObject(i);
                                files.add(file.getString("file"));
                            }
                            return files;
                        }
                    }

                    break;
                }
            }
        } catch (IOException e) {
            logger.error("IOException occurred. ", e);
        } catch (GerritQueryException e) {
            logger.error("Bad query. ", e);
        }
        return null;
    }
1337072
def get_list_filter(self, request):
        
        list_filter = super(VersionedAdmin, self).get_list_filter(request)
        return list(list_filter) + [('version_start_date', DateTimeFilter),
                                    IsCurrentFilter]
758111
public function getUnusedFilesListFilter()
    {
        Deprecation::notice('5.0', 'Will be removed in 5.0');

        // Add all records in link tracking
        $usedFiles = FileLink::get()->column('LinkedID');

        // Get all classes that aren't folder
        $fileClasses = array_diff_key(
            ClassInfo::subclassesFor(File::class),
            ClassInfo::subclassesFor(Folder::class)
        );

        // Search on a class-by-class basis
        $classes = ClassInfo::subclassesFor(SiteTree::class);

        $schema = DataObject::getSchema();
        foreach ($classes as $className) {
            // Build query based on all direct has_ones on this class
            $hasOnes = Config::inst()->get($className, 'has_one', Config::UNINHERITED);
            if (empty($hasOnes)) {
                continue;
            }
            $where = [];
            $columns = [];
            foreach ($hasOnes as $relName => $joinClass) {
                if (in_array($joinClass, $fileClasses)) {
                    $column = $relName . 'ID';
                    $columns[] = $column;
                    $quotedColumn = $schema->sqlColumnForField($className, $column);
                    $where[] = "{$quotedColumn} > 0";
                }
            }

            // Get all records with any file ID in the searched columns
            $recordsArray = DataList::create($className)->whereAny($where)->toArray();
            $records = ArrayList::create($recordsArray);
            foreach ($columns as $column) {
                $usedFiles = array_unique(array_merge($usedFiles, $records->column($column)));
            }
        }

        // Create filter based on class and id
        $classFilter = sprintf(
            "(\"File\".\"ClassName\" IN (%s))",
            implode(", ", Convert::raw2sql($fileClasses, true))
        );
        if ($usedFiles) {
            return "\"File\".\"ID\" NOT IN (" . implode(', ', $usedFiles) . ") AND $classFilter";
        } else {
            return $classFilter;
        }
    }
1323987
def affected_files(self):
        
        added, modified, deleted = self._changes_cache
        return list(added.union(modified).union(deleted))
480728
static private List<File> getFileListingLogs(File aStartingDir)
            throws Exception {
        List<File> result = new ArrayList<File>();
        File[] logfiles = aStartingDir.listFiles(new FileFilter() {

            @Override
            public boolean accept(File pathname) {
                return pathname.isFile();
            }
        });
        List<File> logFilesList = Arrays.asList(logfiles);
        File[] allDirs = aStartingDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.isDirectory();
            }
        });
        for (File file : logFilesList) {
            if (file.getName().equals("log.xml")) {
                result.add(file);
            }
        }
        List<File> allDirsList = Arrays.asList(allDirs);
        Collections.sort(allDirsList, new Comparator<File>() {
            public int compare(File o1, File o2) {

                if (o1.lastModified() > o2.lastModified()) {
                    return +1;
                } else if (o1.lastModified() < o2.lastModified()) {
                    return -1;
                } else {
                    return 0;
                }
            }

        });
        for (File file : allDirsList) {
            if (!file.isFile()) {
                List<File> deeperList = getFileListingLogs(file);
                result.addAll(deeperList);
            }
        }
        return result;
    }
854420
def get_all_changes(self, *args, **kwds):
        """"""
        result = []
        for project, refactoring in zip(self.projects, self.refactorings):
            args, kwds = self._resources_for_args(project, args, kwds)
            result.append((project, refactoring.get_changes(*args, **kwds)))
        return result
136810
function writeChangelog(changelog) {
      var fileContents = null;
      var firstLineFile = null;
      var firstLineFileHeader = null;
      var regex = null;

      if (options.insertType && grunt.file.exists(options.dest)) {
        fileContents = grunt.file.read(options.dest);
        firstLineFile = fileContents.split('\n')[0];
        grunt.log.debug('firstLineFile = ' + firstLineFile);

        switch (options.insertType) {
          case 'prepend':
            changelog = changelog + '\n' + fileContents;
            break;
          case 'append':
            changelog = fileContents + '\n' + changelog;
            break;
          default:
            grunt.fatal('"' + options.insertType + '" is not a valid insertType. Please use "append" or "prepend".');
            return false;
        }
      }

      if (options.fileHeader) {
        firstLineFileHeader = options.fileHeader.split('\n')[0];
        grunt.log.debug('firstLineFileHeader = ' + firstLineFileHeader);

        if (options.insertType === 'prepend') {
          if (firstLineFile !== firstLineFileHeader) {
            changelog = options.fileHeader + '\n\n' + changelog;
          } else {
            regex = new RegExp(options.fileHeader+'\n\n','m');
            changelog = options.fileHeader + '\n\n' + changelog.replace(regex, '');
          }

        // insertType === 'append' || undefined
        } else {
          if (firstLineFile !== firstLineFileHeader) {
            changelog = options.fileHeader + '\n\n' + changelog;
          }
        }

      }


      grunt.file.write(options.dest, changelog);

      // Log the results.
      grunt.log.ok(changelog);
      grunt.log.writeln();
      grunt.log.writeln('Changelog created at '+ options.dest.toString().cyan + '.');
    }
1208851
private int analysisItemDataChangesLog() throws IOException
   {
      int itemDataChangesLogType = PendingChangesLog.Type.CHANGESLOG_WITHOUT_STREAM;

      int i = 0;
      for (ItemState itemState : itemDataChangesLog.getAllStates())
      {
         ItemData itemData = itemState.getData();

         if (itemData instanceof PersistedPropertyData)
         {
            PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
            if ((propertyData.getValues() != null))
               for (int j = 0; j < propertyData.getValues().size(); j++)
                  if (!(propertyData.getValues().get(j).isByteArray()))
                  {
                     listFixupStream.add(new FixupStream(i, j));

                     InputStream inputStream;
                     if (itemState.isDeleted())
                        inputStream = new ByteArrayInputStream("".getBytes());
                     else
                        inputStream = propertyData.getValues().get(j).getAsStream();

                     listInputStream.add(inputStream);
                     itemDataChangesLogType = PendingChangesLog.Type.CHANGESLOG_WITH_STREAM;
                  }
         }

         i++;
      }

      return itemDataChangesLogType;
   }
590368
def _get_loggers():
    """"""
    from .. import loader
    modules = loader.get_package_modules('logger')
    return list(loader.get_plugins(modules, [_Logger]))
912708
function filterFilesForUnchangedTasks(before, after, paths) {
  var pathsRes = [];
  var tasksRes = [];

  for (var i = 0; i < before.length; i++) {
    var unchangedTasks = filterUnchangedTasks(before[i], after[i]);
    if (unchangedTasks.length > 0) {
      tasksRes.push(unchangedTasks);
      pathsRes.push(paths[i]);
    }
  }

  return [tasksRes, pathsRes];
}
239157
def get_modified_files():
    """"""
    c = subprocess.Popen(
        ["git", "diff-index", "--cached", "--name-only", "HEAD"], stdout=subprocess.PIPE
    )
    return c.communicate()[0].splitlines()
522966
@RequestMapping(value = "changelog/{uuid}/files", method = RequestMethod.GET)
    public SVNChangeLogFiles changeLogFiles(@PathVariable String uuid) {
        // Gets the change log
        SVNChangeLog changeLog = getChangeLog(uuid);
        // Cached?
        SVNChangeLogFiles files = changeLog.getFiles();
        if (files != null) {
            return files;
        }
        // Loads the files
        files = changeLogService.getChangeLogFiles(changeLog);
        // Stores in cache
        logCache.put(uuid, changeLog.withFiles(files));
        // OK
        return files;
    }
606191
def changes(self):
        """"""
        deleted = []
        for path in list(self.files):
            isdir = path.endswith(os.sep)
            abspath = os.path.join(self.path, path)
            try:
                is_deleted = (
                    not os.path.exists(abspath) or  # actually deleted
                    os.path.isdir(abspath) != isdir  # changed from / to folder
                )
            except EnvironmentError:
                # file is basically inaccessible at this point so we're gonna
                # assume that it was deleted
                is_deleted = True

            if is_deleted:
                deleted.append(path)
                del self.files[path]

        changed = []
        for folder, subfolders, subfiles in os.walk(self.path):
            for path in subfolders:
                path = os.path.join(folder, path)
                path = os.path.normcase(os.path.relpath(path, self.path))
                path += os.sep
                if path not in self.files:
                    # don't really care about folder mtime
                    self.files[path] = 0
                    changed.append(path)

            for path in subfiles:
                actual_path = path = os.path.join(folder, path)
                path = os.path.normcase(os.path.relpath(path, self.path))
                try:
                    mtime = os.path.getmtime(actual_path)
                    if path not in self.files:
                        # new file; set its mtime to 0 because it will be
                        # compared in the next few lines
                        self.files[path] = 0

                    if mtime > self.files[path]:
                        # file has been changed since last check
                        self.files[path] = mtime
                        changed.append(path)
                except EnvironmentError:
                    # in 99% of the cases the file has been deleted while
                    # iterating the parent folder; if the file was previously
                    # being handled, then stop handling it; otherwise ignore
                    if path in self.files:
                        deleted.append(path)
                        del self.files[path]

        self.updated = False
        return changed, deleted
906613
def query(self, files=True):
        """"""
        if self._change:
            cl = str(self._change)
            self._p4dict = {camel_case(k): v for k, v in six.iteritems(self._connection.run(['change', '-o', cl])[0])}

        if files:
            self._files = []
            if self._p4dict.get('status') == 'pending' or self._change == 0:
                change = self._change or 'default'
                data = self._connection.run(['opened', '-c', str(change)])
                self._files = [Revision(r, self._connection) for r in data]
            else:
                data = self._connection.run(['describe', str(self._change)])[0]
                depotfiles = []
                for k, v in six.iteritems(data):
                    if k.startswith('depotFile'):
                        depotfiles.append(v)
                self._files = self._connection.ls(depotfiles)
375050
@Override
    public Iterable<ServerInstanceLogRecordList> getLogLists() {
        return getLogLists((Date) null, (Date) null, (LogRecordHeaderFilter) null);
    }