HomePhabricator

When creating or updating a revision, infer the repository from the diff

Description

When creating or updating a revision, infer the repository from the diff

Summary:
Ref T603. When a diff is attached to a revision, try to guess the repository if possible. In cases where we succeed, this automatically gives us intuitive policy behavior (i.e., you can see a revision if you can see the repository the change is against).

I pulled this into a funky little "Lookup" class for two reasons:

  • It's used in two places;
  • I anticipate that we might need to add some sort of explainWhy() method if users find the heuristics confusing.

Test Plan: Created and updated revisions, saw them pick up the correct repository association. Ran Herald dry run against associable and nonassociable revisions, saw correct values populate.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

Details

Provenance
epriestleyAuthored on Sep 26 2013, 10:28 PM
Reviewer
btrahan
Differential Revision
Restricted Differential Revision
Parents
rPfb4c9b63453c: Maniphest + Herald - add support for assigning tasks and adding projects
Branches
Unknown
Tags
Unknown
Tasks
T603: Support permissions/policies in all Phabricator applications

Event Timeline