Follow-up to #67, stacked on #68 (merge #67, then #68, then this). Brings --estimate to the single most common migration source — a Google Takeout — so an operator leaving Gmail can see the scale before committing.
The problem it solves. A Takeout is a local file dump with no server to ask, so its plain --dry-run only counts files. --estimate now reads the mbox files to count the messages that are actually new and sum their bytes.
email: 24,318 new, 4.2 GB
Faithful, not approximate. It deduplicates by the same blake3 content hash the import uses — so a message that appears in two mboxes counts once, and anything already in the archive is skipped (a re-estimate after a partial import correctly reports what is left). It loads the archive's existing hashes once into a set (as IMAP/Maildir load their ids), then scans. It parses no MIME and writes nothing.
Cost. It reads the mbox bodies — unavoidable for a local file source, there is no metadata to ask — but that is the cheap half of what the import does anyway (no MIME parse, no blob intern, no inserts).
Scope. Mail only. A Takeout's calendars (.ics) and contacts (.vcf) are not itemized yet; the file counts in the dry-run log stand in for them. That's the next follow-up if wanted.
Tests. A new sync_takeout test (runnable, no live server) builds a synthetic Takeout, asserts all 9 messages estimate as new and are sized, then imports and re-estimates to assert nothing new. Smoke-tested end to end incl. the duplicate-message and delta cases. cargo test --locked, fmt, clippy -D warnings all pass.
Follow-up to #67, stacked on #68 (**merge #67, then #68, then this**). Brings `--estimate` to the single most common migration source — a Google Takeout — so an operator leaving Gmail can see the scale before committing.
**The problem it solves.** A Takeout is a local file dump with no server to ask, so its plain `--dry-run` only counts *files*. `--estimate` now reads the mbox files to count the messages that are actually **new** and sum their bytes.
```
email: 24,318 new, 4.2 GB
```
**Faithful, not approximate.** It deduplicates by the **same blake3 content hash the import uses** — so a message that appears in two mboxes counts once, and anything already in the archive is skipped (a re-estimate after a partial import correctly reports what is left). It loads the archive's existing hashes once into a set (as IMAP/Maildir load their ids), then scans. It parses no MIME and writes nothing.
**Cost.** It reads the mbox bodies — unavoidable for a local file source, there is no metadata to ask — but that is the cheap half of what the import does anyway (no MIME parse, no blob intern, no inserts).
**Scope.** Mail only. A Takeout's calendars (.ics) and contacts (.vcf) are not itemized yet; the file counts in the dry-run log stand in for them. That's the next follow-up if wanted.
**Tests.** A new `sync_takeout` test (runnable, no live server) builds a synthetic Takeout, asserts all 9 messages estimate as new and are sized, then imports and re-estimates to assert nothing new. Smoke-tested end to end incl. the duplicate-message and delta cases. `cargo test --locked`, fmt, clippy `-D warnings` all pass.
A Takeout is a local file dump with no server to ask, so its plain dry
run only counts files. --estimate now reads the mbox files to count the
messages that are actually new -- deduplicated by the same content hash
the import uses, so a message in two mboxes counts once and anything
already in the archive is skipped -- and sums their bytes. It parses no
MIME and writes nothing.
Calendars and contacts in a Takeout are not itemized yet; the file
counts in the dry-run log stand in for them.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #67, stacked on #68 (merge #67, then #68, then this). Brings
--estimateto the single most common migration source — a Google Takeout — so an operator leaving Gmail can see the scale before committing.The problem it solves. A Takeout is a local file dump with no server to ask, so its plain
--dry-runonly counts files.--estimatenow reads the mbox files to count the messages that are actually new and sum their bytes.Faithful, not approximate. It deduplicates by the same blake3 content hash the import uses — so a message that appears in two mboxes counts once, and anything already in the archive is skipped (a re-estimate after a partial import correctly reports what is left). It loads the archive's existing hashes once into a set (as IMAP/Maildir load their ids), then scans. It parses no MIME and writes nothing.
Cost. It reads the mbox bodies — unavoidable for a local file source, there is no metadata to ask — but that is the cheap half of what the import does anyway (no MIME parse, no blob intern, no inserts).
Scope. Mail only. A Takeout's calendars (.ics) and contacts (.vcf) are not itemized yet; the file counts in the dry-run log stand in for them. That's the next follow-up if wanted.
Tests. A new
sync_takeouttest (runnable, no live server) builds a synthetic Takeout, asserts all 9 messages estimate as new and are sized, then imports and re-estimates to assert nothing new. Smoke-tested end to end incl. the duplicate-message and delta cases.cargo test --locked, fmt, clippy-D warningsall pass.