atom feed2 messages in com.selenic.mercurial-develSmoothing out bookmarks
FromSent OnAttachments
Kevin BullockMay 15, 2012 9:45 pm 
Matt MackallMay 17, 2012 7:22 am 
Subject:Smoothing out bookmarks
From:Kevin Bullock (
Date:May 15, 2012 9:45:23 pm

In IRC this afternoon (US/Central) we were discussing various aspects of
bookmarks, and how to finally tighten up the experience of using them. I've
submitted a patch to make a bookmark called '@' the update target for clone if
it exists, but several other issues need to be considered to make the whole
experience smooth. For starters, here's a few questions I was considering
regarding the special @ bookmark:

1. Should a bare update go to @ if it exists (and we're not on a named branch)?

2. Would it be sensible to have @ be on a named branch other than default, or
would this lead to madness? a. What about allowing a per-branch default bookmark? b. What should a per-branch default bookmark be called? 'foo@' would be the
most obvious, but seems klunky. If this bookmark diverges, we end up with
bookmarks named things like 'foo@@1'.

3. What about the case where there's no bookmarks on a branch, and suddenly an
experimental one appears?

To elaborate on (3), Matt posed the following problem: Alice and Bob are working
on a branch. Alice updates to the branch head and commits, then starts some
experimental work. She commits and bookmarks her work as alice-work. When Bob
pulls and updates, he should move forward one commit. Instead he gets everything
in alice-work, which is now the branch head.

To solve this, I suggested automatically creating a "default" bookmark when an
explicit bookmark is created on a branch with no other bookmarks (or perhaps
even simply if there's no active bookmark). I say "default" in quotes because
this should almost certainly not be the same as the per-branch default discussed
in (2) above. This implicit-default bookmark would be as invisible as possible.
If there is an explicit default bookmark (say foo@), then the implicit "default"
bookmark would not be created.

Does this seem reasonable? I'll think more about this and propose a specific
design, but want to get comments early.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和 Kevin R. Bullock