Patchwork [in,crew] bookmarks: show active bookmark even if not at working dir

login
register
mail settings
Submitter Kevin Bullock
Date Jan. 27, 2013, 5:41 p.m.
Message ID <0efd5686f80c8f91493d.1359308486@slower-than-infinity.lan>
Download mbox | patch
Permalink /patch/744/
State Accepted
Commit 0efd5686f80c8f91493dc460a256ba111b5a0dc3
Headers show

Comments

Kevin Bullock - Jan. 27, 2013, 5:41 p.m.
# HG changeset patch
# User Kevin Bullock <kbullock@ringworld.org>
# Date 1359307754 21600
# Branch stable
# Node ID 0efd5686f80c8f91493dc460a256ba111b5a0dc3
# Parent  886936ecc21bed5e9bc1a244b22f4b203d3c3ace
bookmarks: show active bookmark even if not at working dir

If the active bookmark doesn't point at a parent of the working dir
(e.g. a pull moved it out from under us), we nonetheless show it as
active. This follows on 2096e025a728 in removing the dichotomy (at least
in the UI) between "current" and "active" bookmarks.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -873,7 +873,7 @@  def bookmark(ui, repo, mark=None, rev=No
     else: # show bookmarks
         for bmark, n in sorted(marks.iteritems()):
             current = repo._bookmarkcurrent
-            if bmark == current and n == cur:
+            if bmark == current:
                 prefix, label = '*', 'bookmarks.current'
             else:
                 prefix, label = ' ', ''
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
@@ -47,7 +47,7 @@  import bookmark by name
   (run 'hg update' to get a working copy)
   $ hg bookmarks
      X                         0:4e3505fd9583
-     Y                         0:4e3505fd9583
+   * Y                         0:4e3505fd9583
      Z                         0:4e3505fd9583
   $ hg debugpushkey ../a namespaces
   bookmarks	
@@ -64,7 +64,7 @@  import bookmark by name
   importing bookmark X
   $ hg bookmark
      X                         0:4e3505fd9583
-     Y                         0:4e3505fd9583
+   * Y                         0:4e3505fd9583
      Z                         0:4e3505fd9583
 
 export bookmark by name