Page MenuHomePhabricator

Update the "WorkingCopy" API and create a fallback "Filesystem" working copy
ClosedPublic

Authored by epriestley on Apr 8 2020, 3:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 3:28 AM
Unknown Object (File)
Sat, Apr 20, 5:10 PM
Unknown Object (File)
Thu, Apr 11, 10:47 AM
Unknown Object (File)
Mar 30 2024, 9:11 AM
Unknown Object (File)
Mar 24 2024, 10:53 AM
Unknown Object (File)
Feb 19 2024, 12:51 PM
Unknown Object (File)
Feb 3 2024, 11:56 PM
Unknown Object (File)
Jan 11 2024, 12:05 PM
Subscribers
None

Details

Summary

Ref T11968.

  • Allow "WorkingCopy" objects to maintain an API object and update callers ("get...()" instead of "new...()").
  • Always generate a WorkingCopy object and a RepositoryAPI object.

Currently, code has to look like this:

$working_copy = ...
if ($working_copy) {
  $repository_api = ...
  if ($repository_api [instanceof ... ]) {

This is clunky. There's also no reason some "arc" commands can't run outside a VCS working directory without special-casing how they interact with the filesystem.

Conceptually, model the filesystem as a trivial VCS (which stores exactly one commit, always amends onto it, and discards history). Provide a trivial WorkingCopy and API for it.

(This change isn't terribly interesting on its own, but chips away at landing the new Hardpoint infrastructure.)

Test Plan

Ran arc version, arc upgrade.

Diff Detail

Repository
rARC Arcanist
Branch
ref1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24013
Build 33050: Run Core Tests
Build 33049: arc lint + arc unit