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

liscju piotr.listkiewicz at gmail.com
Mon Jun 13 17:58:02 EDT 2016


# 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)
                 revs.append(remotebookmarks[b])
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -366,7 +366,10 @@ Update a bookmark right after the initia
      X                         1:0d2164f0ce0d
    * Y                         5:35d1ef0a8d1b
      Z                         1:0d2164f0ce0d
-  $ hg pull -B Y
+  $ hg update -r Y
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (activating bookmark Y)
+  $ hg pull -B .
   pulling from http://localhost:$HGPORT/
   searching for changes
   adding changesets
@@ -376,9 +379,9 @@ Update a bookmark right after the initia
   updating bookmark Y
   (run 'hg update' to get a working copy)
   $ hg book
-   * @                         1:0d2164f0ce0d
+     @                         1:0d2164f0ce0d
      X                         1:0d2164f0ce0d
-     Y                         5:35d1ef0a8d1b
+   * Y                         5:35d1ef0a8d1b
      Z                         1:0d2164f0ce0d
 
 (done with this section of the test)


More information about the Mercurial-devel mailing list