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
Unknown Object (File)
Thu, Apr 11, 8:01 AM
Unknown Object (File)
Tue, Apr 2, 9:04 AM
Unknown Object (File)
Sat, Mar 30, 4:07 PM
Unknown Object (File)
Mar 6 2024, 5:13 PM
Unknown Object (File)
Feb 18 2024, 9:51 AM
Unknown Object (File)
Feb 15 2024, 7:25 AM
Unknown Object (File)
Feb 12 2024, 3:20 PM
Unknown Object (File)
Feb 5 2024, 6:18 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #28022)

Doesn't this duplicate the requiresWorkingCopy() method?

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

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

scripts/arcanist.php
209

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
209

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.