Indefero

Indefero Commit Details


Date:2009-02-02 10:38:48 (16 years 2 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:6c83169f1ce4e99683e86c3c2398fd1b47050fd1
Parents: 088f426986be011f3cb9dfd2504ce95e03316f60
Message:Fixed the submission of a code review and the display.

The display of a code review was crashing when a new file was added in
the diff.
The form to submit a review now proposes directly a choice of commits.
Changes:

File differences

src/IDF/Form/ReviewCreate.php
5959
6060
6161
62
63
64
65
66
67
68
69
6270
6371
6472
6573
74
6675
67
76
6877
6978
7079
                                                       'rows' => 7,
                                                                    ),
                                            ));
        $commits = Pluf::factory('IDF_Commit')->getList(array('order' => 'creation_dtime DESC',
                                                              'nb' => 10));
        $choices = array();
        foreach ($commits as $c) {
            $id = (strlen($c->scm_id) > 10) ? substr($c->scm_id, 0, 10) : $c->scm_id;
            $ext = (mb_strlen($c->summary) > 50) ? mb_substr($c->summary, 0, 47).'...' : $c->summary;
            $choices[$id.' - '.$ext] = $c->scm_id;
        }
        $this->fields['commit'] = new Pluf_Form_Field_Varchar(
                                      array('required' => true,
                                            'label' => __('Commit'),
                                            'initial' => '',
                                            'widget' => 'Pluf_Form_Widget_SelectInput',
                                            'widget_attrs' => array(
                                                       'size' => 42,
                                                       'choices' => $choices,
                                                                    ),
                                            ));
        $upload_path = Pluf::f('upload_issue_path', false);
src/IDF/Views/Review.php
208208
209209
210210
211
212211
213212
214213
......
216215
217216
218217
219
218
220219
221220
222221
        $reviewers = array();
        foreach ($diff->files as $filename => $def) {
            $fileinfo = $scm->getFileInfo($filename, $patch->get_commit()->scm_id);
            $sql = new Pluf_SQL('cfile=%s', array($filename));
            $cts = $patch->get_filecomments_list(array('filter'=>$sql->gen(),
                                                'order'=>'creation_dtime ASC'));
                $reviewers[] = $ct->get_submitter();
            }
            if (count($def['chunks'])) {
                $orig_file = $scm->getBlob($fileinfo);
                $orig_file = ($fileinfo) ? $scm->getBlob($fileinfo) : '';
                $files[$filename] = array(
                                          $diff->fileCompare($orig_file, $def, $filename),
                                          $form->f->{md5($filename)},

Archive Download the corresponding diff file

Page rendered in 0.14404s using 13 queries.