[PATCH] bookmarks: rename the active bookmark with no arguments

Augie Fackler raf at durin42.com
Mon Jul 24 21:28:03 EDT 2017


> On Jul 19, 2017, at 7:59 AM, Ryan McElroy <rm at fb.com> wrote:
> 
>> +                    old = repo._activebookmark
>> +                    new = rename
>> +                elif len(names) == 1:
>> +                    old = rename
>> +                    new = names[0]
> 
> This is the biggest concern I have with this change -- it swaps where the new name comes from.
> 
> BEFORE THIS PATCH:
> 
> $ hg book foo # foo is now active, no other bookmarks exist
> $ hg book -m bar
> abort: new bookmark name required
> $ hg book -m bar foo
> abort: bookmark 'bar' does not exist
> $ hg book -m foo bar # foo is now named bar
> 
> AFTER THIS PATCH:
> 
> $ hg book foo # foo is now active, no other bookmarks exist
> $ hg book -m bar # foo is now named bar
> $ hg book -m bar foo # bar is now named foo
> $ hg book -m foo bar # foo is now named to bar
> 
> Note that between the second and third invocations of hg above, the meaning of the parameter to -m has totally changed.
> 
> Personally, I'm okay with this change since it seems pretty natural to an end-user, but it's definitely inconsistent when you look at it technically.

I think this feels okay-ish. David, please re-send after August 1st.

(Sorry this feel through the cracks.)


More information about the Mercurial-devel mailing list