[PATCH 2 of 2] bookmarks: add 'hg pull -B .' for pulling the active bookmark (issue5258)

Yuya Nishihara yuya at tcha.org
Fri Jun 17 10:20:34 EDT 2016


On Fri, 17 Jun 2016 15:34:43 +0200, Piotr Listkiewicz wrote:
> > An unexpanded bookmark '.' is passed to bookmarks.updatefromremote()
> > through
> > exchange.pull(), which seems wrong. Can you take a look?  
> 
> You are totally right, this is wrong what can be seen for example when
> pulling divergent bookmark.
> 
> Normally getting divergent bookmark explicitly with 'hg pull -B bookmark'
> makes this bookmark moves to the changeset pointed in the remote
> repository.
> 
> Solution in patch makes bookmarks.updatefromremotes not recognizing that
> divergent bookmark was explicitly pulled with 'pull -B bookmark' (it
> compares bookmark name and dot) and stores new divergent bookmark(for
> example bookmark at default).
> 
> To prevent this we can expand bookmark names in exchange.pulloperation
> constructor or in bookmarks.updatefromremote, both solutions should work.
> Which place do You find better suited for this?

I have no idea why the '.' expansion is delayed.

If the '.' is considered a virtual bookmark specifier, it should be expanded
everywhere an actual bookmark name is required. If it is an alias only valid
for push/pull, the discovery or exchange module will be good place. If it is
just a shorthand for "-B <activebookmark>", I would expand it in commands.py.


More information about the Mercurial-devel mailing list