List of diff actions
554669
@RequestMapping(value = "project/{projectId}/builds/diff", method = RequestMethod.GET)
    public Resources<Action> buildDiffActions(@PathVariable ID projectId) {
        return Resources.of(
                extensionManager.getExtensions(BuildDiffExtension.class)
                        .stream()
                        .filter(extension -> extension.apply(structureService.getProject(projectId)))
                        .map(this::resolveExtensionAction)
                        .collect(Collectors.toList()),
                uri(on(getClass()).buildDiffActions(projectId))
        );
    }
874977
public List<Change> diff(@NotNull final WeeklyOpeningHours toOther) {

        Contract.requireArgNotNull("toOther", toOther);

        final WeeklyOpeningHours thisNormalized = this.normalize();
        final WeeklyOpeningHours otherNormalized = toOther.normalize();

        final List<Change> changes = new ArrayList<>();

        for (final DayOpeningHours thisDoh : thisNormalized) {
            final DayOpeningHours otherDoh = otherNormalized.findDay(thisDoh);
            if (otherDoh == null) {
                // A day was completely deleted
                changes.addAll(thisDoh.asRemovedChanges());
            } else {
                // Day exists, but hours may have changed
                changes.addAll(thisDoh.diff(otherDoh));
            }
        }
        for (final DayOpeningHours otherDoh : otherNormalized) {
            final DayOpeningHours thisDoh = thisNormalized.findDay(otherDoh);
            if (thisDoh == null) {
                // A new day was added
                changes.addAll(otherDoh.asAddedChanges());
            }
        }

        return changes;

    }
541381
def is_diff(self):
        """"""
        if not isinstance(self.details, dict):
            return False

        for key in ['additions', 'updates', 'deletions']:
            if self.details.get(key, None):
                return True

        return False
980464
def modified_lines(self, r, file_name):
        """"""
        cmd = self.file_diff_cmd(r, file_name)
        diff = shell_out_ignore_exitcode(cmd, cwd=self.root)
        return list(self.modified_lines_from_diff(diff))
311881
def _diff_interface_lists(old, new):
    '''
    
    '''
    diff = _diff_lists(old, new, _nics_equal)

    # Remove duplicated addresses mac addresses and let libvirt generate them for us
    macs = [nic.find('mac').get('address') for nic in diff['unchanged']]
    for nic in diff['new']:
        mac = nic.find('mac')
        if mac.get('address') in macs:
            nic.remove(mac)

    return diff
1292450
def diffs(options = {})
      if parents.empty?
        show
      else
        self.class.diff(@repo, parents.first.id, @id, [], options)
      end
    end
1287436
def files_changed():
    
    with chdir(get_root()):
        result = run_command('git diff --name-only master...', capture='out')
    changed_files = result.stdout.splitlines()

    # Remove empty lines
    return [f for f in changed_files if f]
255186
def _highlight_line_difflib(self, line, next):
        

        if line['action'] == 'del':
            old, new = line, next
        else:
            old, new = next, line

        oldwords = re.split(r'(\W)', old['line'])
        newwords = re.split(r'(\W)', new['line'])

        sequence = difflib.SequenceMatcher(None, oldwords, newwords)

        oldfragments, newfragments = [], []
        for tag, i1, i2, j1, j2 in sequence.get_opcodes():
            oldfrag = ''.join(oldwords[i1:i2])
            newfrag = ''.join(newwords[j1:j2])
            if tag != 'equal':
                if oldfrag:
                    oldfrag = '<del>%s</del>' % oldfrag
                if newfrag:
                    newfrag = '<ins>%s</ins>' % newfrag
            oldfragments.append(oldfrag)
            newfragments.append(newfrag)

        old['line'] = "".join(oldfragments)
        new['line'] = "".join(newfragments)
161658
def _normalize_merge_diff_incr(diff):
        
        new_diff = []

        changes_found = False
        for line in diff.splitlines():
            if re.search(r"order-dependent line.*re-ordered", line):
                changes_found = True
            elif "No changes were found" in line:
                # IOS in the re-order case still claims "No changes were found"
                if not changes_found:
                    return ""
                else:
                    continue

            if line.strip() == "end":
                continue
            elif "List of Commands" in line:
                continue
            # Filter blank lines and prepend +sign
            elif line.strip():
                if re.search(r"^no\s+", line.strip()):
                    new_diff.append("-" + line)
                else:
                    new_diff.append("+" + line)
        return "\n".join(new_diff)
876423
def MemberDiff(data1, set1_name, data2, set2_name):
    """"""
    set1 = set(data1)
    set2 = set(data2)
    diffs = []
    msg = "Present in %s, missing in %s: %s"
    if set1 != set2:
      in_set1 = set1 - set2
      in_set2 = set2 - set1
      if in_set1:
        diffs.append(msg % (set1_name, set2_name, ",".join(in_set1)))
      if in_set2:
        diffs.append(msg % (set2_name, set1_name, ",".join(in_set2)))
    return diffs
173535
def list_actions(self):
        

        actions = []
        for path, actionName, action in self:
            actions.append(self.__namespace_splitter.join(itertools.chain(path, (actionName,))))
        return sorted(actions)
1370757
def task_actions(self):
        
        if self._task_actions is None:
            self._task_actions = TaskActionsList(
                self._version,
                assistant_sid=self._solution['assistant_sid'],
                task_sid=self._solution['sid'],
            )
        return self._task_actions
1340644
def list_actions(cls):
        """"""
        # Make sure these are always at the beginning of the list
        actions = ['start', 'stop', 'restart', 'status']
        # Iterate over the instance attributes checking for actions that
        # have been exposed
        for func_name in dir(cls):
            func = getattr(cls, func_name)
            if (not hasattr(func, '__call__') or
                    not getattr(func, '__daemonocle_exposed__', False)):
                # Not a function or not exposed
                continue
            action = func_name.replace('_', '-')
            if action not in actions:
                actions.append(action)

        return actions
206759
public function listAction()
    {
        $this->checkFolders();
        $this->view->assign('missingFolders', $this->missingFolders);
        $this->view->assign('storages', $this->storageRepository->load());
    }
1264296
def remove_diff(self, diff_key=None, diff_list='intersect'):
        ''''''
        if diff_list == 'intersect':
            for item in self._intersect:
                item['old'].pop(diff_key, None)
                item['new'].pop(diff_key, None)
        if diff_list == 'removed':
            for item in self._removed:
                item.pop(diff_key, None)
1323987
def affected_files(self):
        
        added, modified, deleted = self._changes_cache
        return list(added.union(modified).union(deleted))
1084683
def setup_common_actions(self):
        """"""
        # Filters
        filters_action = create_action(self, _("Edit filename filters..."),
                                       None, ima.icon('filter'),
                                       triggered=self.edit_filter)
        # Show all files
        all_action = create_action(self, _("Show all files"),
                                   toggled=self.toggle_all)
        all_action.setChecked(self.show_all)
        self.toggle_all(self.show_all)

        # Show all files
        single_click_to_open = create_action(
            self,
            _("Single click to open"),
            toggled=self.set_single_click_to_open,
        )
        single_click_to_open.setChecked(self.single_click_to_open)
        return [filters_action, all_action, single_click_to_open]