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>
(e.g. refs, tags, etc.)."""
return self._id
+ def is_remote(self):
+ return False
+
def cat(self, ref):
"""If ref does not exist, yield (None, None, None). Otherwise yield
(oidx, type, size), and then all of the data associated with
(e.g. refs, tags, etc.)."""
return self._id
+ def is_remote(self):
+ return True
+
def cat(self, ref):
"""If ref does not exist, yield (None, None, None). Otherwise yield
(oidx, type, size), and then all of the data associated with