Patchwork [7,of,7] debugobsolete: display parents information from markers

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 19, 2014, 12:49 a.m.
Message ID <9a8c62a5fe0d8bd80111.1408409377@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5500/
State Superseded
Commit 2229d757802d10db6b9f7a0cd2700be4fa994949
Headers show

Comments

Pierre-Yves David - Aug. 19, 2014, 12:49 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1408407443 25200
#      Mon Aug 18 17:17:23 2014 -0700
# Node ID 9a8c62a5fe0d8bd80111724e9d565bdd73f6002b
# Parent  c30352bcad3f7b3575402dde739f3708135c3b0c
debugobsolete: display parents information from markers

Now that we have a new field, we needs a way to visualize it.
Augie Fackler - Aug. 19, 2014, 2:09 p.m.
On Mon, Aug 18, 2014 at 05:49:37PM -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1408407443 25200
> #      Mon Aug 18 17:17:23 2014 -0700
> # Node ID 9a8c62a5fe0d8bd80111724e9d565bdd73f6002b
> # Parent  c30352bcad3f7b3575402dde739f3708135c3b0c
> debugobsolete: display parents information from markers

Series as a whole looks pretty good, but I'd like the field
documentation I mentioned earlier in the thread.

>
> Now that we have a new field, we needs a way to visualize it.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1183,10 +1183,13 @@ def showmarker(ui, marker):
>      ui.write(hex(marker.precnode()))
>      for repl in marker.succnodes():
>          ui.write(' ')
>          ui.write(hex(repl))
>      ui.write(' %X ' % marker.flags())
> +    parents = marker.parentnodes()
> +    if parents is not None:
> +        ui.write('{%s} ' % ', '.join(hex(p) for p in parents))
>      ui.write('(%s) ' % util.datestr(marker.date()))
>      ui.write('{%s}' % (', '.join('%r: %r' % t for t in
>                                   sorted(marker.metadata().items())
>                                   if t[0] != 'date')))
>      ui.write('\n')
> diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
> --- a/tests/test-histedit-obsolete.t
> +++ b/tests/test-histedit-obsolete.t
> @@ -88,11 +88,11 @@ Enable obsolete
>    | x  1:d2ae7f538514 b
>    |/
>    o  0:cb9a9f314b8b a
>
>    $ hg debugobsolete
> -  d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 (*) {'user': 'test'} (glob)
> +  d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
>    177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
>    055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
>    e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
>    652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
>
> diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
> --- a/tests/test-rebase-obsolete.t
> +++ b/tests/test-rebase-obsolete.t
> @@ -164,22 +164,22 @@ set.
>    | x  1:42ccdea3bb16 B
>    |/
>    o  0:cd010b8cd998 A
>
>    $ hg debugobsolete
> -  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
> +  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
>    5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
> -  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
> +  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
>
>
>  More complex case were part of the rebase set were already rebased
>
>    $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
>    $ hg debugobsolete
> -  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
> +  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
>    5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
> -  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
> +  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
>    08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
>    $ hg log -G
>    @  11:4596109a6a43 D
>    |
>    | o  10:5ae4c968c6ac C
> @@ -198,16 +198,16 @@ More complex case were part of the rebas
>    |/
>    o  0:cd010b8cd998 A
>
>    $ hg rebase --source 'desc(B)' --dest 'tip'
>    $ hg debugobsolete
> -  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
> +  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
>    5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
> -  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
> +  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
>    08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
>    8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
> -  08483444fef91d6224f6655ee586a65d263ad34c 0 (*) {'user': 'test'} (glob)
> +  08483444fef91d6224f6655ee586a65d263ad34c 0 {8877864f1edb05d0e07dc4ba77b67a80a7b86672} (*) {'user': 'test'} (glob)
>    5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
>    $ hg log --rev 'divergent()'
>    $ hg log -G
>    o  13:98f6af4ee953 C
>    |
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1183,10 +1183,13 @@  def showmarker(ui, marker):
     ui.write(hex(marker.precnode()))
     for repl in marker.succnodes():
         ui.write(' ')
         ui.write(hex(repl))
     ui.write(' %X ' % marker.flags())
+    parents = marker.parentnodes()
+    if parents is not None:
+        ui.write('{%s} ' % ', '.join(hex(p) for p in parents))
     ui.write('(%s) ' % util.datestr(marker.date()))
     ui.write('{%s}' % (', '.join('%r: %r' % t for t in
                                  sorted(marker.metadata().items())
                                  if t[0] != 'date')))
     ui.write('\n')
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -88,11 +88,11 @@  Enable obsolete
   | x  1:d2ae7f538514 b
   |/
   o  0:cb9a9f314b8b a
   
   $ hg debugobsolete
-  d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 (*) {'user': 'test'} (glob)
+  d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
   177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
   055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
   e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
   652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
 
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -164,22 +164,22 @@  set.
   | x  1:42ccdea3bb16 B
   |/
   o  0:cd010b8cd998 A
   
   $ hg debugobsolete
-  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
+  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
   5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
-  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
+  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
 
 
 More complex case were part of the rebase set were already rebased
 
   $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
   $ hg debugobsolete
-  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
+  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
   5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
-  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
+  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
   08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
   $ hg log -G
   @  11:4596109a6a43 D
   |
   | o  10:5ae4c968c6ac C
@@ -198,16 +198,16 @@  More complex case were part of the rebas
   |/
   o  0:cd010b8cd998 A
   
   $ hg rebase --source 'desc(B)' --dest 'tip'
   $ hg debugobsolete
-  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (*) {'user': 'test'} (glob)
+  42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
   5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
-  32af7686d403cf45b5d95f2d70cebea587ac806a 0 (*) {'user': 'test'} (glob)
+  32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
   08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
   8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
-  08483444fef91d6224f6655ee586a65d263ad34c 0 (*) {'user': 'test'} (glob)
+  08483444fef91d6224f6655ee586a65d263ad34c 0 {8877864f1edb05d0e07dc4ba77b67a80a7b86672} (*) {'user': 'test'} (glob)
   5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
   $ hg log --rev 'divergent()'
   $ hg log -G
   o  13:98f6af4ee953 C
   |