[PATCH RFC] update: skip bookmarked heads when running a bare "hg update"

Angel Ezquerra angel.ezquerra at gmail.com
Fri Jun 8 04:40:27 CDT 2012


On Thu, Jun 7, 2012 at 4:37 AM, Matt Mackall <mpm at selenic.com> wrote:
> On Fri, 2012-05-25 at 16:25 +0200, Angel Ezquerra wrote:
>> # HG changeset patch
>> # User Angel Ezquerra <angel.ezquerra at gmail.com>
>> # Date 1337955724 -7200
>> # Node ID cb06046e10797e569bed05850318068f4a5d535c
>> # Parent  2ac08d8b21aa7b6e0a062afed5a3f357ccef67f9
>> update: skip bookmarked heads when running a bare "hg update"
>>
>> When running a bare "hg update" without specifying a revision, we used to
>> update to the tip of the current branch, even if it were bookmarked. This is
>> inconvenient when using bookmarks for feature branches, since pulling new
>> bookmarks will make "hg update" update to those bookmarked "feature branches".
>
> Interesting. This seems in line with what I've proposed here:
>
> http://markmail.org/message/qugvrgamwudgsdbq
>
> and our recent change to the behavior of merge with bookmarks:
>
> http://www.selenic.com/hg/rev/4a02cf4fbb2e
>
> So I'm inclined to accept it. But I think we need an informative error
> message here rather than simply saying "up to date", something like:

When you say that mercurial says "up to date" you mean that it shows:

0 files updated, 0 files merged, 0 files removed, 0 files unresolved

right?

> abort: branch head is on a bookmark
> (use 'hg update <branch>' to update anyway)

Do you mean: "(use 'hg update <bookmark>' to update anyway)"

Would it make sense to show the bookmark the head is on instead? That is:

abort: branch head is on bookmark 'mybookmark'
(use 'hg update mybookmark' to update anyway)


That being said, I've been using this patch a little and I've found
some scenarios where I'm not sure it is doing what it should. I'll
write a follow up email discussing those soon.


> We are probably overdue for a bookmarks help topic explaining how they
> interact with things.

I agree.

Cheers,

Angel


More information about the Mercurial-devel mailing list