]> arthur.barton.de Git - bup.git/commit
repo: avoid cyclic dependency with is_remote method
authorRob Browning <rlb@defaultvalue.org>
Sat, 31 Mar 2018 20:32:52 +0000 (15:32 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 13 Jan 2019 18:09:13 +0000 (12:09 -0600)
commit1c456b804743da1ae3caa62937c6984d1af450b4
tree5369ab5f2efe3fe673332bd0d1ce6ac88820bb70
parentf4a5f22d0e362800740520ce484e40358b0a28cb
repo: avoid cyclic dependency with is_remote method

The current VFS operations (like resolve()) require a repo object, but
we're about to add a VFS resolve() method to the repos.  In and of
itself, that isn't necessarily a problem, but as an optimization, we
want the VFS resolve() to be able to detect when the repo it's been
given is a RemoteRepo and redirect the call to remote_repo.resolve().

Doing so pushes the one single resolve() call to the remote instead of
executing the resolve() locally with a lot of individual calls to the
remote_repo's other methods.

Adding is_remote() makes that possible without having to 'import repo'
in the VFS (repo already imports vfs).

Perhaps we'll rework it later, but this will do for now.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/repo.py