Patchwork [2,of,5,V6-3] bookmarks: show outgoing bookmarks more exactly

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 3, 2015, 5:21 p.m.
Message ID <f4f968d6c8e5bf2a1996.1428081661@juju>
Download mbox | patch
Permalink /patch/8479/
State Superseded
Commit 8ea893ab0572790618f72267e3841bd5eb804176
Headers show

Comments

Katsunori FUJIWARA - April 3, 2015, 5:21 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1428081282 -32400
#      Sat Apr 04 02:14:42 2015 +0900
# Node ID f4f968d6c8e5bf2a19962cb198266c8cb139fccd
# Parent  0b45afc9df7f3042415a69457fafe043f0766737
bookmarks: show outgoing bookmarks more exactly

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

This patch shows bookmarks below, too:

  - deleted locally (in "hg push" view)
  - advanced locally
  - advanced remotely
  - diverged
  - changed (= remote revision is unknown for local)

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -496,6 +496,16 @@  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 advdst:
+        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