[PATCH 1 of 2 V2] push: hide description about "-f" in the hint to prevent from using it easily

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Thu Sep 19 04:10:56 CDT 2013


At Wed, 18 Sep 2013 18:42:16 -0500,
Matt Mackall wrote:
> 
> On Wed, 2013-09-04 at 22:27 +0900, FUJIWARA Katsunori wrote:
> > # HG changeset patch
> > # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> > # Date 1378300768 -32400
> > #      Wed Sep 04 22:19:28 2013 +0900
> > # Node ID aa8788937c2e5b505b4096f48536249d29499829
> > # Parent  73513cb8c379af12f3dfb9ae2dcab864239481ae
> > push: hide description about "-f" in the hint to prevent from using it easily
> > 
> > "use push -f to force" in the hint at abortion of "hg push" may cause
> > novice users to execute "push -f" easily without understanding about
> > problems of multiple branch heads in the repository.
> > 
> > This patch hides description about "-f" in the hint, and leads into
> > seeing "hg help push" for detail about pushing multiple heads.
> > 
> > This patch also recommends to ask the management policy of the
> > destination repository before using "-f".
> 
> Looks like there's some good ideas in here.
> 
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -4648,7 +4648,10 @@
> >      only create a new branch without forcing other changes.
> >  
> >      Use -f/--force to override the default behavior and push all
> > -    changesets on all branches.
> > +    changesets on all branches. Before using --force, it is
> > +    recommended to ask the administrator of the destination repository
> > +    for the management policy of it. Pushing multiple heads in
> > +    particular is usually a mistake.
> 
> Let's make this its own patch (so we can bikeshed it separately).

OK, I'll split it.


> I think we should definitely say that using --force is probably a
> mistake, but the 'ideal' Mercurial environment doesn't have admins
> to consult.
> 
> >    abort: push creates new remote head c922c0139ca0!
> > -  (did you forget to merge? use push -f to force)
> > +  (did you forget to merge? see "hg help push" for detail about pushing multiple heads)
> 
> Length problem. How about:
> 
> (did you forget to merge? see "hg help push" for more details)

At V1 of this series, Angel suggested that the hint should contain
"multiple heads" phrase, and I understood that it would lead users to
read about "multiple heads" topic in online help.

  http://selenic.com/pipermail/mercurial-devel/2013-August/053180.html

Is 'see "hg help push" for more details' enough ? or how about:

    (merge or see "hg help push" for detail about pushing multiple heads)


> > -  (you should pull and merge or use push -f to force)
> > +  (you should pull and merge or see "hg help push" for detail about pushing multiple heads)
> 
> Another length problem. We don't usually use 'you should', so perhaps:
> 
> (pull and merge or see "hg help push")

I kept "you should" phrase just because original has used it. I'll
revise it so.


> -- 
> Mathematics is the supreme nostalgia of our time.
> 
> 
> 

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list