Patchwork D10519: branch: delete obsolete message about changing branch of obsolete commit

login
register
mail settings
Submitter phabricator
Date April 28, 2021, 3:08 p.m.
Message ID <differential-rev-PHID-DREV-7ciq4yawegatyuhjeyi5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48839/
State Superseded
Headers show

Comments

phabricator - April 28, 2021, 3:08 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
pulkit accepted this revision.
This revision is now accepted and ready to land.

REVISION SUMMARY
  We now rely on `rewriteutil.precheck()` to check for divergence, so we
  don't need the extra check in `cmdutil.changebranch()`. The former
  check is a little less strict in that it allows you to rewrite a
  commit without non-obsolete successors.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10519

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -998,11 +998,6 @@ 
                 _(b"a branch of the same name already exists")
             )
 
-        if repo.revs(b'obsolete() and %ld', revs):
-            raise error.InputError(
-                _(b"cannot change branch of a obsolete changeset")
-            )
-
         # make sure only topological heads
         if repo.revs(b'heads(%ld) - head()', revs):
             raise error.InputError(