mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Diffusion - move DiffQuery to Conduit
Summary: title does not say it all; also added conduit wrappers for rawdiffquery and lastmodifiedquery. These get the wrapper treatment since they are used in daemons. Ref T2784. Test Plan: for each of the 3 VCS, did the following: 1) loaded up CALLSIGN and verified 'Modified' column data showed up correctly in Browse Repository box. 2) loaded up the "change" view for a specific file and verified content showed up correctly. 3) loaded up a specific commit and noted the changes ajax loaded A-OK Reviewers: epriestley Reviewed By: epriestley CC: chad, aran, Korvin Maniphest Tasks: T2784 Differential Revision: https://secure.phabricator.com/D5896
This commit is contained in:
parent
27f016ba14
commit
c1d771d86c
17 changed files with 357 additions and 302 deletions
|
@ -147,12 +147,15 @@ phutil_register_library_map(array(
|
||||||
'ConduitAPI_diffusion_abstractquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_abstractquery_Method.php',
|
'ConduitAPI_diffusion_abstractquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_abstractquery_Method.php',
|
||||||
'ConduitAPI_diffusion_branchquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php',
|
'ConduitAPI_diffusion_branchquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php',
|
||||||
'ConduitAPI_diffusion_browsequery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_browsequery_Method.php',
|
'ConduitAPI_diffusion_browsequery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_browsequery_Method.php',
|
||||||
|
'ConduitAPI_diffusion_diffquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_diffquery_Method.php',
|
||||||
'ConduitAPI_diffusion_existsquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php',
|
'ConduitAPI_diffusion_existsquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_existsquery_Method.php',
|
||||||
'ConduitAPI_diffusion_filecontentquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_filecontentquery_Method.php',
|
'ConduitAPI_diffusion_filecontentquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_filecontentquery_Method.php',
|
||||||
'ConduitAPI_diffusion_findsymbols_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php',
|
'ConduitAPI_diffusion_findsymbols_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_findsymbols_Method.php',
|
||||||
'ConduitAPI_diffusion_getcommits_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php',
|
'ConduitAPI_diffusion_getcommits_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php',
|
||||||
'ConduitAPI_diffusion_getlintmessages_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php',
|
'ConduitAPI_diffusion_getlintmessages_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getlintmessages_Method.php',
|
||||||
'ConduitAPI_diffusion_getrecentcommitsbypath_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php',
|
'ConduitAPI_diffusion_getrecentcommitsbypath_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_getrecentcommitsbypath_Method.php',
|
||||||
|
'ConduitAPI_diffusion_lastmodifiedquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_lastmodifiedquery_Method.php',
|
||||||
|
'ConduitAPI_diffusion_rawdiffquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_rawdiffquery_Method.php',
|
||||||
'ConduitAPI_diffusion_tagsquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_tagsquery_Method.php',
|
'ConduitAPI_diffusion_tagsquery_Method' => 'applications/diffusion/conduit/ConduitAPI_diffusion_tagsquery_Method.php',
|
||||||
'ConduitAPI_feed_Method' => 'applications/feed/conduit/ConduitAPI_feed_Method.php',
|
'ConduitAPI_feed_Method' => 'applications/feed/conduit/ConduitAPI_feed_Method.php',
|
||||||
'ConduitAPI_feed_publish_Method' => 'applications/feed/conduit/ConduitAPI_feed_publish_Method.php',
|
'ConduitAPI_feed_publish_Method' => 'applications/feed/conduit/ConduitAPI_feed_publish_Method.php',
|
||||||
|
@ -425,7 +428,6 @@ phutil_register_library_map(array(
|
||||||
'DiffusionContainsQuery' => 'applications/diffusion/query/contains/DiffusionContainsQuery.php',
|
'DiffusionContainsQuery' => 'applications/diffusion/query/contains/DiffusionContainsQuery.php',
|
||||||
'DiffusionController' => 'applications/diffusion/controller/DiffusionController.php',
|
'DiffusionController' => 'applications/diffusion/controller/DiffusionController.php',
|
||||||
'DiffusionDiffController' => 'applications/diffusion/controller/DiffusionDiffController.php',
|
'DiffusionDiffController' => 'applications/diffusion/controller/DiffusionDiffController.php',
|
||||||
'DiffusionDiffQuery' => 'applications/diffusion/query/diff/DiffusionDiffQuery.php',
|
|
||||||
'DiffusionEmptyResultView' => 'applications/diffusion/view/DiffusionEmptyResultView.php',
|
'DiffusionEmptyResultView' => 'applications/diffusion/view/DiffusionEmptyResultView.php',
|
||||||
'DiffusionExternalController' => 'applications/diffusion/controller/DiffusionExternalController.php',
|
'DiffusionExternalController' => 'applications/diffusion/controller/DiffusionExternalController.php',
|
||||||
'DiffusionFileContent' => 'applications/diffusion/data/DiffusionFileContent.php',
|
'DiffusionFileContent' => 'applications/diffusion/data/DiffusionFileContent.php',
|
||||||
|
@ -434,10 +436,8 @@ phutil_register_library_map(array(
|
||||||
'DiffusionGitBranchTestCase' => 'applications/diffusion/data/__tests__/DiffusionGitBranchTestCase.php',
|
'DiffusionGitBranchTestCase' => 'applications/diffusion/data/__tests__/DiffusionGitBranchTestCase.php',
|
||||||
'DiffusionGitCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionGitCommitParentsQuery.php',
|
'DiffusionGitCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionGitCommitParentsQuery.php',
|
||||||
'DiffusionGitContainsQuery' => 'applications/diffusion/query/contains/DiffusionGitContainsQuery.php',
|
'DiffusionGitContainsQuery' => 'applications/diffusion/query/contains/DiffusionGitContainsQuery.php',
|
||||||
'DiffusionGitDiffQuery' => 'applications/diffusion/query/diff/DiffusionGitDiffQuery.php',
|
|
||||||
'DiffusionGitFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php',
|
'DiffusionGitFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php',
|
||||||
'DiffusionGitHistoryQuery' => 'applications/diffusion/query/history/DiffusionGitHistoryQuery.php',
|
'DiffusionGitHistoryQuery' => 'applications/diffusion/query/history/DiffusionGitHistoryQuery.php',
|
||||||
'DiffusionGitLastModifiedQuery' => 'applications/diffusion/query/lastmodified/DiffusionGitLastModifiedQuery.php',
|
|
||||||
'DiffusionGitMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionGitMergedCommitsQuery.php',
|
'DiffusionGitMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionGitMergedCommitsQuery.php',
|
||||||
'DiffusionGitRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php',
|
'DiffusionGitRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php',
|
||||||
'DiffusionGitRequest' => 'applications/diffusion/request/DiffusionGitRequest.php',
|
'DiffusionGitRequest' => 'applications/diffusion/request/DiffusionGitRequest.php',
|
||||||
|
@ -449,16 +449,13 @@ phutil_register_library_map(array(
|
||||||
'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php',
|
'DiffusionInlineCommentController' => 'applications/diffusion/controller/DiffusionInlineCommentController.php',
|
||||||
'DiffusionInlineCommentPreviewController' => 'applications/diffusion/controller/DiffusionInlineCommentPreviewController.php',
|
'DiffusionInlineCommentPreviewController' => 'applications/diffusion/controller/DiffusionInlineCommentPreviewController.php',
|
||||||
'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php',
|
'DiffusionLastModifiedController' => 'applications/diffusion/controller/DiffusionLastModifiedController.php',
|
||||||
'DiffusionLastModifiedQuery' => 'applications/diffusion/query/lastmodified/DiffusionLastModifiedQuery.php',
|
|
||||||
'DiffusionLintController' => 'applications/diffusion/controller/DiffusionLintController.php',
|
'DiffusionLintController' => 'applications/diffusion/controller/DiffusionLintController.php',
|
||||||
'DiffusionLintDetailsController' => 'applications/diffusion/controller/DiffusionLintDetailsController.php',
|
'DiffusionLintDetailsController' => 'applications/diffusion/controller/DiffusionLintDetailsController.php',
|
||||||
'DiffusionLintSaveRunner' => 'applications/diffusion/DiffusionLintSaveRunner.php',
|
'DiffusionLintSaveRunner' => 'applications/diffusion/DiffusionLintSaveRunner.php',
|
||||||
'DiffusionMercurialCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionMercurialCommitParentsQuery.php',
|
'DiffusionMercurialCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionMercurialCommitParentsQuery.php',
|
||||||
'DiffusionMercurialContainsQuery' => 'applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php',
|
'DiffusionMercurialContainsQuery' => 'applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php',
|
||||||
'DiffusionMercurialDiffQuery' => 'applications/diffusion/query/diff/DiffusionMercurialDiffQuery.php',
|
|
||||||
'DiffusionMercurialFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionMercurialFileContentQuery.php',
|
'DiffusionMercurialFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionMercurialFileContentQuery.php',
|
||||||
'DiffusionMercurialHistoryQuery' => 'applications/diffusion/query/history/DiffusionMercurialHistoryQuery.php',
|
'DiffusionMercurialHistoryQuery' => 'applications/diffusion/query/history/DiffusionMercurialHistoryQuery.php',
|
||||||
'DiffusionMercurialLastModifiedQuery' => 'applications/diffusion/query/lastmodified/DiffusionMercurialLastModifiedQuery.php',
|
|
||||||
'DiffusionMercurialMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionMercurialMergedCommitsQuery.php',
|
'DiffusionMercurialMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionMercurialMergedCommitsQuery.php',
|
||||||
'DiffusionMercurialRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php',
|
'DiffusionMercurialRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionMercurialRawDiffQuery.php',
|
||||||
'DiffusionMercurialRequest' => 'applications/diffusion/request/DiffusionMercurialRequest.php',
|
'DiffusionMercurialRequest' => 'applications/diffusion/request/DiffusionMercurialRequest.php',
|
||||||
|
@ -482,10 +479,8 @@ phutil_register_library_map(array(
|
||||||
'DiffusionSetupException' => 'applications/diffusion/exception/DiffusionSetupException.php',
|
'DiffusionSetupException' => 'applications/diffusion/exception/DiffusionSetupException.php',
|
||||||
'DiffusionSvnCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionSvnCommitParentsQuery.php',
|
'DiffusionSvnCommitParentsQuery' => 'applications/diffusion/query/parents/DiffusionSvnCommitParentsQuery.php',
|
||||||
'DiffusionSvnContainsQuery' => 'applications/diffusion/query/contains/DiffusionSvnContainsQuery.php',
|
'DiffusionSvnContainsQuery' => 'applications/diffusion/query/contains/DiffusionSvnContainsQuery.php',
|
||||||
'DiffusionSvnDiffQuery' => 'applications/diffusion/query/diff/DiffusionSvnDiffQuery.php',
|
|
||||||
'DiffusionSvnFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php',
|
'DiffusionSvnFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php',
|
||||||
'DiffusionSvnHistoryQuery' => 'applications/diffusion/query/history/DiffusionSvnHistoryQuery.php',
|
'DiffusionSvnHistoryQuery' => 'applications/diffusion/query/history/DiffusionSvnHistoryQuery.php',
|
||||||
'DiffusionSvnLastModifiedQuery' => 'applications/diffusion/query/lastmodified/DiffusionSvnLastModifiedQuery.php',
|
|
||||||
'DiffusionSvnMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionSvnMergedCommitsQuery.php',
|
'DiffusionSvnMergedCommitsQuery' => 'applications/diffusion/query/mergedcommits/DiffusionSvnMergedCommitsQuery.php',
|
||||||
'DiffusionSvnRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionSvnRawDiffQuery.php',
|
'DiffusionSvnRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionSvnRawDiffQuery.php',
|
||||||
'DiffusionSvnRequest' => 'applications/diffusion/request/DiffusionSvnRequest.php',
|
'DiffusionSvnRequest' => 'applications/diffusion/request/DiffusionSvnRequest.php',
|
||||||
|
@ -1942,12 +1937,15 @@ phutil_register_library_map(array(
|
||||||
'ConduitAPI_diffusion_abstractquery_Method' => 'ConduitAPI_diffusion_Method',
|
'ConduitAPI_diffusion_abstractquery_Method' => 'ConduitAPI_diffusion_Method',
|
||||||
'ConduitAPI_diffusion_branchquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
'ConduitAPI_diffusion_branchquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_diffusion_browsequery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
'ConduitAPI_diffusion_browsequery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
|
'ConduitAPI_diffusion_diffquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_diffusion_existsquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
'ConduitAPI_diffusion_existsquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_diffusion_filecontentquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
'ConduitAPI_diffusion_filecontentquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_diffusion_findsymbols_Method' => 'ConduitAPI_diffusion_Method',
|
'ConduitAPI_diffusion_findsymbols_Method' => 'ConduitAPI_diffusion_Method',
|
||||||
'ConduitAPI_diffusion_getcommits_Method' => 'ConduitAPI_diffusion_Method',
|
'ConduitAPI_diffusion_getcommits_Method' => 'ConduitAPI_diffusion_Method',
|
||||||
'ConduitAPI_diffusion_getlintmessages_Method' => 'ConduitAPI_diffusion_Method',
|
'ConduitAPI_diffusion_getlintmessages_Method' => 'ConduitAPI_diffusion_Method',
|
||||||
'ConduitAPI_diffusion_getrecentcommitsbypath_Method' => 'ConduitAPI_diffusion_Method',
|
'ConduitAPI_diffusion_getrecentcommitsbypath_Method' => 'ConduitAPI_diffusion_Method',
|
||||||
|
'ConduitAPI_diffusion_lastmodifiedquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
|
'ConduitAPI_diffusion_rawdiffquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_diffusion_tagsquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
'ConduitAPI_diffusion_tagsquery_Method' => 'ConduitAPI_diffusion_abstractquery_Method',
|
||||||
'ConduitAPI_feed_Method' => 'ConduitAPIMethod',
|
'ConduitAPI_feed_Method' => 'ConduitAPIMethod',
|
||||||
'ConduitAPI_feed_publish_Method' => 'ConduitAPI_feed_Method',
|
'ConduitAPI_feed_publish_Method' => 'ConduitAPI_feed_Method',
|
||||||
|
@ -2210,17 +2208,14 @@ phutil_register_library_map(array(
|
||||||
'DiffusionContainsQuery' => 'DiffusionQuery',
|
'DiffusionContainsQuery' => 'DiffusionQuery',
|
||||||
'DiffusionController' => 'PhabricatorController',
|
'DiffusionController' => 'PhabricatorController',
|
||||||
'DiffusionDiffController' => 'DiffusionController',
|
'DiffusionDiffController' => 'DiffusionController',
|
||||||
'DiffusionDiffQuery' => 'DiffusionQuery',
|
|
||||||
'DiffusionEmptyResultView' => 'DiffusionView',
|
'DiffusionEmptyResultView' => 'DiffusionView',
|
||||||
'DiffusionExternalController' => 'DiffusionController',
|
'DiffusionExternalController' => 'DiffusionController',
|
||||||
'DiffusionFileContentQuery' => 'DiffusionQuery',
|
'DiffusionFileContentQuery' => 'DiffusionQuery',
|
||||||
'DiffusionGitBranchTestCase' => 'PhabricatorTestCase',
|
'DiffusionGitBranchTestCase' => 'PhabricatorTestCase',
|
||||||
'DiffusionGitCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
'DiffusionGitCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
||||||
'DiffusionGitContainsQuery' => 'DiffusionContainsQuery',
|
'DiffusionGitContainsQuery' => 'DiffusionContainsQuery',
|
||||||
'DiffusionGitDiffQuery' => 'DiffusionDiffQuery',
|
|
||||||
'DiffusionGitFileContentQuery' => 'DiffusionFileContentQuery',
|
'DiffusionGitFileContentQuery' => 'DiffusionFileContentQuery',
|
||||||
'DiffusionGitHistoryQuery' => 'DiffusionHistoryQuery',
|
'DiffusionGitHistoryQuery' => 'DiffusionHistoryQuery',
|
||||||
'DiffusionGitLastModifiedQuery' => 'DiffusionLastModifiedQuery',
|
|
||||||
'DiffusionGitMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
'DiffusionGitMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
||||||
'DiffusionGitRawDiffQuery' => 'DiffusionRawDiffQuery',
|
'DiffusionGitRawDiffQuery' => 'DiffusionRawDiffQuery',
|
||||||
'DiffusionGitRequest' => 'DiffusionRequest',
|
'DiffusionGitRequest' => 'DiffusionRequest',
|
||||||
|
@ -2232,15 +2227,12 @@ phutil_register_library_map(array(
|
||||||
'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController',
|
'DiffusionInlineCommentController' => 'PhabricatorInlineCommentController',
|
||||||
'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController',
|
'DiffusionInlineCommentPreviewController' => 'PhabricatorInlineCommentPreviewController',
|
||||||
'DiffusionLastModifiedController' => 'DiffusionController',
|
'DiffusionLastModifiedController' => 'DiffusionController',
|
||||||
'DiffusionLastModifiedQuery' => 'DiffusionQuery',
|
|
||||||
'DiffusionLintController' => 'DiffusionController',
|
'DiffusionLintController' => 'DiffusionController',
|
||||||
'DiffusionLintDetailsController' => 'DiffusionController',
|
'DiffusionLintDetailsController' => 'DiffusionController',
|
||||||
'DiffusionMercurialCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
'DiffusionMercurialCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
||||||
'DiffusionMercurialContainsQuery' => 'DiffusionContainsQuery',
|
'DiffusionMercurialContainsQuery' => 'DiffusionContainsQuery',
|
||||||
'DiffusionMercurialDiffQuery' => 'DiffusionDiffQuery',
|
|
||||||
'DiffusionMercurialFileContentQuery' => 'DiffusionFileContentQuery',
|
'DiffusionMercurialFileContentQuery' => 'DiffusionFileContentQuery',
|
||||||
'DiffusionMercurialHistoryQuery' => 'DiffusionHistoryQuery',
|
'DiffusionMercurialHistoryQuery' => 'DiffusionHistoryQuery',
|
||||||
'DiffusionMercurialLastModifiedQuery' => 'DiffusionLastModifiedQuery',
|
|
||||||
'DiffusionMercurialMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
'DiffusionMercurialMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
||||||
'DiffusionMercurialRawDiffQuery' => 'DiffusionRawDiffQuery',
|
'DiffusionMercurialRawDiffQuery' => 'DiffusionRawDiffQuery',
|
||||||
'DiffusionMercurialRequest' => 'DiffusionRequest',
|
'DiffusionMercurialRequest' => 'DiffusionRequest',
|
||||||
|
@ -2256,10 +2248,8 @@ phutil_register_library_map(array(
|
||||||
'DiffusionSetupException' => 'AphrontUsageException',
|
'DiffusionSetupException' => 'AphrontUsageException',
|
||||||
'DiffusionSvnCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
'DiffusionSvnCommitParentsQuery' => 'DiffusionCommitParentsQuery',
|
||||||
'DiffusionSvnContainsQuery' => 'DiffusionContainsQuery',
|
'DiffusionSvnContainsQuery' => 'DiffusionContainsQuery',
|
||||||
'DiffusionSvnDiffQuery' => 'DiffusionDiffQuery',
|
|
||||||
'DiffusionSvnFileContentQuery' => 'DiffusionFileContentQuery',
|
'DiffusionSvnFileContentQuery' => 'DiffusionFileContentQuery',
|
||||||
'DiffusionSvnHistoryQuery' => 'DiffusionHistoryQuery',
|
'DiffusionSvnHistoryQuery' => 'DiffusionHistoryQuery',
|
||||||
'DiffusionSvnLastModifiedQuery' => 'DiffusionLastModifiedQuery',
|
|
||||||
'DiffusionSvnMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
'DiffusionSvnMergedCommitsQuery' => 'DiffusionMergedCommitsQuery',
|
||||||
'DiffusionSvnRawDiffQuery' => 'DiffusionRawDiffQuery',
|
'DiffusionSvnRawDiffQuery' => 'DiffusionRawDiffQuery',
|
||||||
'DiffusionSvnRequest' => 'DiffusionRequest',
|
'DiffusionSvnRequest' => 'DiffusionRequest',
|
||||||
|
|
|
@ -1,14 +1,57 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
final class DiffusionSvnDiffQuery extends DiffusionDiffQuery {
|
/**
|
||||||
|
* @group conduit
|
||||||
|
*/
|
||||||
|
final class ConduitAPI_diffusion_diffquery_Method
|
||||||
|
extends ConduitAPI_diffusion_abstractquery_Method {
|
||||||
|
|
||||||
protected function executeQuery() {
|
private $effectiveCommit;
|
||||||
$drequest = $this->getRequest();
|
|
||||||
|
public function getMethodDescription() {
|
||||||
|
return
|
||||||
|
'Get diff information from a repository for a specific path at an '.
|
||||||
|
'(optional) commit.';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function defineReturnType() {
|
||||||
|
return 'array';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineCustomParamTypes() {
|
||||||
|
return array(
|
||||||
|
'path' => 'required string',
|
||||||
|
'commit' => 'optional string',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getResult(ConduitAPIRequest $request) {
|
||||||
|
$result = parent::getResult($request);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'changes' => mpull($result, 'toDictionary'),
|
||||||
|
'effectiveCommit' => $this->getEffectiveCommit($request));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getGitResult(ConduitAPIRequest $request) {
|
||||||
|
return $this->getGitOrMercurialResult($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getMercurialResult(ConduitAPIRequest $request) {
|
||||||
|
return $this->getGitOrMercurialResult($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTE: We have to work particularly hard for SVN as compared to other VCS.
|
||||||
|
* That's okay but means this shares little code with the other VCS.
|
||||||
|
*/
|
||||||
|
protected function getSVNResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
$repository = $drequest->getRepository();
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
$effective_commit = $this->getEffectiveCommit();
|
$effective_commit = $this->getEffectiveCommit($request);
|
||||||
if (!$effective_commit) {
|
if (!$effective_commit) {
|
||||||
return null;
|
return $this->getEmptyResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
$drequest = clone $drequest;
|
$drequest = clone $drequest;
|
||||||
|
@ -26,7 +69,7 @@ final class DiffusionSvnDiffQuery extends DiffusionDiffQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$path) {
|
if (!$path) {
|
||||||
return null;
|
return $this->getEmptyResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
$change_type = $path->getChangeType();
|
$change_type = $path->getChangeType();
|
||||||
|
@ -76,8 +119,8 @@ final class DiffusionSvnDiffQuery extends DiffusionDiffQuery {
|
||||||
}
|
}
|
||||||
|
|
||||||
$futures = array(
|
$futures = array(
|
||||||
'old' => $this->buildContentFuture($old),
|
'old' => $this->buildSVNContentFuture($old),
|
||||||
'new' => $this->buildContentFuture($new),
|
'new' => $this->buildSVNContentFuture($new),
|
||||||
);
|
);
|
||||||
$futures = array_filter($futures);
|
$futures = array_filter($futures);
|
||||||
|
|
||||||
|
@ -101,39 +144,51 @@ final class DiffusionSvnDiffQuery extends DiffusionDiffQuery {
|
||||||
$engine->setNewName($new_name);
|
$engine->setNewName($new_name);
|
||||||
$raw_diff = $engine->generateRawDiffFromFileContent($old_data, $new_data);
|
$raw_diff = $engine->generateRawDiffFromFileContent($old_data, $new_data);
|
||||||
|
|
||||||
$parser = new ArcanistDiffParser();
|
|
||||||
|
|
||||||
$try_encoding = $repository->getDetail('encoding');
|
|
||||||
if ($try_encoding) {
|
|
||||||
$parser->setTryEncoding($try_encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser->setDetectBinaryFiles(true);
|
|
||||||
|
|
||||||
$arcanist_changes = DiffusionPathChange::convertToArcanistChanges(
|
$arcanist_changes = DiffusionPathChange::convertToArcanistChanges(
|
||||||
$path_changes);
|
$path_changes);
|
||||||
|
|
||||||
|
$parser = $this->getDefaultParser();
|
||||||
$parser->setChanges($arcanist_changes);
|
$parser->setChanges($arcanist_changes);
|
||||||
$parser->forcePath($path->getPath());
|
$parser->forcePath($path->getPath());
|
||||||
$changes = $parser->parseDiff($raw_diff);
|
$changes = $parser->parseDiff($raw_diff);
|
||||||
|
|
||||||
$change = $changes[$path->getPath()];
|
$change = $changes[$path->getPath()];
|
||||||
|
|
||||||
$diff = DifferentialDiff::newFromRawChanges(array($change));
|
return array($change);
|
||||||
$changesets = $diff->getChangesets();
|
|
||||||
$changeset = reset($changesets);
|
|
||||||
|
|
||||||
$this->renderingReference = $drequest->getPath().';'.$drequest->getCommit();
|
|
||||||
|
|
||||||
return $changeset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildContentFuture($spec) {
|
private function getEffectiveCommit(ConduitAPIRequest $request) {
|
||||||
|
if ($this->effectiveCommit === null) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$user = $request->getUser();
|
||||||
|
$commit = null;
|
||||||
|
|
||||||
|
$conduit_result = DiffusionQuery::callConduitWithDiffusionRequest(
|
||||||
|
$user,
|
||||||
|
$drequest,
|
||||||
|
'diffusion.lastmodifiedquery',
|
||||||
|
array(
|
||||||
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath()));
|
||||||
|
$c_dict = $conduit_result['commit'];
|
||||||
|
if ($c_dict) {
|
||||||
|
$commit = PhabricatorRepositoryCommit::newFromDictionary($c_dict);
|
||||||
|
}
|
||||||
|
if (!$commit) {
|
||||||
|
// TODO: Improve error messages here.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$this->effectiveCommit = $commit->getCommitIdentifier();
|
||||||
|
}
|
||||||
|
return $this->effectiveCommit;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function buildSVNContentFuture($spec) {
|
||||||
if (!$spec) {
|
if (!$spec) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$drequest = $this->getRequest();
|
$drequest = $this->getDiffusionRequest();
|
||||||
$repository = $drequest->getRepository();
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
list($ref, $rev) = $spec;
|
list($ref, $rev) = $spec;
|
||||||
|
@ -144,4 +199,45 @@ final class DiffusionSvnDiffQuery extends DiffusionDiffQuery {
|
||||||
$rev);
|
$rev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getGitOrMercurialResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
$effective_commit = $this->getEffectiveCommit($request);
|
||||||
|
if (!$effective_commit) {
|
||||||
|
return $this->getEmptyResult(1);
|
||||||
|
}
|
||||||
|
// TODO: This side effect is kind of sketchy.
|
||||||
|
$drequest->setCommit($effective_commit);
|
||||||
|
|
||||||
|
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||||
|
$raw_diff = $raw_query->loadRawDiff();
|
||||||
|
if (!$raw_diff) {
|
||||||
|
return $this->getEmptyResult(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$parser = $this->getDefaultParser();
|
||||||
|
$changes = $parser->parseDiff($raw_diff);
|
||||||
|
|
||||||
|
return $changes;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getDefaultParser() {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
$parser = new ArcanistDiffParser();
|
||||||
|
$try_encoding = $repository->getDetail('encoding');
|
||||||
|
if ($try_encoding) {
|
||||||
|
$parser->setTryEncoding($try_encoding);
|
||||||
|
}
|
||||||
|
$parser->setDetectBinaryFiles(true);
|
||||||
|
|
||||||
|
return $parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getEmptyResult() {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group conduit
|
||||||
|
*/
|
||||||
|
final class ConduitAPI_diffusion_lastmodifiedquery_Method
|
||||||
|
extends ConduitAPI_diffusion_abstractquery_Method {
|
||||||
|
|
||||||
|
public function getMethodDescription() {
|
||||||
|
return
|
||||||
|
'Get last modified information from a repository for a specific commit '.
|
||||||
|
'at a specific path.';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function defineReturnType() {
|
||||||
|
return 'array';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineCustomParamTypes() {
|
||||||
|
return array(
|
||||||
|
'commit' => 'required string',
|
||||||
|
'path' => 'required string',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getResult(ConduitAPIRequest $request) {
|
||||||
|
list($commit, $commit_data) = parent::getResult($request);
|
||||||
|
if ($commit) {
|
||||||
|
$commit = $commit->toDictionary();
|
||||||
|
}
|
||||||
|
if ($commit_data) {
|
||||||
|
$commit_data = $commit_data->toDictionary();
|
||||||
|
}
|
||||||
|
return array(
|
||||||
|
'commit' => $commit,
|
||||||
|
'commitData' => $commit_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getGitResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
list($hash) = $repository->execxLocalCommand(
|
||||||
|
'log -n1 --format=%%H %s -- %s',
|
||||||
|
$drequest->getCommit(),
|
||||||
|
$drequest->getPath());
|
||||||
|
$hash = trim($hash);
|
||||||
|
|
||||||
|
return $this->loadDataFromHash($hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getSVNResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
$path = $drequest->getPath();
|
||||||
|
|
||||||
|
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
||||||
|
$drequest);
|
||||||
|
$history_query->setLimit(1);
|
||||||
|
$history_query->needChildChanges(true);
|
||||||
|
$history_query->needDirectChanges(true);
|
||||||
|
$history_array = $history_query->loadHistory();
|
||||||
|
|
||||||
|
if (!$history_array) {
|
||||||
|
return array(array(), array());
|
||||||
|
}
|
||||||
|
|
||||||
|
$history = reset($history_array);
|
||||||
|
|
||||||
|
return array($history->getCommit(), $history->getCommitData());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getMercurialResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
$path = $drequest->getPath();
|
||||||
|
|
||||||
|
list($hash) = $repository->execxLocalCommand(
|
||||||
|
'log --template %s --limit 1 --removed --rev %s -- %s',
|
||||||
|
'{node}',
|
||||||
|
hgsprintf('reverse(%s::%s)', '0', $drequest->getCommit()),
|
||||||
|
nonempty(ltrim($path, '/'), '.'));
|
||||||
|
|
||||||
|
return $this->loadDataFromHash($hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadDataFromHash($hash) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$repository = $drequest->getRepository();
|
||||||
|
|
||||||
|
$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
|
||||||
|
'repositoryID = %d AND commitIdentifier = %s',
|
||||||
|
$repository->getID(),
|
||||||
|
$hash);
|
||||||
|
|
||||||
|
if ($commit) {
|
||||||
|
$commit_data = $commit->loadCommitData();
|
||||||
|
} else {
|
||||||
|
$commit = array();
|
||||||
|
$commit_data = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
return array($commit, $commit_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group conduit
|
||||||
|
*/
|
||||||
|
final class ConduitAPI_diffusion_rawdiffquery_Method
|
||||||
|
extends ConduitAPI_diffusion_abstractquery_Method {
|
||||||
|
|
||||||
|
public function getMethodDescription() {
|
||||||
|
return
|
||||||
|
'Get raw diff information from a repository for a specific commit at an '.
|
||||||
|
'(optional) path.';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function defineReturnType() {
|
||||||
|
return 'string';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function defineCustomParamTypes() {
|
||||||
|
return array(
|
||||||
|
'commit' => 'required string',
|
||||||
|
'path' => 'optional string',
|
||||||
|
'timeout' => 'optional int',
|
||||||
|
'linesOfContext' => 'optional int',
|
||||||
|
'againstCommit' => 'optional string',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getResult(ConduitAPIRequest $request) {
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
$timeout = $request->getValue('timeout');
|
||||||
|
$lines_of_context = $request->getValue('linesOfContext');
|
||||||
|
$against_commit = $request->getValue('againstCommit');
|
||||||
|
|
||||||
|
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||||
|
if ($timeout !== null) {
|
||||||
|
$raw_query->setTimeout($timeout);
|
||||||
|
}
|
||||||
|
if ($lines_of_context !== null) {
|
||||||
|
$raw_query->setLinesOfContext($lines_of_context);
|
||||||
|
}
|
||||||
|
if ($against_commit !== null) {
|
||||||
|
$raw_query->setAgainstCommit($against_commit);
|
||||||
|
}
|
||||||
|
return $raw_query->loadRawDiff();
|
||||||
|
}
|
||||||
|
}
|
|
@ -927,10 +927,12 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$diff_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
$raw_diff = $this->callConduitWithDiffusionRequest(
|
||||||
$diff_query->setAgainstCommit($target_commit);
|
'diffusion.rawdiffquery',
|
||||||
try {
|
array(
|
||||||
$raw_diff = $diff_query->loadRawDiff();
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath(),
|
||||||
|
'againstCommit' => $target_commit));
|
||||||
$old_line = 0;
|
$old_line = 0;
|
||||||
$new_line = 0;
|
$new_line = 0;
|
||||||
|
|
||||||
|
@ -948,10 +950,6 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
||||||
|
|
||||||
// We didn't find the target line.
|
// We didn't find the target line.
|
||||||
return $line;
|
return $line;
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
|
||||||
return $line;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadParentRevisionOf($commit) {
|
private function loadParentRevisionOf($commit) {
|
||||||
|
|
|
@ -7,8 +7,16 @@ final class DiffusionChangeController extends DiffusionController {
|
||||||
|
|
||||||
$content = array();
|
$content = array();
|
||||||
|
|
||||||
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
|
$data = $this->callConduitWithDiffusionRequest(
|
||||||
$changeset = $diff_query->loadChangeset();
|
'diffusion.diffquery',
|
||||||
|
array(
|
||||||
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath()));
|
||||||
|
$drequest->setCommit($data['effectiveCommit']);
|
||||||
|
$raw_changes = ArcanistDiffChange::newFromConduit($data['changes']);
|
||||||
|
$diff = DifferentialDiff::newFromRawChanges($raw_changes);
|
||||||
|
$changesets = $diff->getChangesets();
|
||||||
|
$changeset = reset($changesets);
|
||||||
|
|
||||||
if (!$changeset) {
|
if (!$changeset) {
|
||||||
// TODO: Refine this.
|
// TODO: Refine this.
|
||||||
|
@ -28,7 +36,7 @@ final class DiffusionChangeController extends DiffusionController {
|
||||||
$changeset_view->setVisibleChangesets($changesets);
|
$changeset_view->setVisibleChangesets($changesets);
|
||||||
$changeset_view->setRenderingReferences(
|
$changeset_view->setRenderingReferences(
|
||||||
array(
|
array(
|
||||||
0 => $diff_query->getRenderingReference(),
|
0 => $drequest->generateURI(array('action' => 'rendering-ref'))
|
||||||
));
|
));
|
||||||
|
|
||||||
$raw_params = array(
|
$raw_params = array(
|
||||||
|
|
|
@ -943,8 +943,11 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildRawDiffResponse(DiffusionRequest $drequest) {
|
private function buildRawDiffResponse(DiffusionRequest $drequest) {
|
||||||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
$raw_diff = $this->callConduitWithDiffusionRequest(
|
||||||
$raw_diff = $raw_query->loadRawDiff();
|
'diffusion.rawdiffquery',
|
||||||
|
array(
|
||||||
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath()));
|
||||||
|
|
||||||
$file = PhabricatorFile::buildFromFileDataOrHash(
|
$file = PhabricatorFile::buildFromFileDataOrHash(
|
||||||
$raw_diff,
|
$raw_diff,
|
||||||
|
|
|
@ -42,19 +42,27 @@ final class DiffusionDiffController extends DiffusionController {
|
||||||
return id(new AphrontRedirectResponse())->setURI($uri);
|
return id(new AphrontRedirectResponse())->setURI($uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = $this->callConduitWithDiffusionRequest(
|
||||||
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
|
'diffusion.diffquery',
|
||||||
$changeset = $diff_query->loadChangeset();
|
array(
|
||||||
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath()));
|
||||||
|
$drequest->setCommit($data['effectiveCommit']);
|
||||||
|
$raw_changes = ArcanistDiffChange::newFromConduit($data['changes']);
|
||||||
|
$diff = DifferentialDiff::newFromRawChanges($raw_changes);
|
||||||
|
$changesets = $diff->getChangesets();
|
||||||
|
$changeset = reset($changesets);
|
||||||
|
|
||||||
if (!$changeset) {
|
if (!$changeset) {
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$parser = new DifferentialChangesetParser();
|
$parser = new DifferentialChangesetParser();
|
||||||
$parser->setUser($user);
|
$parser->setUser($user);
|
||||||
$parser->setChangeset($changeset);
|
$parser->setChangeset($changeset);
|
||||||
$parser->setRenderingReference($diff_query->getRenderingReference());
|
$parser->setRenderingReference($drequest->generateURI(
|
||||||
|
array(
|
||||||
|
'action' => 'rendering-ref')));
|
||||||
|
|
||||||
$pquery = new DiffusionPathIDQuery(array($changeset->getFilename()));
|
$pquery = new DiffusionPathIDQuery(array($changeset->getFilename()));
|
||||||
$ids = $pquery->loadPathIDs();
|
$ids = $pquery->loadPathIDs();
|
||||||
|
|
|
@ -5,10 +5,24 @@ final class DiffusionLastModifiedController extends DiffusionController {
|
||||||
public function processRequest() {
|
public function processRequest() {
|
||||||
$drequest = $this->getDiffusionRequest();
|
$drequest = $this->getDiffusionRequest();
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
$commit = null;
|
||||||
|
$commit_data = null;
|
||||||
|
|
||||||
$modified_query = DiffusionLastModifiedQuery::newFromDiffusionRequest(
|
$conduit_result = $this->callConduitWithDiffusionRequest(
|
||||||
$drequest);
|
'diffusion.lastmodifiedquery',
|
||||||
list($commit, $commit_data) = $modified_query->loadLastModification();
|
array(
|
||||||
|
'commit' => $drequest->getCommit(),
|
||||||
|
'path' => $drequest->getPath()
|
||||||
|
));
|
||||||
|
$c_dict = $conduit_result['commit'];
|
||||||
|
if ($c_dict) {
|
||||||
|
$commit = PhabricatorRepositoryCommit::newFromDictionary($c_dict);
|
||||||
|
}
|
||||||
|
$c_d_dict = $conduit_result['commitData'];
|
||||||
|
if ($c_d_dict) {
|
||||||
|
$commit_data =
|
||||||
|
PhabricatorRepositoryCommitData::newFromDictionary($c_d_dict);
|
||||||
|
}
|
||||||
|
|
||||||
$phids = array();
|
$phids = array();
|
||||||
if ($commit_data) {
|
if ($commit_data) {
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
abstract class DiffusionDiffQuery extends DiffusionQuery {
|
|
||||||
|
|
||||||
protected $renderingReference;
|
|
||||||
|
|
||||||
final public static function newFromDiffusionRequest(
|
|
||||||
DiffusionRequest $request) {
|
|
||||||
return parent::newQueryObject(__CLASS__, $request);
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function getRenderingReference() {
|
|
||||||
return $this->renderingReference;
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function loadChangeset() {
|
|
||||||
return $this->executeQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getEffectiveCommit() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
|
|
||||||
$modified_query = DiffusionLastModifiedQuery::newFromDiffusionRequest(
|
|
||||||
$drequest);
|
|
||||||
list($commit) = $modified_query->loadLastModification();
|
|
||||||
if (!$commit) {
|
|
||||||
// TODO: Improve error messages here.
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return $commit->getCommitIdentifier();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DiffusionGitDiffQuery extends DiffusionDiffQuery {
|
|
||||||
|
|
||||||
protected function executeQuery() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
$repository = $drequest->getRepository();
|
|
||||||
|
|
||||||
$effective_commit = $this->getEffectiveCommit();
|
|
||||||
if (!$effective_commit) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// TODO: This side effect is kind of sketchy.
|
|
||||||
$drequest->setCommit($effective_commit);
|
|
||||||
|
|
||||||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
|
||||||
$raw_diff = $raw_query->loadRawDiff();
|
|
||||||
|
|
||||||
if (!$raw_diff) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser = new ArcanistDiffParser();
|
|
||||||
|
|
||||||
$try_encoding = $repository->getDetail('encoding');
|
|
||||||
if ($try_encoding) {
|
|
||||||
$parser->setTryEncoding($try_encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser->setDetectBinaryFiles(true);
|
|
||||||
$changes = $parser->parseDiff($raw_diff);
|
|
||||||
|
|
||||||
$diff = DifferentialDiff::newFromRawChanges($changes);
|
|
||||||
$changesets = $diff->getChangesets();
|
|
||||||
$changeset = reset($changesets);
|
|
||||||
|
|
||||||
$this->renderingReference = $drequest->generateURI(
|
|
||||||
array(
|
|
||||||
'action' => 'rendering-ref',
|
|
||||||
));
|
|
||||||
|
|
||||||
return $changeset;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DiffusionMercurialDiffQuery extends DiffusionDiffQuery {
|
|
||||||
|
|
||||||
protected function executeQuery() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
$repository = $drequest->getRepository();
|
|
||||||
|
|
||||||
$effective_commit = $this->getEffectiveCommit();
|
|
||||||
if (!$effective_commit) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// TODO: This side effect is kind of skethcy.
|
|
||||||
$drequest->setCommit($effective_commit);
|
|
||||||
|
|
||||||
$query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
|
||||||
$raw_diff = $query->loadRawDiff();
|
|
||||||
|
|
||||||
$parser = new ArcanistDiffParser();
|
|
||||||
|
|
||||||
$try_encoding = $repository->getDetail('encoding');
|
|
||||||
if ($try_encoding) {
|
|
||||||
$parser->setTryEncoding($try_encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
$parser->setDetectBinaryFiles(true);
|
|
||||||
$changes = $parser->parseDiff($raw_diff);
|
|
||||||
|
|
||||||
$diff = DifferentialDiff::newFromRawChanges($changes);
|
|
||||||
$changesets = $diff->getChangesets();
|
|
||||||
$changeset = reset($changesets);
|
|
||||||
|
|
||||||
$this->renderingReference = $drequest->generateURI(
|
|
||||||
array(
|
|
||||||
'action' => 'rendering-ref',
|
|
||||||
));
|
|
||||||
|
|
||||||
return $changeset;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DiffusionGitLastModifiedQuery extends DiffusionLastModifiedQuery {
|
|
||||||
|
|
||||||
protected function executeQuery() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
$repository = $drequest->getRepository();
|
|
||||||
|
|
||||||
list($hash) = $repository->execxLocalCommand(
|
|
||||||
'log -n1 --format=%%H %s -- %s',
|
|
||||||
$drequest->getCommit(),
|
|
||||||
$drequest->getPath());
|
|
||||||
$hash = trim($hash);
|
|
||||||
|
|
||||||
$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
|
|
||||||
'repositoryID = %d AND commitIdentifier = %s',
|
|
||||||
$repository->getID(),
|
|
||||||
$hash);
|
|
||||||
|
|
||||||
if ($commit) {
|
|
||||||
$commit_data = $commit->loadCommitData();
|
|
||||||
} else {
|
|
||||||
$commit_data = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array($commit, $commit_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
abstract class DiffusionLastModifiedQuery extends DiffusionQuery {
|
|
||||||
|
|
||||||
final public static function newFromDiffusionRequest(
|
|
||||||
DiffusionRequest $request) {
|
|
||||||
return parent::newQueryObject(__CLASS__, $request);
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function loadLastModification() {
|
|
||||||
return $this->executeQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DiffusionMercurialLastModifiedQuery
|
|
||||||
extends DiffusionLastModifiedQuery {
|
|
||||||
|
|
||||||
protected function executeQuery() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
$repository = $drequest->getRepository();
|
|
||||||
|
|
||||||
$path = $drequest->getPath();
|
|
||||||
|
|
||||||
list($hash) = $repository->execxLocalCommand(
|
|
||||||
'log --template %s --limit 1 --removed --rev %s -- %s',
|
|
||||||
'{node}',
|
|
||||||
hgsprintf('reverse(%s::%s)', '0', $drequest->getCommit()),
|
|
||||||
nonempty(ltrim($path, '/'), '.'));
|
|
||||||
|
|
||||||
$commit = id(new PhabricatorRepositoryCommit())->loadOneWhere(
|
|
||||||
'repositoryID = %d AND commitIdentifier = %s',
|
|
||||||
$repository->getID(),
|
|
||||||
$hash);
|
|
||||||
|
|
||||||
if ($commit) {
|
|
||||||
$commit_data = $commit->loadCommitData();
|
|
||||||
} else {
|
|
||||||
$commit_data = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array($commit, $commit_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DiffusionSvnLastModifiedQuery extends DiffusionLastModifiedQuery {
|
|
||||||
|
|
||||||
protected function executeQuery() {
|
|
||||||
$drequest = $this->getRequest();
|
|
||||||
$repository = $drequest->getRepository();
|
|
||||||
|
|
||||||
$path = $drequest->getPath();
|
|
||||||
|
|
||||||
$history_query = DiffusionHistoryQuery::newFromDiffusionRequest(
|
|
||||||
$drequest);
|
|
||||||
$history_query->setLimit(1);
|
|
||||||
$history_query->needChildChanges(true);
|
|
||||||
$history_query->needDirectChanges(true);
|
|
||||||
$history_array = $history_query->loadHistory();
|
|
||||||
|
|
||||||
if (!$history_array) {
|
|
||||||
return array(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
$history = reset($history_array);
|
|
||||||
|
|
||||||
return array($history->getCommit(), $history->getCommitData());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -110,10 +110,14 @@ final class HeraldCommitAdapter extends HeraldObjectAdapter {
|
||||||
'commit' => $this->commit->getCommitIdentifier(),
|
'commit' => $this->commit->getCommitIdentifier(),
|
||||||
));
|
));
|
||||||
|
|
||||||
$raw = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest)
|
$raw = DiffusionQuery::callConduitWithDiffusionRequest(
|
||||||
->setTimeout(60 * 60 * 15)
|
$drequest,
|
||||||
->setLinesOfContext(0)
|
PhabricatorUser::getOmnipotentUser(),
|
||||||
->loadRawDiff();
|
'diffusion.rawdiffquery',
|
||||||
|
array(
|
||||||
|
'commit' => $this->commit->getCommitIdentifier(),
|
||||||
|
'timeout' => 60 * 60 * 15,
|
||||||
|
'linesOfContext' => 0));
|
||||||
|
|
||||||
$parser = new ArcanistDiffParser();
|
$parser = new ArcanistDiffParser();
|
||||||
$changes = $parser->parseDiff($raw);
|
$changes = $parser->parseDiff($raw);
|
||||||
|
|
Loading…
Reference in a new issue