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
F13061776: D19689.diff
Fri, Apr 19, 7:58 PM
Unknown Object (File)
Wed, Apr 17, 2:51 PM
Unknown Object (File)
Tue, Apr 2, 8:45 AM
Unknown Object (File)
Sun, Mar 31, 11:47 AM
Unknown Object (File)
Sat, Mar 30, 8:21 PM
Unknown Object (File)
Sat, Mar 30, 6:45 AM
Unknown Object (File)
Sat, Mar 30, 6:45 AM
Unknown Object (File)
Sat, Mar 30, 6:45 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. ๐Ÿฆ‚