Page MenuHomePhabricator

D8072.id18263.diff
No OneTemporary

D8072.id18263.diff

Index: resources/sql/autopatches/20140126.diff.1.parentrevisionid.sql
===================================================================
--- /dev/null
+++ resources/sql/autopatches/20140126.diff.1.parentrevisionid.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_differential.differential_diff
+ DROP COLUMN parentRevisionID;
Index: resources/sql/autopatches/20140126.diff.2.repositoryphid.sql
===================================================================
--- /dev/null
+++ resources/sql/autopatches/20140126.diff.2.repositoryphid.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_differential.differential_diff
+ ADD COLUMN repositoryPHID VARCHAR(64) COLLATE utf8_bin AFTER authorPHID;
Index: src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php
===================================================================
--- src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php
+++ src/applications/differential/conduit/ConduitAPI_differential_creatediff_Method.php
@@ -1,8 +1,5 @@
<?php
-/**
- * @group conduit
- */
final class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod {
public function getMethodDescription() {
@@ -16,10 +13,10 @@
'sourcePath' => 'required string',
'branch' => 'required string',
'bookmark' => 'optional string',
- 'sourceControlSystem' => 'required enum<svn, git>',
+ 'sourceControlSystem' => 'required enum<svn, git, hg>',
'sourceControlPath' => 'required string',
'sourceControlBaseRevision' => 'required string',
- 'parentRevisionID' => 'optional revisionid',
+ 'parentRevisionID' => 'deprecated',
'creationMethod' => 'optional string',
'authorPHID' => 'optional phid',
'arcanistProject' => 'optional string',
@@ -28,6 +25,7 @@
'required enum<none, skip, okay, warn, fail, postponed>',
'unitStatus' =>
'required enum<none, skip, okay, warn, fail, postponed>',
+ 'repositoryPHID' => 'optional phid',
);
}
@@ -57,20 +55,14 @@
$diff->setAuthorPHID($request->getValue('authorPHID'));
$diff->setBookmark($request->getValue('bookmark'));
- $parent_id = $request->getValue('parentRevisionID');
- if ($parent_id) {
- // NOTE: If the viewer can't see the parent revision, just don't set
- // a parent revision ID. This isn't used for anything meaningful.
- // TODO: Can we delete this entirely?
- $parent_rev = id(new DifferentialRevisionQuery())
- ->setViewer($request->getUser())
- ->withIDs(array($parent_id))
- ->execute();
- if ($parent_rev) {
- $parent_rev = head($parent_rev);
- if (!$parent_rev->isClosed()) {
- $diff->setParentRevisionID($parent_id);
- }
+ $repository_phid = $request->getValue('repositoryPHID');
+ if ($repository_phid) {
+ $repository = id(new PhabricatorRepositoryQuery())
+ ->setViewer($request->getViewer())
+ ->withPHIDs(array($repository_phid))
+ ->executeOne();
+ if ($repository) {
+ $diff->setRepositoryPHID($repository->getPHID());
}
}
Index: src/applications/differential/storage/DifferentialDiff.php
===================================================================
--- src/applications/differential/storage/DifferentialDiff.php
+++ src/applications/differential/storage/DifferentialDiff.php
@@ -8,6 +8,7 @@
protected $revisionID;
protected $authorPHID;
+ protected $repositoryPHID;
protected $sourceMachine;
protected $sourcePath;
@@ -24,7 +25,6 @@
protected $branch;
protected $bookmark;
- protected $parentRevisionID;
protected $arcanistProjectPHID;
protected $creationMethod;
protected $repositoryUUID;
@@ -223,7 +223,6 @@
public function getDiffDict() {
$dict = array(
'id' => $this->getID(),
- 'parent' => $this->getParentRevisionID(),
'revisionID' => $this->getRevisionID(),
'dateCreated' => $this->getDateCreated(),
'dateModified' => $this->getDateModified(),

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 29, 1:14 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7699038
Default Alt Text
D8072.id18263.diff (4 KB)

Event Timeline