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

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

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.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
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.
242bcf41ea614d491f7a4007caf34bafcf034d2b Christian Hammond
rbtools/clients/__init__.py
rbtools/commands/__init__.py
rbtools/commands/patch.py
Loading...