Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGe96ed3a61899: recover: fix typos
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
pulkit |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/commands.py (4 lines) | |||
M | tests/test-journal-exists.t (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
67b9cbd67b25 | ff396501e841 | Valentin Gatien-Baron | Jan 22 2020, 2:11 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | valentin.gatienbaron | ||
Closed | valentin.gatienbaron | D7971 recover: fix typos |
elif not result and pushop.bkresult: | elif not result and pushop.bkresult: | ||||
result = 2 | result = 2 | ||||
return result | return result | ||||
@command( | @command( | ||||
b'recover', | b'recover', | ||||
[(b'', b'verify', True, b"run `hg verify` after succesful recover"),], | [(b'', b'verify', True, b"run `hg verify` after successful recover"),], | ||||
helpcategory=command.CATEGORY_MAINTENANCE, | helpcategory=command.CATEGORY_MAINTENANCE, | ||||
) | ) | ||||
def recover(ui, repo, **opts): | def recover(ui, repo, **opts): | ||||
"""roll back an interrupted transaction | """roll back an interrupted transaction | ||||
Recover from an interrupted commit or pull. | Recover from an interrupted commit or pull. | ||||
This command tries to fix the repository status after an | This command tries to fix the repository status after an | ||||
interrupted operation. It should only be necessary when Mercurial | interrupted operation. It should only be necessary when Mercurial | ||||
suggests it. | suggests it. | ||||
Returns 0 if successful, 1 if nothing to recover or verify fails. | Returns 0 if successful, 1 if nothing to recover or verify fails. | ||||
""" | """ | ||||
ret = repo.recover() | ret = repo.recover() | ||||
if ret: | if ret: | ||||
if opts['verify']: | if opts['verify']: | ||||
return hg.verify(repo) | return hg.verify(repo) | ||||
else: | else: | ||||
msg = _( | msg = _( | ||||
b"(verify step skipped, run `hg verify` to check your " | b"(verify step skipped, run `hg verify` to check your " | ||||
b"repository content)\n" | b"repository content)\n" | ||||
) | ) | ||||
ui.warn(msg) | ui.warn(msg) | ||||
return 0 | return 0 | ||||
return 1 | return 1 | ||||
@command( | @command( |
$ hg recover | $ hg recover | ||||
rolling back interrupted transaction | rolling back interrupted transaction | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
checked 1 changesets with 1 changes to 1 files | checked 1 changesets with 1 changes to 1 files | ||||
recover, explicite verify | recover, explicit verify | ||||
$ touch .hg/store/journal | $ touch .hg/store/journal | ||||
$ hg ci -Am0 | $ hg ci -Am0 | ||||
abort: abandoned transaction found! | abort: abandoned transaction found! | ||||
(run 'hg recover' to clean up transaction) | (run 'hg recover' to clean up transaction) | ||||
[255] | [255] | ||||
$ hg recover --verify | $ hg recover --verify | ||||
rolling back interrupted transaction | rolling back interrupted transaction | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
checked 1 changesets with 1 changes to 1 files | checked 1 changesets with 1 changes to 1 files | ||||
recover, no verify | recover, no verify | ||||
$ touch .hg/store/journal | $ touch .hg/store/journal | ||||
$ hg ci -Am0 | $ hg ci -Am0 | ||||
abort: abandoned transaction found! | abort: abandoned transaction found! | ||||
(run 'hg recover' to clean up transaction) | (run 'hg recover' to clean up transaction) | ||||
[255] | [255] | ||||
$ hg recover --no-verify | $ hg recover --no-verify | ||||
rolling back interrupted transaction | rolling back interrupted transaction | ||||
(verify step skipped, run `hg verify` to check your repository content) | (verify step skipped, run `hg verify` to check your repository content) | ||||
Check that zero-size journals are correctly aborted: | Check that zero-size journals are correctly aborted: | ||||
#if unix-permissions no-root | #if unix-permissions no-root | ||||
$ hg bundle -qa repo.hg | $ hg bundle -qa repo.hg | ||||
$ chmod -w foo/.hg/store/00changelog.i | $ chmod -w foo/.hg/store/00changelog.i | ||||
$ hg -R foo unbundle repo.hg | $ hg -R foo unbundle repo.hg | ||||
adding changesets | adding changesets | ||||
abort: Permission denied: '$TESTTMP/foo/.hg/store/.00changelog.i-*' (glob) | abort: Permission denied: '$TESTTMP/foo/.hg/store/.00changelog.i-*' (glob) | ||||
[255] | [255] | ||||
$ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi | $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi | ||||
#endif | #endif | ||||