D6282: branch: abort if closing branch from a non-branchhead cset

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun May 5 14:13:16 EDT 2019



On 5/1/19 11:18 PM, Sushil Khanchi wrote:
> .
> 
> On Wed, May 1, 2019 at 9:22 PM Pierre-Yves David 
> <pierre-yves.david at ens-lyon.org <mailto:pierre-yves.david at ens-lyon.org>> 
> wrote:
> 
>     .
> 
>     On 5/1/19 2:14 PM, Sushil Khanchi wrote:
>      > .
>      >
>      > On Wed, May 1, 2019 at 5:14 PM Pierre-Yves David
>      > <pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>
>     <mailto:pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>>>
>      > wrote:
>      >
>      >
>      >
>      >     On 5/1/19 1:14 PM, Sushil Khanchi wrote:
>      >      > .
>      >      >
>      >      > On Fri, Apr 26, 2019 at 8:29 PM Pierre-Yves David
>      >      > <pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>
>      >     <mailto:pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>>
>      >     <mailto:pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>
>      >     <mailto:pierre-yves.david at ens-lyon.org
>     <mailto:pierre-yves.david at ens-lyon.org>>>>
>      >      > wrote:
>      >      >
>      >      >
>      >      >
>      >      >     On 4/19/19 9:49 AM, khanchi97 (Sushil khanchi) wrote:
>      >      >      > khanchi97 created this revision.
>      >      >      > Herald added a subscriber: mercurial-devel.
>      >      >      > Herald added a reviewer: hg-reviewers.
>      >      >      >
>      >      >      > REVISION SUMMARY
>      >      >      >    This patch make sure that we abort if the user
>     is trying to
>      >      >      >    close a branch from a cset which is not a branch
>     head.
>      >      >      >    Changes in test file reflect the fixed behaviour.
>      >      >
>      >      >     Is there a way to override this ? There can be situation
>      >     where the
>      >      >     changeset is not a local head but could be a remote head.
>      >      >
>      >      > By closing remote head, you mean first close that locally
>     (where
>      >     it is
>      >      > not a head) and push that to a remote (where it is a head)?
>      >
>      >     Yes
>      >
>      > I don't think in present code there is any way to override this.
>     Do you
>      > have any idea? Or any other place in mercurial you remember where we
>      > handle similar situation?
>      > And just for knowledge I would like to know how often developers use
>      > this remote head closing thing (when locally it is not a head)?
> 
>     Something similar coming to mind is `hg tag`. It will -warn- when
>     tagging a non-head but will still tag. Maybe we should align on this
>     (warning instead of aborting)
> 
> 
> How about prompting the user to confirm? One upside in prompting I see 
> is that user don't have to run `hg strip/prune`. Also the downside is it 
> requires user intervention.

prompt are usually not a great user experience. I lean toward saying 
"lets have a user experience similar to `hg tag`". Alternatively, we 
could have a warning early. For example, if the commit message editor 
had a line about adding a new heads/closing non-head, this would be a 
clear win.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list