Commits

Jacob Moen committed f5a0870

Change has been dropped. Need to reimplement changes now, using the SCM component.

Comments (0)

Files changed (5)

protected/commands/HandleRepositoriesCommand.php

 
                     $change_edit = $change_del = $change_add = 0;
 
-                    foreach ($entry['files'] as $file) {
-                        $change = new Change;
-                        $change->changeset_id = $changeset->id;
-                        switch ($file['status']) {
-                            case 'M':
-                                $change_edit++;
-                                break;
-                            case 'A':
-                                $change_add++;
-                                break;
-                            case 'D':
-                                $change_del++;
-                                break;
-                            default:
-                                break;
-                        }
-                        $change->path = $file['name'];
-                        $change->action = $file['status'];
-                        if ('M' === $change->action) {
-                            $change->diff = $this->SCMBackend->getDiff($change->path, $changeset->short_rev);
-                        } elseif('A' === $change->action) {
-                            $change->diff = $this->SCMBackend->getFileContents($change->path, $changeset->short_rev);
-                        } elseif('D' === $change->action) {
-                            $change->diff = $this->SCMBackend->getFileContents($change->path, $this->SCMBackend->getLastRevisionOf($change->path));
-                        } else {
-                            $change->diff = '';
-                        }
-                        $fp = null;
-                        if ($change->validate()) {
-                            $change->save(false);
-                        } else {
-                            return false;
-                        }
-                    }
+                    // foreach ($entry['files'] as $file) {
+                    //     $change = new Change;
+                    //     $change->changeset_id = $changeset->id;
+                    //     switch ($file['status']) {
+                    //         case 'M':
+                    //             $change_edit++;
+                    //             break;
+                    //         case 'A':
+                    //             $change_add++;
+                    //             break;
+                    //         case 'D':
+                    //             $change_del++;
+                    //             break;
+                    //         default:
+                    //             break;
+                    //     }
+                    //     $change->path = $file['name'];
+                    //     $change->action = $file['status'];
+                    //     if ('M' === $change->action) {
+                    //         $change->diff = $this->SCMBackend->getDiff($change->path, $changeset->short_rev);
+                    //     } elseif('A' === $change->action) {
+                    //         $change->diff = $this->SCMBackend->getFileContents($change->path, $changeset->short_rev);
+                    //     } elseif('D' === $change->action) {
+                    //         $change->diff = $this->SCMBackend->getFileContents($change->path, $this->SCMBackend->getLastRevisionOf($change->path));
+                    //     } else {
+                    //         $change->diff = '';
+                    //     }
+                    //     $fp = null;
+                    //     if ($change->validate()) {
+                    //         $change->save(false);
+                    //     } else {
+                    //         return false;
+                    //     }
+                    // }
                     $changeset->add = $change_add;
                     $changeset->del = $change_del;
                     $changeset->edit = $change_edit;

protected/migrations/m130428_204559_drop_changes.php

+<?php
+
+class m130428_204559_drop_changes extends CDbMigration
+{
+	public function up()
+	{
+		$this->dropTable('{{change}}');
+	}
+
+	public function down()
+	{
+		echo "m130428_204559_drop_changes does not support migration down.\n";
+		return false;
+	}
+
+	/*
+	// Use safeUp/safeDown to do migration with transaction
+	public function safeUp()
+	{
+	}
+
+	public function safeDown()
+	{
+	}
+	*/
+}

protected/models/Change.php

-<?php
-/*
- * This file is part of
- *     ____              _ __
- *    / __ )__  ______ _(_) /_____  _____
- *   / __  / / / / __ `/ / __/ __ \/ ___/
- *  / /_/ / /_/ / /_/ / / /_/ /_/ / /
- * /_____/\__,_/\__, /_/\__/\____/_/
- *             /____/
- * A Yii powered issue tracker
- * http://bitbucket.org/jacmoe/bugitor/
- *
- * Copyright (C) 2009 - 2013 Bugitor Team
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
- * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
- * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-?>
-<?php
-
-/**
- * This is the model class for table "{{change}}".
- *
- * The followings are the available columns in table '{{change}}':
- * @property integer $id
- * @property integer $changeset_id
- * @property string $action
- * @property string $path
- * @property string $diff
- *
- * The followings are the available model relations:
- * @property Changeset $changeset
- */
-class Change extends CActiveRecord
-{
-    /**
-     * Returns the static model of the specified AR class.
-     * @return Change the static model class
-     */
-    public static function model($className=__CLASS__)
-    {
-        return parent::model($className);
-    }
-
-    /**
-     * @return string the associated database table name
-     */
-    public function tableName()
-    {
-        return '{{change}}';
-    }
-
-    /**
-     * @return array validation rules for model attributes.
-     */
-    public function rules()
-    {
-        // NOTE: you should only define rules for those attributes that
-        // will receive user inputs.
-        return array(
-            array('changeset_id, action, path', 'required'),
-            array('changeset_id', 'numerical', 'integerOnly'=>true),
-            array('action', 'length', 'max'=>50),
-            array('path', 'length', 'max'=>255),
-            // The following rule is used by search().
-            // Please remove those attributes that should not be searched.
-            array('id, changeset_id, action, path', 'safe', 'on'=>'search'),
-        );
-    }
-
-    /**
-     * @return array relational rules.
-     */
-    public function relations()
-    {
-        // NOTE: you may need to adjust the relation name and the related
-        // class name for the relations automatically generated below.
-        return array(
-            'changeset' => array(self::BELONGS_TO, 'Changeset', 'changeset_id'),
-        );
-    }
-
-    /**
-     * @return array customized attribute labels (name=>label)
-     */
-    public function attributeLabels()
-    {
-        return array(
-            'id' => 'ID',
-            'changeset_id' => 'Changeset',
-            'action' => 'Action',
-            'path' => 'Path',
-        );
-    }
-
-    /**
-     * Retrieves a list of models based on the current search/filter conditions.
-     * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
-     */
-    public function search()
-    {
-        // Warning: Please modify the following code to remove attributes that
-        // should not be searched.
-
-        $criteria=new CDbCriteria;
-
-        $criteria->compare('id',$this->id);
-        $criteria->compare('changeset_id',$this->changeset_id);
-        $criteria->compare('action',$this->action,true);
-        $criteria->compare('path',$this->path,true);
-
-        return new CActiveDataProvider(get_class($this), array(
-            'criteria'=>$criteria,
-        ));
-    }
-}

