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
F19776315: D21070.diff
Sun, Feb 22, 2:43 PM
F19662117: D21070.id50195.diff
Sat, Feb 7, 8:10 AM
F19579563: D21070.diff
Feb 1 2026, 3:26 PM
F19554901: D21070.diff
Jan 30 2026, 4:55 AM
F19554888: D21070.diff
Jan 30 2026, 4:46 AM
F19554883: D21070.diff
Jan 30 2026, 4:44 AM
F19151172: D21070.diff
Dec 10 2025, 10:06 PM
F19106487: D21070.diff
Dec 7 2025, 6:40 AM
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