Page MenuHomePhabricator

Make "no working copy" a more explicit "arc" VCS
ClosedPublic

Authored by epriestley on Feb 3 2015, 1:26 PM.
Tags
None
Referenced Files
F14090060: D11643.diff
Sun, Nov 24, 3:25 PM
F14089810: D11643.diff
Sun, Nov 24, 1:34 PM
Unknown Object (File)
Sun, Nov 17, 5:30 PM
Unknown Object (File)
Thu, Nov 14, 10:56 AM
Unknown Object (File)
Sun, Nov 10, 2:35 AM
Unknown Object (File)
Wed, Nov 6, 3:56 AM
Unknown Object (File)
Oct 24 2024, 9:45 PM
Unknown Object (File)
Oct 19 2024, 12:11 PM
Subscribers

Details

Summary

Some commands (like get-config) do not require a working copy at all. Recent changes prevented these commands from running outside a VCS working copy.

Let null mean "no working copy".

See also https://github.com/phacility/phabricator/issues/800.

Test Plan
  • Ran arc get-config from outside a working copy.
  • Ran arc list from outside a working copy, got an error.
  • Ran arc commit in a Git working copy, got an error.

Diff Detail

Repository
rARC Arcanist
Branch
nowc
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4278
Build 4291: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Make "no working copy" a more explicit "arc" VCS.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: joshuaspence.
src/workflow/ArcanistWorkflow.php
1219

Doesn't this duplicate the requiresWorkingCopy() method?

  • Use requiresWorkingCopy() instead of magical null.
scripts/arcanist.php
207

What's the reason for if ($vcs_type)?

scripts/arcanist.php
207

If a command returns false from requiresWorkingCopy(), but array('git') from getSupportedRevisionControlSystems(), I interpret that to mean that the command can be run either in a Git working copy, or in a directory which is not a VCS working copy.

If you run it in a Mercurial working copy, the $vcs_type check allows us to raise an error, which I think is correct.

This is somewhat academic because we have no commands like this AFAIK, although it doesn't seem so ridiculous that it defies imagination that we might ever have such commands.

scripts/arcanist.php
207

Right, but when would $vcs_type be falsey?

$vcs_type is falsey if you run outside of a working copy, like cd /tmp; arc get-config. That's the root issue here: doing that is currently broken.

joshuaspence edited edge metadata.

Ah okay sure... nevermind me, it's still early here *yawn*

This revision is now accepted and ready to land.Feb 3 2015, 8:31 PM

Haha, no problem. It's also confusing that $working_copy really means $working_directory_which_may_also_be_a_repository_working_copy. This is also an unusual use case for regular users of arc.

This revision was automatically updated to reflect the committed changes.