Bookmarks: don't push local bookmark heads by default?

Matt Mackall mpm at selenic.com
Sat Jun 2 16:16:21 CDT 2012


Right now when we push, we push all heads. But we don't automatically
propagate bookmarks so that users can keep a local namespace.

In some cases, this is fine. If Alice creates a new head on a branch and
puts a bookmark on it, push will refuse to push it without -f and she
can then push just the head she wants.

But if Alice instead creates a bookmark and makes several commits on the
tip of default, then pushes, the remote server will now have Alice's
bookmarked commits on default and people will automatically update to
those commits. Which means it's not making it very easy for Alice to
make a "local branch". 

(Closely related is case 3 here:
http://mercurial.markmail.org/thread/73jkexbdfuuuzv3e )

One possibility is that when an outgoing head has a bookmark that's
local-only, we treat the commits as local-only as well and refrain from
pushing it. This lets Alice make a private bookmark branch without
needing to worry about it getting pushed by accident.

Upsides:

- no more need for manually specifying heads to push
- no misguided push -f catastrophes

Downsides:

- significant change that might surprise people (though not ruled out
insofar as the current behavior could be considered buggy)
- might quietly prevent some who has a local bookmark on their named
branch head today for some reason from pushing (more worrisome)
- bookmarks only mark one end of a line of development, so if Alice
makes a "real" commit followed by two bookmarked ones, the real one will
be hidden from push
- some overlap with secret phases functionality

Another alternative, pushing "local" bookmarks always, is probably off
the table as it means anyone who is depending on having a private
namespace today gets a nasty surprise on upgrade.

Thoughts?

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list