Prepare for --source-url.
Signed-off-by: Rob Browning <
r...@defaultvalue.org>
Tested-by: Rob Browning <
r...@defaultvalue.org>
---
lib/bup/cmd/get.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/bup/cmd/get.py b/lib/bup/cmd/get.py
index 2f2fb961..d23e35b8 100644
--- a/lib/bup/cmd/get.py
+++ b/lib/bup/cmd/get.py
@@ -9,9 +9,9 @@ from typing import NoReturn, Optional, Union
from uuid import uuid4
import os, re, sys, textwrap, time
-from bup import client, compat, git, hashsplit, vfs
+from bup import client, compat, git, hashsplit, url, vfs
from bup.commit import commit_message
-from bup.compat import argv_bytes, dataclass, get_argvb
+from bup.compat import dataclass, get_argvb
from bup.git import MissingObject, get_cat_data, parse_commit, walk_object
from bup.helpers import \
(EXIT_FAILURE,
@@ -160,6 +160,7 @@ def parse_args(args):
opt.bwlimit = None
opt.compress = None
opt.source = opt.remote = None
+ opt.source_loc = url.for_path(b'')
opt.target_specs = []
# Since we don't want to create a Rewriter until we've finished
@@ -249,6 +250,7 @@ def parse_args(args):
pending_method_context = {}
elif arg in (b'-s', b'--source'):
(opt.source,), remaining = require_n_args_or_die(1, remaining)
+ opt.source_loc = url.for_path(opt.source)
elif arg in (b'-r', b'--remote'):
(opt.remote,), remaining = require_n_args_or_die(1, remaining)
elif arg in (b'-c', b'--print-commits'):
@@ -845,7 +847,7 @@ def log_item(name, type, opt, tree=None, commit=None, tag=None):
def get_everything(opt):
repair_count = 0
- with LocalRepo(repo_dir=opt.source) as src_repo, \
+ with repo.for_url(opt.source_loc) as src_repo, \
repo.for_location(opt.dst_loc, compression_level=opt.compress) as dest_repo:
src_split_cfg = hashsplit.configuration(src_repo.config_get)
@@ -955,8 +957,6 @@ def get_everything(opt):
def main(argv):
opt = parse_args(argv)
git.check_repo_or_die()
- if opt.source:
- opt.source = argv_bytes(opt.source)
if opt.bwlimit:
client.bwlimit = parse_num(opt.bwlimit)
if not opt.target_specs:
--
2.47.3