]> arthur.barton.de Git - bup.git/blobdiff - cmd/get-cmd.py
get: remove extra src_repo
[bup.git] / cmd / get-cmd.py
index f5fe01a5bd73b672590910d89147e1454d5ddce9..c2fc547112361d8010226bd2f5ec7043950e366a 100755 (executable)
@@ -12,7 +12,7 @@ from functools import partial
 from stat import S_ISDIR
 
 from bup import git, client, helpers, vfs
-from bup.compat import wrap_main
+from bup.compat import hexstr, wrap_main
 from bup.git import get_cat_data, parse_commit, walk_object
 from bup.helpers import add_error, debug1, handle_ctrl_c, log, saved_errors
 from bup.helpers import hostname, shstr, tty_width
@@ -556,11 +556,11 @@ def resolve_targets(specs, src_repo, dest_repo):
 
 def log_item(name, type, opt, tree=None, commit=None, tag=None):
     if tag and opt.print_tags:
-        print(tag.encode('hex'))
+        print(hexstr(tag))
     if tree and opt.print_trees:
-        print(tree.encode('hex'))
+        print(hexstr(tree))
     if commit and opt.print_commits:
-        print(commit.encode('hex'))
+        print(hexstr(commit))
     if opt.verbose:
         last = ''
         if type in ('root', 'branch', 'save', 'commit', 'tree'):
@@ -586,9 +586,6 @@ def main():
     with dest_repo as dest_repo:
         with LocalRepo(repo_dir=src_dir) as src_repo:
             with dest_repo.new_packwriter(compression_level=opt.compress) as writer:
-
-                src_repo = LocalRepo(repo_dir=src_dir)
-
                 # Resolve and validate all sources and destinations,
                 # implicit or explicit, and do it up-front, so we can
                 # fail before we start writing (for any obviously