Skip to content

Commit

Permalink
save-cmd: when verbose=1, print the dirname *before* backing it up.
Browse files Browse the repository at this point in the history
It was really misleading showing the most-recently-completed directory, then
spending a long time backing up files in a totally different place.
  • Loading branch information
apenwarr committed Mar 4, 2010
1 parent 0fddd44 commit d4b8630
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/save-cmd.py
Expand Up @@ -132,6 +132,7 @@ def wantrecurse_during(ent):
tstart = time.time()
count = subcount = fcount = 0
lastskip_name = None
lastdir = ''
for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during):
(dir, file) = os.path.split(ent.name)
exists = (ent.flags & index.IX_EXISTS)
Expand All @@ -147,8 +148,12 @@ def wantrecurse_during(ent):
status = 'M'
else:
status = ' '
if opt.verbose >= 2 or stat.S_ISDIR(ent.mode):
if opt.verbose >= 2:
log('%s %-70s\n' % (status, ent.name))
elif not stat.S_ISDIR(ent.mode) and lastdir != dir:
if not lastdir.startswith(dir):
log('%s %-70s\n' % (status, os.path.join(dir, '')))
lastdir = dir

if opt.progress:
progress_report(0)
Expand Down

0 comments on commit d4b8630

Please sign in to comment.