-
-
reviewboard/diffviewer/management/commands/condensediffs.py (Diff revision 1) Instead of using print(), management commands should use self.stdout.write().
Is this command safe to ctrl+C?
-
-
reviewboard/diffviewer/management/commands/condensediffs.py (Diff revision 1) While the exclamation point is fun, it might look really bad if it shouts out (1% savings!).
Add a condensediffs management command for condensing stored diff data.
Review Request #5138 — Created Dec. 18, 2013 and submitted
Information | |
---|---|
chipx86 | |
Review Board | |
master | |
Reviewers | |
reviewboard | |
Add a condensediffs management command for condensing stored diff data.
Review Board 1.7 introduced deduping of new diffs, but older diffs
remained duplicated in the database. This would add up, particularly
when using parent diffs or when uploading multiple revisions of diffs
containing many files unchanged between revisions.This introduces a condensediffs command that performs the deduping logic
for all older diffs. This operation is safe to perform while the
database is running, and should be safe to terminate if needed. The
actual logic for all this is in the new FileDiffManager.Upon completion, the command will display the amount of bytes saved as a
before/after comparison and as a percentage of reduction.rb-site upgrade will recommend that users run this if they have any
unmigrated data as well.This will be backported to 1.7.x, after the migrate-on-access code is
backported.
Ran this against my test database and a copy of the reviews.reviewboard.org
database. The migrations were successful and the review requests seemed fine.
Change Summary:
- Changed to
sys.stdout.write
. - Removed the exclamation point!
Diff: |
Revision 2 (+129 -3) |
---|
Change Summary:
- Oops, use
self.stdout.write
, notsys.stdout.write
. - Better handle the case where there are no diffs to migrate.
Diff: |
Revision 3 (+133 -3) |
---|