[PATCH] named branches: --newbranch option to allow intial push of new branches

Matt Mackall mpm at selenic.com
Tue Jun 23 21:19:23 UTC 2009


On Sat, 2009-06-20 at 10:22 +0000, Sune Foldager wrote:
> # HG changeset patch
> # User Sune Foldager <sune.foldager at edlund.dk>
> # Date 1245491231 -7200
> # Node ID 8fcc4eacbf961f09b6820d9d0c397905e99a926b
> # Parent  b30775386d4064a22a52b35cd5449a2623cec27a
> named branches: --newbranch option to allow intial push of new branches
> 
> Compare this to --force which allows anything to be pushed. With --newbranch,
> only changesets to named branches not present on the remote are allowed.

Still not convinced here. I see a few different ways to go:

a) Consider new branches to be the same as new heads for the purposes of
new heads -> require force. This shouldn't be a frequently required
operation with the new branch push smarts.

b) Allow explicitly-specified heads/branches (ie -r) to be pushed
without force. Compare hg revert and hg revert foo. People might be
surprised if they misdirect their push though and be surprised to see
they shot themselves in the foot so it's not perfect.

c) Add a new option. This is a pretty obscure use case and people might
also misdirect their push here too.

So I'm currently planning to go with (a) and find out whether there's
still demand for more here.

-- 
http://selenic.com : development and support for Mercurial and Linux





More information about the Mercurial-devel mailing list