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, Jan 25, 9:36 AM
Unknown Object (File)
Fri, Jan 24, 9:19 PM
Unknown Object (File)
Tue, Jan 21, 4:02 PM
Unknown Object (File)
Tue, Jan 21, 11:14 AM
Unknown Object (File)
Sat, Jan 18, 12:29 AM
Unknown Object (File)
Dec 21 2024, 4:30 PM
Unknown Object (File)
Dec 19 2024, 4:38 PM
Unknown Object (File)
Dec 12 2024, 10:40 PM
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

Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 20855
Build 28367: Run Core Tests

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. ๐Ÿฆ‚