Bookmarks with hg update question

David Demelier demelier.david at gmail.com
Wed Jun 29 09:00:04 UTC 2016


Le 28/06/2016 19:05, Becker, Mischa J a écrit :
>> From: Scott Palmer
>> Subject: Re: Bookmarks with hg update question
>>
>> Am I the only one that thinks the current behaviour makes sense?
>>
>> Scott
> If I recall correctly, bookmarks originally mimicked git branches.  Anyone coming to hg from git intrinsically understood bookmark behavior.  Those of us who came to hg from reading books found bookmark behavior weird. :)
>
> I'm slightly surprised there haven't been several other people pushing for bookmarks to stay exactly as is.  Maybe there are less git to hg people currently following the list.
>
> Mischa

We all understand how bookmarks work.

We (some, including me) just think that 'hg up' with no arguments should 
not move bookmarks because it's too easy to move bookmarks by mistake 
because:

   1. All tutorials show to use 'hg update' when pulling changes,
   2. Even the command 'hg pull' will give you a hint to use 'hg update' 
with no arguments.

Why I think it's a real problem:

A user (not a developer), not very familiar with Mercurial is watching  
a repository that have the @ bookmark. The developers make some commits, 
@ moves and the simple user pull and update. No problem so far.

Now the team decides to work on something a bit experimental, they 
deactivate the @ bookmark and use something else like 
'big-change-break'. They start adding new changesets, of course in the 
official repository the @ bookmark does not move anymore, problem, the 
user is still doing 'hg pull && hg up' or eventually 'hg pull -u'. 
Yikes, the user has just moved the @ bookmark to the tip (where 
'big-change-break' actually points) and may use something completely WIP 
/ unstable.

What I would like to see eventually:

If hg update is called without argument and the current activated 
bookmark is not in the same revision than the pulled one *and* they are 
in the same head, we can move to that new changeset.

Example (assuming user has @ activated, {} means working copy, () means 
a bookmark, * means activated):

   1. Before, in the user local repository: A -> B -> {C} (@*)
   2. After 'hg pull': A -> B -> {C} -> D -> E (@*) -> F -> G 
(big-change-break)
   3. After 'hg up': A -> B -> C -> D -> {E} (@*) -> F -> G 
(big-change-break)

Regards,

-- 
David Demelier




More information about the Mercurial mailing list