[PATCH 2 of 4] clone to master bookmark if available

Matt Mackall mpm at selenic.com
Tue Nov 29 13:28:41 CST 2011


On Tue, 2011-11-29 at 11:27 +0100, Arne Babenhauserheide wrote:
> Hi, 
> 
> Firstoff, I now think that the @ scheme would actually be a pretty good one. 
> 
> Am Montag, 7. November 2011, 10:08:02 schrieben Sie:
> > On Mon, 2011-11-07 at 08:40 +0100, Arne Babenhauserheide wrote:
> > > Am Sonntag, 6. November 2011, 18:50:05 schrieben Sie:
> > > I think I would prefer using the last path segment as namespace… or
> > > allowing the user to specify a prefix/rename. Just adding a fixed
> > > string does not scale for having many remotes.
> > 
> > I skipped the explanation of how to scale it as I assumed the
> > conventions of prime notation were familiar to everyone. But that's not
> > the point: the point is that we don't really need to 'name' these other
> > bookmarks. They should by their nature be short-lived and not numerous,
> > much like unmerged heads.
> 
> But they are not, because people tend to accumulte unfinished work. Which is OK 
> with me: It is their way of using Mercurial. Mercurial should handle it 
> efficiently as long as that does not hinder other functionality.
> 
> > > What other options are there?
> > 
> > Last path segment isn't a terribly good one, as that will often be the
> > same. Hostname and IP address have similar issues. Even full paths can
> > collide if the remote repository gets rebased or someone forcibly pushes
> > another head between your pulls. We could attach usernames from commits,
> > but again, those will eventually collide. Nor will they necessarily be
> > meaningful on a large project.
> 
> How about using names, if they are defined in [paths] in .hg/hgrc?

We actually came to that idea on IRC a while back. The current state of
several related ideas is here:

http://titanpad.com/hg-bookmarks

> Otherwise go with anything, but if it’s a repo I know, it would be nice to 
> know that it’s from there.
> Also local repo’s relative paths should be clear enough.
> 
> > So I think some simple and temporary "numbering" (in some notation) of
> > the divergent copies is probably the easiest and least gaudy thing to
> > do. Here's another notation using '@', a symbol that won't get us in
> > trouble with shells or revsets:
> > 
> > B   <- the original bookmark
> > B at 1 <- its first divergent copy
> > B at 2 <- its second
> 
> replaced by 
> 
> B
> B at latenighthacking
> B at robstark
> B at 1
> (last has no path setup)
> 
> They would be created by using
> 
> hg bo B
> hg pull latenighthacking -B
> hg pull robstark -B
> hg pull ssh://…/…
> 
> > ..which brings me back to your "default bookmark" concept, which could
> > be simply:
> > 
> > @  <- the default bookmark to checkout on clone
> > @1 <- its first divergent copy
> 
> I actually realized that we don’t need this. setting a "default" bookmark and 
> a <branchname> bookmark does the same if I get the bookmarks-on-checkout code 
> working (I currently have no clue why the testcase breaks :( ). 
> 
> > which means the usable set only includes
> > 
> >  _@/. ]
> 
> of these, . seems wacky, _ seems a natural fit for usage in normal bookmark 
> names (which rules it out for structure) and / is nice but on different 
> philosophy. From what I understand of it, Mercurial favors looking at the 
> project, while git looks at the view of a single developer. For the project it 
> is indeed bookmark at developer.
> 
> Best wishes, 
> Arne
> 
> PS: Do we have a philosophy page somewhere? Something like the Zen of Python? 
>http://www.python.org/dev/peps/pep-0020/
> That would be really great to be able to actually show people why people does 
> things the way it does.

No. That's an interesting project, but redoing the FAQ might be more
productive.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list