Page MenuHomePhabricator

Create dependency for revisions automatically
Closed, DuplicatePublic


When doing a arc diff it should automatically check if there are any open dependencies.

arc feature myNewFeature notYetMergedFeature
This should create a feature based on another feature.
arc diff

Should automatically detect that notYetMergedFeature is not yet closed and add this revision as dependency of the new revision.

Event Timeline

sascha-egerer raised the priority of this task from to Needs Triage.
sascha-egerer updated the task description. (Show Details)
sascha-egerer added a project: Arcanist.
sascha-egerer added a subscriber: sascha-egerer.

[1:25pm] epriestley: I think we can actually do it entirely on the server side.
[1:25pm] epriestley: Since the client already uploads all the local commits, including the parent hashes.
[1:25pm] epriestley: When we update a revision with a new diff, we just look at the parent hash of the first local commit in that new diff, and check for an existing open revision with that commit hash on its active diff.
[1:25pm] epriestley: If we find one, we add a dependency.
[1:27pm] epriestley: That can probably happen in DifferentialTransactionEditor->expandTransaction(), near line 365.
[1:27pm] epriestley: i.e., adjacent to the existing similar check which examines the branch that the new diff was on, and adds a Maniphest dependency if the branch name is like "Txxx".
[1:28pm] epriestley: You can use DifferentialRevisionQuery->withCommitHashes(...) to actually search for the hash, so the only messy part is digging into the diff to get the parent hash of the oldest commit which composes it.
[1:29pm] epriestley: I'd guess it's ~20-ish lines of code.