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

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Fri Jun 17 09:34:43 EDT 2016


>
> 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?


2016-06-16 15:14 GMT+02:00 Yuya Nishihara <yuya at tcha.org>:

> On Mon, 13 Jun 2016 23:58:02 +0200, liscju wrote:
> > # HG changeset patch
> > # User liscju <piotr.listkiewicz at gmail.com>
> > # Date 1464814737 -7200
> > #      Wed Jun 01 22:58:57 2016 +0200
> > # Node ID fe1dc8c9f37982d1700aeb00ccb9b81c7ba21b9e
> > # Parent  89551c7ce02f153967898ab94fd3190334b6e49a
> > bookmarks: add 'hg pull -B .' for pulling the active bookmark (issue5258)
> >
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -5805,6 +5805,7 @@ def pull(ui, repo, source="default", **o
> >              remotebookmarks = other.listkeys('bookmarks')
> >              pullopargs['remotebookmarks'] = remotebookmarks
> >              for b in opts['bookmark']:
> > +                b = repo._bookmarks.expandname(b)
> >                  if b not in remotebookmarks:
> >                      raise error.Abort(_('remote bookmark %s not
> found!') % b)
>
> An unexpanded bookmark '.' is passed to bookmarks.updatefromremote()
> through
> exchange.pull(), which seems wrong. Can you take a look?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160617/831bc04b/attachment.html>


More information about the Mercurial-devel mailing list