[Bug 6928] New: Close head locally with secret phase

Mitchell Elutovich melutovich at gmail.com
Thu Oct 10 18:31:39 UTC 2024


Moving phase from a lower to higher (public to draft, draft to secret)
needs a confirmation you know what you are doing and that you really want
to do it, I might have called it "--confirm" but as in some circumstances
[not yours] it can be undesirable it is called "--force"

So that was the correct way to do it.

based on the documentation in: 'hg help phases'
you could have in your config the below [I don't and just use the '--secret
--force' when needed], I did not try but I would assume that  `hg
close-head <revision>' would create it directly as secret.

[phases]
new-commit=secret


On Thu, Oct 10, 2024 at 6:24 PM <mercurial-bugs at mercurial-scm.org> wrote:

> https://bz.mercurial-scm.org/show_bug.cgi?id=6928
>
>             Bug ID: 6928
>            Summary: Close head locally with secret phase
>            Product: Mercurial
>            Version: 6.7.4
>           Hardware: PC
>                 OS: NetBSD
>             Status: UNCONFIRMED
>           Severity: feature
>           Priority: wish
>          Component: Mercurial
>           Assignee: bugzilla at mercurial-scm.org
>           Reporter: mercurial-bugzilla at campbell.mumble.net
>                 CC: mercurial-devel at mercurial-scm.org
>     Python Version: ---
>
> I have a large repository.  On one of its branches there are two heads,
> one for
> the main development and one created a while ago for work in progress (but
> not
> recorded in a topic).  This old head is distracting but maybe my
> collaborators
> have some reason to keep it open.
>
> Can I close it locally, so that, e.g., `hg update' and `hg rebase' stop
> complaining about multiple heads?
>
> I tried `hg close-head <revision>' but that created a draft commit which I
> might accidentally push somewhere else.
>
> I tried `hg phase --secret <closeheadrevision>' to avoid accidentally
> pushing
> it, but that refused to change phase from draft to secret.
>
> I was able to do `hg phase --force --secret <closeheadrevision>'.  But I'm
> not
> sure that's the right way to approach it; hg seems to be discouraging this
> by
> requiring `--force'.
>
> I assume I could have done `hg update <revision> && hg commit --secret
> --close-branch' but that would move my working tree back by several years,
> triggering gigabytes of disk I/O and requiring full rebuilds even though I
> don't actually want to change the working tree.
>
> Is there a better way to approach this?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20241010/1a081b97/attachment.html>


More information about the Mercurial-devel mailing list