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)
Sat, Nov 16, 8:59 PM
Unknown Object (File)
Tue, Nov 12, 6:41 AM
Unknown Object (File)
Tue, Nov 5, 10:31 PM
Unknown Object (File)
Fri, Nov 1, 2:52 PM
Unknown Object (File)
Thu, Oct 31, 6:30 AM
Unknown Object (File)
Tue, Oct 29, 2:48 PM
Unknown Object (File)
Thu, Oct 24, 6:43 PM
Unknown Object (File)
Wed, Oct 23, 12:12 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable