[Updated] D12002: precheck: fix false warning about content-divergence creation
khanchi97 (Sushil khanchi)
phabricator at mercurial-scm.org
Tue Mar 29 12:29:20 UTC 2022
Closed by commit rHGd4752aeb20f1: precheck: fix false warning about content-divergence creation (authored by khanchi97).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D12002?vs=32717&id=32726
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D12002/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D12002
AFFECTED FILES
mercurial/rewriteutil.py
CHANGE DETAILS
diff --git a/mercurial/rewriteutil.py b/mercurial/rewriteutil.py
--- a/mercurial/rewriteutil.py
+++ b/mercurial/rewriteutil.py
@@ -49,10 +49,13 @@
return summary
-def precheck(repo, revs, action=b'rewrite'):
+def precheck(repo, revs, action=b'rewrite', check_divergence=True):
"""check if revs can be rewritten
action is used to control the error message.
+ check_divergence allows skipping the divergence checks in cases like adding
+ a prune marker (A, ()) to obsstore (which can't be diverging).
+
Make sure this function is called after taking the lock.
"""
if nullrev in revs:
@@ -85,6 +88,9 @@
hint=hint,
)
+ if not check_divergence:
+ return
+
if not obsolete.isenabled(repo, obsolete.allowdivergenceopt):
new_divergence = _find_new_divergence(repo, revs)
if new_divergence:
To: khanchi97, #hg-reviewers, martinvonz, marmoute, Alphare
Cc: av6, Alphare, marmoute, martinvonz, mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220329/e72b6389/attachment-0002.html>
More information about the Mercurial-patches
mailing list