Make it easier for tools to function outside a source checkout.

Review Request #10458 — Created March 20, 2019 and submitted

Information

RBTools
master

Reviewers

RBTools is pretty heavily dependent on a source checkout for most
operations. For some tools, this is a problem, as they have very little
need for the checkout (at least in certain modes) but not having a
checkout means overriding a lot of logic. rbt patch --print, for
instance, tries to work without a source tree, but the recent DVCS work
broke this due to how fragile and unclear the workarounds were.

This change adds support in initialize_scm_tool() and
scan_usable_client() for specifying that a working checkout is
optional. These will still attempt to find a repository checkout, but
will return None if one can't be found, rather than erroring out.

rbt patch --print has been fixed up to use this, in order to restore
the ability to work outside a source tree.

Tested that rbt patch --print was usable outside a source tree,
but that a source tree was still required and checked when not
using --print.

Unit tests pass.

Summary ID
Make it easier for tools to function outside a source checkout.
RBTools is pretty heavily dependent on a source checkout for most operations. For some tools, this is a problem, as they have very little need for the checkout (at least in certain modes) but not having a checkout means overriding a lot of logic. `rbt patch --print`, for instance, tries to work without a source tree, but the recent DVCS work broke this due to how fragile and unclear the workarounds were. This change adds support in `initialize_scm_tool()` and `scan_usable_client()` for specifying that a working checkout is optional. These will still attempt to find a repository checkout, but will return ``None`` if one can't be found, rather than erroring out. `rbt patch --print` has been fixed up to use this, in order to restore the ability to work outside a source tree.
d99efe9cfacbc35072de9469ebe93d0288c1a6ad
Description From Last Updated

Bug 4628

daviddavid

F821 undefined name '_'

reviewbotreviewbot

F821 undefined name '_'

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. 
      
  2. Show all issues

    Bug 4628

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (2e95133)