mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Bandage an issue with the file tree view for unusual versus diffs
Summary: See comment inline. We should fix this properly but it goes faily deep so I just stopped the bleeding for now. It's OK if we end up with a silly-looking file tree view for bizarre edge cases. Test Plan: Created a problem diff as described, verified it no longer threw. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran, Avish Maniphest Tasks: T1702 Differential Revision: https://secure.phabricator.com/D3373
This commit is contained in:
parent
ad409126b1
commit
cdda9ea668
1 changed files with 25 additions and 1 deletions
|
@ -1021,7 +1021,31 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
|
||||
$tree = new PhutilFileTree();
|
||||
foreach ($changesets as $changeset) {
|
||||
$tree->addPath($changeset->getFilename(), $changeset);
|
||||
try {
|
||||
$tree->addPath($changeset->getFilename(), $changeset);
|
||||
} catch (Exception $ex) {
|
||||
// TODO: See T1702. When viewing the versus diff of diffs, we may
|
||||
// have files with the same filename. For example, if you have a setup
|
||||
// like this in SVN:
|
||||
//
|
||||
// a/
|
||||
// README
|
||||
// b/
|
||||
// README
|
||||
//
|
||||
// ...and you run "arc diff" once from a/, and again from b/, you'll
|
||||
// get two diffs with path README. However, in the versus diff view we
|
||||
// will compute their absolute repository paths and detect that they
|
||||
// aren't really the same file. This is correct, but causes us to
|
||||
// throw when inserting them.
|
||||
//
|
||||
// We should probably compute the smallest unique path for each file
|
||||
// and show these as "a/README" and "b/README" when diffed against
|
||||
// one another. However, we get this wrong in a lot of places (the
|
||||
// other TOC shows two "README" files, and we generate the same anchor
|
||||
// hash for both) so I'm just stopping the bleeding until we can get
|
||||
// a proper fix in place.
|
||||
}
|
||||
}
|
||||
|
||||
require_celerity_resource('phabricator-filetree-view-css');
|
||||
|
|
Loading…
Reference in a new issue