Commit Graph

2 Commits

Author SHA1 Message Date
Jun Wu
e0eb41504b test-fixcorrupt: be OSX compatible
Summary:
`wc` in OSX has different padding behavior that breaks the test:

```
       $ wc -c .hg/store/00changelog* .hg/store/00manifest* | sort
    -   99 .hg/store/00manifest.d
    -  110 .hg/store/00changelog.d
    -  128 .hg/store/00changelog.i
    -  128 .hg/store/00manifest.i
    -  465 total
    +        99 .hg/store/00manifest.d
    +       110 .hg/store/00changelog.d
    +       128 .hg/store/00changelog.i
    +       128 .hg/store/00manifest.i
    +       465 total
```

This patch fixes it.

Test Plan: The fix was verified manually on an OS X machine.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D4872689

Signature: t1:4872689:1491954172:92178178deea88ec3545c42ad0cdecc8099a1db6
2017-04-11 16:43:32 -07:00
Jun Wu
de5e7c6545 fixcorrupt: new extension to fix corrupted repo
Summary:
We sometimes get reports about corrupted repos. Usually the corrupted part
is just at the end of changelog or manifest.

Truncating them manually works but people need to be very careful. This
extension is like the manual fix but automatized.

Test Plan:
Run `hg debugfixcorrupt --no-dryrun` on a reported corrupted repo and check
it truncates files correctly and the repo passes `hg verify` afterwards.

Reviewers: #mercurial, durham, stash

Reviewed By: stash

Subscribers: stash, rmcelroy, durham, lcharignon, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3408396

Signature: t1:3408396:1491897232:fc17a105124b568963441adfec97e26735df3258
2017-04-11 13:19:42 -07:00