Use the latest transaction modification time fore the hash

This commit is contained in:
2023-01-27 16:13:16 +01:00
parent 8eaab28e2e
commit 21d145c9dd
2 changed files with 12 additions and 2 deletions

View File

@@ -240,7 +240,7 @@ function GetRevisionHash($revision) {
$xaction = id(new DifferentialTransactionQuery()) $xaction = id(new DifferentialTransactionQuery())
->setViewer($viewer) ->setViewer($viewer)
->withObjectPHIDs(array($revision->getPHID())) ->withObjectPHIDs(array($revision->getPHID()))
->setOrder('newest') ->setOrder('updated')
->setLimit(1) ->setLimit(1)
->executeOne(); ->executeOne();
@@ -405,7 +405,7 @@ function GetTaskHash($task) {
$xaction = id(new ManiphestTransactionQuery()) $xaction = id(new ManiphestTransactionQuery())
->setViewer($viewer) ->setViewer($viewer)
->withObjectPHIDs(array($task->getPHID())) ->withObjectPHIDs(array($task->getPHID()))
->setOrder('newest') ->setOrder('updated')
->setLimit(1) ->setLimit(1)
->executeOne(); ->executeOne();

View File

@@ -304,6 +304,7 @@ abstract class PhabricatorApplicationTransactionQuery
protected function newPagingMapFromPartialObject($object) { protected function newPagingMapFromPartialObject($object) {
return parent::newPagingMapFromPartialObject($object) + array( return parent::newPagingMapFromPartialObject($object) + array(
'created' => $object->getDateCreated(), 'created' => $object->getDateCreated(),
'updated' => $object->getDateModified(),
'phid' => $object->getPHID(), 'phid' => $object->getPHID(),
); );
} }
@@ -314,6 +315,10 @@ abstract class PhabricatorApplicationTransactionQuery
'vector' => array('created', 'phid'), 'vector' => array('created', 'phid'),
'name' => pht('Global'), 'name' => pht('Global'),
), ),
'updated' => array(
'vector' => array('updated', 'id'),
'name' => pht('Date Updated (Latest First)'),
),
); );
} }
@@ -324,6 +329,11 @@ abstract class PhabricatorApplicationTransactionQuery
'column' => 'dateCreated', 'column' => 'dateCreated',
'type' => 'int', 'type' => 'int',
), ),
'updated' => array(
'table' => 'x',
'column' => 'dateModified',
'type' => 'int',
),
'phid' => array( 'phid' => array(
'table' => 'x', 'table' => 'x',
'column' => 'phid', 'column' => 'phid',