diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index c95a4361e1..321c1ff7af 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -2061,7 +2061,10 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $clone[] = $uri; } - return msort($clone, 'getURIScore'); + $clone = msort($clone, 'getURIScore'); + $clone = array_reverse($clone); + + return $clone; } diff --git a/src/applications/repository/storage/PhabricatorRepositoryURI.php b/src/applications/repository/storage/PhabricatorRepositoryURI.php index f0326f12a9..d9dcea0a2d 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryURI.php +++ b/src/applications/repository/storage/PhabricatorRepositoryURI.php @@ -598,18 +598,25 @@ final class PhabricatorRepositoryURI $score = 0; $io_points = array( - self::IO_READWRITE => 20, - self::IO_READ => 10, + self::IO_READWRITE => 200, + self::IO_READ => 100, ); $score += idx($io_points, $this->getEffectiveIoType(), 0); $protocol_points = array( - self::BUILTIN_PROTOCOL_SSH => 3, - self::BUILTIN_PROTOCOL_HTTPS => 2, - self::BUILTIN_PROTOCOL_HTTP => 1, + self::BUILTIN_PROTOCOL_SSH => 30, + self::BUILTIN_PROTOCOL_HTTPS => 20, + self::BUILTIN_PROTOCOL_HTTP => 10, ); $score += idx($protocol_points, $this->getBuiltinProtocol(), 0); + $identifier_points = array( + self::BUILTIN_IDENTIFIER_SHORTNAME => 3, + self::BUILTIN_IDENTIFIER_CALLSIGN => 2, + self::BUILTIN_IDENTIFIER_ID => 1, + ); + $score += idx($identifier_points, $this->getBuiltinIdentifier(), 0); + return $score; }