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)
Sat, Dec 21, 4:30 PM
Unknown Object (File)
Thu, Dec 19, 4:38 PM
Unknown Object (File)
Thu, Dec 12, 10:40 PM
Unknown Object (File)
Mon, Dec 9, 2:21 PM
Unknown Object (File)
Sun, Dec 8, 8:22 PM
Unknown Object (File)
Sat, Dec 7, 7:08 AM
Unknown Object (File)
Thu, Dec 5, 9:25 AM
Unknown Object (File)
Wed, Dec 4, 8:40 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. ๐Ÿฆ‚