[PATCH 0 of 6] improve help and hints, then add 'update --bookmark'

Matt Mackall mpm at selenic.com
Wed Dec 7 16:18:35 CST 2011


On Wed, 2011-12-07 at 14:01 -0600, Kevin Bullock wrote:
> On Dec 7, 2011, at 12:32 PM, Idan Kamara wrote:
> 
> > Why would you not want to move the *active* bookmark when updating to a
> > descendant? When opening issue2894 this is the behavior I expected, others
> > disagreed but I didn't understand the use cases in which this is undesired.
> 
> 
> The use case is using bookmarks as a replacement for localtags (and Matt has explicitly stated he considers localtags deprecated in favor of bookmarks). Example:
> 
> Alice has done a major experimental refactoring and wants Bob to review it. She bookmarks the last non-experimental revision as 'last-stable', and the head as 'experimental'. Bob clones (with bookmarks) and updates to 'last-stable' to inspect it. He then runs `hg update` to inspect the head of Alice's work.
> 
> On no account should the 'last-stable' bookmark move in this case.

Ok, let's compare some use cases:

Case 1:

Alice sets a bookmark "whataliceisworkingon". Alice does some work.
Alice commits, pulls, merges, now "whataliceisworkingon" points at her
merge. Alice then pushes, does some more work, pulls, then does an "hg
update" to merge her pull into her working directory, then commits. Now
"whataliceisworkingon" should point to her latest commit (but the update
currently loses it as of 2.0).

Question 1a: is there something "un-Mercurial" about Alice's use of
update here? 

Question 1b: why should the workflow of merging-by-update require
special attention to bookmarks, while merge does not?

Question 1c: will users forget to use -B or whatever basically every
time it's relevant?

Question 1d: how can we warn people (who are mostly error-blind already
or possibly using a tool that hides the note) that they've left their
active bookmark behind on "hg update" if we decide to do that?

Question 1e: will users need to do "hg book -f whataliceisworkingon" to
manually fix things every time they forget?

Question 1f: what could possibly go wrong with a workflow that basically
implies a --force because users can never remember to do it 'right' the
first time?

Case 2:

Alice has done a major experimental refactoring and wants Bob to review
it. She bookmarks the last non-experimental revision as 'last-stable',
and the head as 'experimental'. Bob clones (with bookmarks) and updates
to 'last-stable' to inspect it. He then runs `hg update` to inspect the
head of Alice's work. This does or does not move the last-stable
bookmark depending on how case 1 is resolved.

Question 2a: why is Bob using "hg update" (find the latest) here rather
than "hg update experimental" (jump to a specific revision). Does he
have some good reason for thinking experimental is a descendant?

Question 2b: is a label that shouldn't be moved automatically really a
good use case for bookmarks?

Question 2c: is this use case important/sensible/frequent enough to
justify the regular annoyance implied by 1c through 1f?


Some of my answers:

1a: obviously not
1c: you can bank on it
2c: no, not even remotely

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list