Mercurial > public > mercurial-scm > hg-stable
diff hgext/fix.py @ 48693:657e490756e6
fix: remove unnecessary and overly strict check for divergence
`rewriteutil.precheck()` checks for divergence these days, so we can
remove the redundant check in `hg fix`.
Differential Revision: https://phab.mercurial-scm.org/D12088
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 11 Feb 2021 22:52:43 -0800 |
parents | 2f7caef017d9 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/hgext/fix.py Wed Jan 26 10:11:01 2022 -0800 +++ b/hgext/fix.py Thu Feb 11 22:52:43 2021 -0800 @@ -149,7 +149,6 @@ mdiff, merge, mergestate as mergestatemod, - obsolete, pycompat, registrar, rewriteutil, @@ -463,8 +462,6 @@ revs = set(logcmdutil.revrange(repo, opts[b'rev'])) if opts.get(b'working_dir'): revs.add(wdirrev) - for rev in revs: - checkfixablectx(ui, repo, repo[rev]) # Allow fixing only wdir() even if there's an unfinished operation if not (len(revs) == 1 and wdirrev in revs): cmdutil.checkunfinished(repo) @@ -481,16 +478,6 @@ return revs -def checkfixablectx(ui, repo, ctx): - """Aborts if the revision shouldn't be replaced with a fixed one.""" - if ctx.obsolete(): - # It would be better to actually check if the revision has a successor. - if not obsolete.isenabled(repo, obsolete.allowdivergenceopt): - raise error.Abort( - b'fixing obsolete revision could cause divergence' - ) - - def pathstofix(ui, repo, pats, opts, match, basectxs, fixctx): """Returns the set of files that should be fixed in a context