Patchwork [2,of,5,V7] bookmarks: show outgoing bookmarks more exactly

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 7, 2015, 6:04 p.m.
Message ID <5edd69c6c4d31ba3b6f2.1428429844@juju>
Download mbox | patch
Permalink /patch/8538/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - April 7, 2015, 6:04 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1428429379 -32400
#      Wed Apr 08 02:56:19 2015 +0900
# Node ID 5edd69c6c4d31ba3b6f27171cd2fc5f91ed23aa9
# Parent  9c435648fcf7d0239fdbeb3e5cd5f12af80961b1
bookmarks: show outgoing bookmarks more exactly

Before this patch, "hg outgoing -B" shows only bookmarks added
locally. Then, users can't know about bookmarks below before "hg push"
execution.

  - deleted locally (even though it may be added remotely from "hg pull" view)
  - advanced locally
  - diverged
  - changed (= remote revision is unknown for local)

This patch shows such bookmarks, too.

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -494,6 +494,14 @@  def outgoing(ui, repo, other):
         outgoings.append("   %-25s %s\n" % (b, getid(id)))
     for b, scid, dcid in addsrc:
         add(b, scid)
+    for b, scid, dcid in adddst:
+        add(b, ' ' * 40)
+    for b, scid, dcid in advsrc:
+        add(b, scid)
+    for b, scid, dcid in diverge:
+        add(b, scid)
+    for b, scid, dcid in differ:
+        add(b, scid)
 
     if not outgoings:
         ui.status(_("no changed bookmarks found\n"))
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
@@ -402,8 +402,11 @@  hgweb
   $ hg out -B http://localhost:$HGPORT/
   comparing with http://localhost:$HGPORT/
   searching for changed bookmarks
-  no changed bookmarks found
-  [1]
+     @                         0d2164f0ce0d
+     X                         0d2164f0ce0d
+     Z                         0d2164f0ce0d
+     foo                                   
+     foobar                                
   $ hg push -B Z http://localhost:$HGPORT/
   pushing to http://localhost:$HGPORT/
   searching for changes