diff mercurial/debugcommands.py @ 32626:00a7f7b1af9c

obsolete: add a function to compute "exclusive-markers" for a set of nodes This set will be used to select the obsmarkers to be stripped alongside the stripped changesets. See the function docstring for details. More advanced testing is introduced in the next changesets to keep this one simpler. That extra testing provides more example.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 20 May 2017 15:02:30 +0200
parents b62b2b373bce
children 3ef319e9505f
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Thu Jun 01 08:32:24 2017 +0200
+++ b/mercurial/debugcommands.py	Sat May 20 15:02:30 2017 +0200
@@ -1313,6 +1313,8 @@
          ('', 'record-parents', False,
           _('record parent information for the precursor')),
          ('r', 'rev', [], _('display markers relevant to REV')),
+         ('', 'exclusive', False, _('restrict display to markers only '
+                                    'relevant to REV')),
          ('', 'index', False, _('display index of the marker')),
          ('', 'delete', [], _('delete markers specified by indices')),
         ] + cmdutil.commitopts2 + cmdutil.formatteropts,
@@ -1391,7 +1393,8 @@
         if opts['rev']:
             revs = scmutil.revrange(repo, opts['rev'])
             nodes = [repo[r].node() for r in revs]
-            markers = list(obsolete.getmarkers(repo, nodes=nodes))
+            markers = list(obsolete.getmarkers(repo, nodes=nodes,
+                                               exclusive=opts['exclusive']))
             markers.sort(key=lambda x: x._data)
         else:
             markers = obsolete.getmarkers(repo)