Skip to content

Commit

Permalink
bup_rm: take opts as individual arguments
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Browning <[email protected]>
Tested-by: Rob Browning <[email protected]>
  • Loading branch information
rlbdv committed Oct 30, 2016
1 parent abc542d commit 20fcdad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/rm-cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
o.fatal('no paths specified')

check_repo_or_die()
bup_rm(extra, opt)
bup_rm(extra, compression=opt.compress, verbosity=opt.verbose)
die_if_errors()
6 changes: 3 additions & 3 deletions lib/bup/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def dead_items(vfs_top, paths):
return dead_branches, dead_saves


def bup_rm(paths, opt):
def bup_rm(paths, compression=6, verbosity=None):
root = vfs.RefList(None)

dead_branches, dead_saves = dead_items(root, paths)
Expand All @@ -95,7 +95,7 @@ def bup_rm(paths, opt):

writer = None
if dead_saves:
writer = git.PackWriter(compression_level=opt.compress)
writer = git.PackWriter(compression_level=compression)

try:
for branch, saves in dead_saves.iteritems():
Expand Down Expand Up @@ -124,7 +124,7 @@ def bup_rm(paths, opt):
git.delete_ref(ref_name, orig_ref.encode('hex'))
else:
git.update_ref(ref_name, new_ref, orig_ref)
if opt.verbose:
if verbosity:
new_hex = new_ref.encode('hex')
if orig_ref:
orig_hex = orig_ref.encode('hex')
Expand Down

0 comments on commit 20fcdad

Please sign in to comment.