Homec4science

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

Authored by epriestley <git@epriestley.com> on Sep 27 2013, 00:28.

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

Committed
epriestley <git@epriestley.com>Sep 27 2013, 00:28
Pushed
aubortJan 31 2017, 17:16
Parents
rPHfb4c9b63453c: Maniphest + Herald - add support for assigning tasks and adding projects
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH874a9b7fe3f8: When creating or updating a revision, infer the repository from the diff (authored by epriestley <git@epriestley.com>).Sep 27 2013, 00:28