[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/resources/sql/patches/ -> 20130219.commitsummarymig.php (source)

   1  <?php
   2  
   3  echo "Backfilling commit summaries...\n";
   4  
   5  $table = new PhabricatorRepositoryCommit();
   6  $conn_w = $table->establishConnection('w');
   7  $commits = new LiskMigrationIterator($table);
   8  foreach ($commits as $commit) {
   9    echo 'Filling Commit #'.$commit->getID()."\n";
  10  
  11    if (strlen($commit->getSummary())) {
  12      continue;
  13    }
  14  
  15    $data = $commit->loadOneRelative(
  16      new PhabricatorRepositoryCommitData(),
  17      'commitID');
  18  
  19    if (!$data) {
  20      continue;
  21    }
  22  
  23    queryfx(
  24      $conn_w,
  25      'UPDATE %T SET summary = %s WHERE id = %d',
  26      $commit->getTableName(),
  27      $data->getSummary(),
  28      $commit->getID());
  29  }
  30  
  31  echo "Done.\n";


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1