Patchwork [1,of,5,V6-3] bookmarks: show maybe incoming bookmarks more exactly

login
register
mail settings
Submitter Katsunori FUJIWARA
Date April 3, 2015, 5:21 p.m.
Message ID <0b45afc9df7f3042415a.1428081660@juju>
Download mbox | patch
Permalink /patch/8481/
State Accepted
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 0b45afc9df7f3042415a69457fafe043f0766737
# Parent  d7cf8102bf09a905662c1018e60a06e417a08af3
bookmarks: show maybe incoming bookmarks more exactly

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

This patch shows bookmarks below, too:

  - advanced remotely
  - advanced locally
  - diverged
  - changed (remote revision is unknown for local)
Matt Mackall - April 3, 2015, 10:02 p.m.
On Sat, 2015-04-04 at 02:21 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1428081282 -32400
> #      Sat Apr 04 02:14:42 2015 +0900
> # Node ID 0b45afc9df7f3042415a69457fafe043f0766737
> # Parent  d7cf8102bf09a905662c1018e60a06e417a08af3
> bookmarks: show maybe incoming bookmarks more exactly

Since this changes the output in a way that makes the old info (which
changesets are new) no longer available, I'm going to have to hold off
on taking the first few here until we agree on an output format.

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -460,6 +460,14 @@  def incoming(ui, repo, other):
         incomings.append("   %-25s %s\n" % (b, getid(id)))
     for b, scid, dcid in addsrc:
         add(b, scid)
+    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 incomings:
         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
@@ -414,6 +414,8 @@  hgweb
   $ hg in -B http://localhost:$HGPORT/
   comparing with http://localhost:$HGPORT/
   searching for changed bookmarks
+     @                         9b140be10808
+     X                         9b140be10808
      Z                         0d2164f0ce0d
      foo                       000000000000
      foobar                    9b140be10808