Page MenuHomePhabricator

[Wilds] Rewrite WorkingCopyIdentity in a more modern/modular way
ClosedPublic

Authored by epriestley on Sep 18 2018, 7:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 6:33 AM
Unknown Object (File)
Fri, Nov 15, 10:46 AM
Unknown Object (File)
Sun, Nov 10, 11:20 PM
Unknown Object (File)
Thu, Nov 7, 12:30 PM
Unknown Object (File)
Oct 17 2024, 10:54 AM
Unknown Object (File)
Oct 16 2024, 9:13 PM
Unknown Object (File)
Oct 9 2024, 10:09 AM
Unknown Object (File)
Oct 2 2024, 4:13 AM
Subscribers
None

Details

Summary

Ref T13098. Currently, WorkingCopyIdentity has rules for finding .git/.svn/.hg directories and .arcconfig files. It also has a ton of logic for reading and writing config files.

Generally:

  • Rename WorkingCopyIdentity to WorkingCopy.
  • Make it an abstract base with Git, Mercurial and Subversion subclasses, using the standard module/extension pattern.
  • Throw out almost all of the config file logic. This logic is going to move into Config classes. It is not unique to working copies.
    • Working copies retain the actual bit of this they need: knowing where stuff should go on disk.

This doesn't run yet, but sure looks a lot cleaner!

Test Plan

Doesn't run yet, since Config isn't working yet.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.

One thing I'm dropping here that I don't explicitly plan to restore is all the logging. I may or may not put that back, depending on how things go and what feedback we see. I think I added it to make my job debugging some theoretical future issue easier, but that issue never materialized.

amckinley added inline comments.
src/workingcopy/ArcanistGitWorkingCopy.php
14

pathExits

(Can't believe I spotted that with a drive-by review).

src/workingcopy/ArcanistMercurialWorkingCopy.php
14

pathExits again! Someone should butter me while I'm on this roll.

src/workingcopy/ArcanistSubversionWorkingCopy.php
42

๐Ÿ‘€

This revision is now accepted and ready to land.Sep 20 2018, 12:00 AM
This revision was automatically updated to reflect the committed changes.

Nice catches! I managed to catch those later but not before the code actually hit them and died. ๐Ÿฆ‚