Patchwork [2,of,3,V4] push: add more detailed explanation about "--force" to online help document

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Oct. 3, 2013, 2:53 p.m.
Message ID <49339a7e52914e9abbed.1380812025@juju>
Download mbox | patch
Permalink /patch/2727/
State Accepted
Commit 4f53de036af82548c1137dbb1940a6750133557f
Delegated to: Augie Fackler
Headers show

Comments

Katsunori FUJIWARA - Oct. 3, 2013, 2:53 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1380809766 -32400
#      Thu Oct 03 23:16:06 2013 +0900
# Node ID 49339a7e52914e9abbedcfce4f1906f6997dc0c8
# Parent  ba230978adae2a1b1c55cadc768ee5d3d71f687e
push: add more detailed explanation about "--force" to online help document

This patch adds more detailed explanation about "--force" to online
help document of "hg push" to prevent novice users to execute "push
--force" easily without understanding about problems of multiple
branch heads in the repository.
Matt Mackall - Oct. 20, 2013, 11:12 p.m.
On Thu, 2013-10-03 at 23:53 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1380809766 -32400
> #      Thu Oct 03 23:16:06 2013 +0900
> # Node ID 49339a7e52914e9abbedcfce4f1906f6997dc0c8
> # Parent  ba230978adae2a1b1c55cadc768ee5d3d71f687e
> push: add more detailed explanation about "--force" to online help document
...
> +    Although you can override the default behavior and push all
> +    changesets on all branches by -f/--force, pushing new heads in
> +    particular is usually a mistake. Before pushing with --force, you
> +    should ask the owner of the destination repository for the policy
> +    about multiple heads in it.

I've queued these, thanks, but I've rewritten this message:

+    .. note::
+      Extra care should be used with the -f/--force option,
+      which will push all new heads on all branches, an action which will
+      almost always cause confusion for collaborators.
Laurens Holst - Oct. 21, 2013, 10:48 a.m.
Matt Mackall schreef op 21-10-13 01:12:
> On Thu, 2013-10-03 at 23:53 +0900, FUJIWARA Katsunori wrote:
>> # HG changeset patch
>> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
>> # Date 1380809766 -32400
>> #      Thu Oct 03 23:16:06 2013 +0900
>> # Node ID 49339a7e52914e9abbedcfce4f1906f6997dc0c8
>> # Parent  ba230978adae2a1b1c55cadc768ee5d3d71f687e
>> push: add more detailed explanation about "--force" to online help document
> ...
>> +    Although you can override the default behavior and push all
>> +    changesets on all branches by -f/--force, pushing new heads in
>> +    particular is usually a mistake. Before pushing with --force, you
>> +    should ask the owner of the destination repository for the policy
>> +    about multiple heads in it.
> I've queued these, thanks, but I've rewritten this message:
>
> +    .. note::
> +      Extra care should be used with the -f/--force option,
> +      which will push all new heads on all branches, an action which will
> +      almost always cause confusion for collaborators.

Nit: ...should be taken

~Laurens

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4650,8 +4650,11 @@ 
     branch that is not present at the destination. This allows you to
     only create a new branch without forcing other changes.
 
-    Use -f/--force to override the default behavior and push all
-    changesets on all branches.
+    Although you can override the default behavior and push all
+    changesets on all branches by -f/--force, pushing new heads in
+    particular is usually a mistake. Before pushing with --force, you
+    should ask the owner of the destination repository for the policy
+    about multiple heads in it.
 
     If -r/--rev is used, the specified revision and all its ancestors
     will be pushed to the remote repository.