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
F15669583: D19689.diff
Mon, May 26, 2:58 AM
Unknown Object (File)
Wed, May 7, 11:04 PM
Unknown Object (File)
Wed, May 7, 9:08 AM
Unknown Object (File)
Sun, Apr 27, 5:20 PM
Unknown Object (File)
Sun, Apr 27, 5:20 PM
Unknown Object (File)
Apr 22 2025, 9:53 AM
Unknown Object (File)
Apr 17 2025, 2:35 PM
Unknown Object (File)
Apr 3 2025, 11:32 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. ๐Ÿฆ‚