@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add yet more unit tests for Subversion

Summary: Ref T4327. This adds a subpath/partial repository where we import only a subdirectory, and adds tests for it.

Test Plan: Ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4327

Differential Revision: https://secure.phabricator.com/D8019

+108 -1
src/applications/repository/engine/__tests__/data/CHD.svn.tgz

This is a binary file and will not be displayed.

+108 -1
src/applications/repository/worker/__tests__/PhabricatorChangeParserTestCase.php
··· 952 952 )); 953 953 } 954 954 955 + public function testSubversionPartialParser() { 956 + $repository = $this->buildBareRepository('CHD'); 957 + $repository->setDetail('svn-subpath', 'trunk/'); 958 + 959 + id(new PhabricatorRepositoryPullEngine()) 960 + ->setRepository($repository) 961 + ->pullRepository(); 962 + 963 + id(new PhabricatorRepositoryDiscoveryEngine()) 964 + ->setRepository($repository) 965 + ->discoverCommits($repository); 966 + 967 + $viewer = PhabricatorUser::getOmnipotentUser(); 968 + 969 + $commits = id(new DiffusionCommitQuery()) 970 + ->setViewer($viewer) 971 + ->withRepositoryIDs(array($repository->getID())) 972 + ->execute(); 973 + 974 + $this->expectChanges( 975 + $repository, 976 + $commits, 977 + array( 978 + // Copy of a file outside of the subpath from an earlier revision 979 + // into the subpath. 980 + 4 => array( 981 + array( 982 + '/', 983 + null, 984 + null, 985 + DifferentialChangeType::TYPE_CHILD, 986 + DifferentialChangeType::FILE_DIRECTORY, 987 + 0, 988 + 4, 989 + ), 990 + array( 991 + '/goat', 992 + null, 993 + null, 994 + DifferentialChangeType::TYPE_COPY_AWAY, 995 + DifferentialChangeType::FILE_NORMAL, 996 + 0, 997 + 4, 998 + ), 999 + array( 1000 + '/trunk', 1001 + null, 1002 + null, 1003 + DifferentialChangeType::TYPE_CHILD, 1004 + DifferentialChangeType::FILE_DIRECTORY, 1005 + 0, 1006 + 4, 1007 + ), 1008 + array( 1009 + '/trunk/goat', 1010 + '/goat', 1011 + '1', 1012 + DifferentialChangeType::TYPE_COPY_HERE, 1013 + DifferentialChangeType::FILE_NORMAL, 1014 + 1, 1015 + 4, 1016 + ), 1017 + ), 1018 + 3 => array( 1019 + array( 1020 + '/', 1021 + null, 1022 + null, 1023 + DifferentialChangeType::TYPE_CHILD, 1024 + DifferentialChangeType::FILE_DIRECTORY, 1025 + 0, 1026 + 3, 1027 + ), 1028 + array( 1029 + '/trunk', 1030 + null, 1031 + null, 1032 + DifferentialChangeType::TYPE_ADD, 1033 + DifferentialChangeType::FILE_DIRECTORY, 1034 + 1, 1035 + 3, 1036 + ), 1037 + array( 1038 + '/trunk/apple', 1039 + null, 1040 + null, 1041 + DifferentialChangeType::TYPE_ADD, 1042 + DifferentialChangeType::FILE_NORMAL, 1043 + 1, 1044 + 3, 1045 + ), 1046 + array( 1047 + '/trunk/banana', 1048 + null, 1049 + null, 1050 + DifferentialChangeType::TYPE_ADD, 1051 + DifferentialChangeType::FILE_NORMAL, 1052 + 1, 1053 + 3, 1054 + ), 1055 + ), 1056 + )); 1057 + } 1058 + 955 1059 private function expectChanges( 956 1060 PhabricatorRepository $repository, 957 1061 array $commits, ··· 1023 1127 ksort($dicts); 1024 1128 ksort($expect_changes); 1025 1129 1026 - $this->assertEqual($expect_changes, $dicts); 1130 + $this->assertEqual( 1131 + $expect_changes, 1132 + $dicts, 1133 + pht('Commit %s', $commit_identifier)); 1027 1134 } 1028 1135 } 1029 1136