From: Avery Pennarun Date: Thu, 4 Mar 2010 04:16:52 +0000 (-0500) Subject: save-cmd: oops, byte counter was checking sha_missing() too late. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7032577a64fae095c2e4e4ad5ec81b38b3f852ff;p=packages%2Fb%2Fbup.git save-cmd: oops, byte counter was checking sha_missing() too late. After validating a backed-up file, sha_missing() goes false. So we have to remember the value from *before* we backed it up. Sigh. --- diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index 63c5005..1c4b6dd 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -137,6 +137,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): (dir, file) = os.path.split(ent.name) exists = (ent.flags & index.IX_EXISTS) hashvalid = already_saved(ent) + wasmissing = ent.sha_missing() oldsize = ent.size if opt.verbose: if not exists: @@ -185,7 +186,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): else: ent.validate(040000, newtree) ent.repack() - if exists and ent.sha_missing(): + if exists and wasmissing: count += oldsize continue @@ -228,7 +229,7 @@ for (transname,ent) in r.filter(extra, wantrecurse=wantrecurse_during): ent.validate(int(mode, 8), id) ent.repack() shalists[-1].append((mode, file, id)) - if exists and ent.sha_missing(): + if exists and wasmissing: count += oldsize subcount = 0