protected/models/Changeset.php

         // NOTE: you may need to adjust the relation name and the related
         // class name for the relations automatically generated below.
         return array(
-            'changes' => array(self::HAS_MANY, 'Change', 'changeset_id'),
-                        'scm' => array(self::BELONGS_TO, 'Repository', 'scm_id'),
             'user' => array(self::BELONGS_TO, 'User', 'user_id'),
                         'changesetIssues' => array(self::HAS_MANY, 'ChangesetIssue', 'changeset_id'),
         );
             'add' => 'Add',
             'edit' => 'Edit',
             'del' => 'Del',
-                        'author' => 'Author',
+            'author' => 'Author',
         );
     }
 

themes/bootstrap/views/changeset/view.php

             <?php while($count < $model->parent_count) : ?>
                 <?php list($parent_short, $parent_rev) = explode(":", $parents[$count]); ?>
                 <dt>parent <?php echo $parent_short; ?></dt>
-                <dd><?php echo Bugitor::link_to_changeset(Changeset::changesetFromRevision($parent_rev)); ?></dd>
+                <dd><?php //echo Bugitor::link_to_changeset(Changeset::changesetFromRevision($parent_rev)); ?></dd>
                 <?php $count++; ?>
             <?php endwhile; ?>
         <?php else : ?>
             <?php else : ?>
                 <?php list($parent_short, $parent_rev) = explode(":", $model->parents); ?>
                 <dt>parent <?php echo $parent_short; ?></dt>
-                <dd><?php echo Bugitor::link_to_changeset(Changeset::changesetFromRevision($parent_rev)); ?></dd>
+                <dd><?php //echo Bugitor::link_to_changeset(Changeset::changesetFromRevision($parent_rev)); ?></dd>
             <?php endif; ?>
         <?php endif; ?>
         <dt>branch</dt>
 </div>
 </div>
 <div id="changeset" class="layout-box">
-<h3>Changing <?php echo count($model->changes) ?> files:</h3>
+<h3>Changing <?php //echo count($model->changes) ?> files:</h3>
 <div class="quiet">
 <?php echo ($model->edit > 0) ? $model->edit . ' modified. ' : '' ?>
 <?php echo ($model->add > 0) ? $model->add . ' added. ' : '' ?>
 <?php echo ($model->del > 0) ? $model->del . ' deleted. ' : '' ?></div>
-<?php foreach($model->changes as $change) : ?>
+<?php //foreach($model->changes as $change) : ?>
     <?php
-    $change_class = '';
-    switch ($change->action) {
-        case 'M':
-            $change_class = 'class="change-modified"';
-            break;
-        case 'A':
-            $change_class = 'class="change-added"';
-            break;
-        case 'D':
-            $change_class = 'class="change-removed"';
-            break;
-        default:
-            $change_class = 'class="change-modified"';
-            break;
-    }
+    // $change_class = '';
+    // switch ($change->action) {
+    //     case 'M':
+    //         $change_class = 'class="change-modified"';
+    //         break;
+    //     case 'A':
+    //         $change_class = 'class="change-added"';
+    //         break;
+    //     case 'D':
+    //         $change_class = 'class="change-removed"';
+    //         break;
+    //     default:
+    //         $change_class = 'class="change-modified"';
+    //         break;
+    // }
     ?>
-    <?php if($change->action != 'C') : ?>
-        <a <?php echo $change_class; ?> href="#<?php echo $change->path; ?>"><?php echo $change->path; ?></a><br/>
-    <?php endif; ?>
-<?php endforeach; ?>
+    <?php //if($change->action != 'C') : ?>
+        <a <?php //echo $change_class; ?> href="#<?php //echo $change->path; ?>"><?php //echo $change->path; ?></a><br/>
+    <?php //endif; ?>
+<?php //endforeach; ?>
 </div>
-<?php foreach($model->changes as $change) : ?>
-    <?php if('M' == $change->action) : ?>
-        <a name="<?php echo $change->path; ?>"></a><div class="diff box">
-        <?php echo htmlspecialchars($change->diff); ?>
+<?php //foreach($model->changes as $change) : ?>
+    <?php //if('M' == $change->action) : ?>
+        <a name="<?php //echo $change->path; ?>"></a><div class="diff box">
+        <?php //echo htmlspecialchars($change->diff); ?>
         </div>
         <a style="float: right;" href="#top">Up To File-list</a>
-    <?php endif; ?>
-<?php endforeach; ?>
+    <?php //endif; ?>
+<?php //endforeach; ?>
 </div>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.