pullreport: skip filtered revs instead of obsolete ones
authorBoris Feld <boris.feld@octobus.net>
Thu, 27 Sep 2018 16:35:10 +0200
changeset 39897 a477679f6323
parent 39896 642cbc228bad
child 39898 b5e12039e6e0
pullreport: skip filtered revs instead of obsolete ones Obsolescence is closely related to visibility but still a distinct concept. We can receive changesets that are obsolete but visible (eg: when pulling orphans). Such changeset should be reported too. In addition, the filtering level can be anything, we should respect it.
mercurial/scmutil.py
tests/test-obsolete-distributed.t
--- a/mercurial/scmutil.py	Thu Sep 27 18:06:13 2018 +0200
+++ b/mercurial/scmutil.py	Thu Sep 27 16:35:10 2018 +0200
@@ -39,6 +39,7 @@
     pycompat,
     revsetlang,
     similar,
+    smartset,
     url,
     util,
     vfs,
@@ -1622,11 +1623,9 @@
             if origrepolen >= len(repo):
                 return
 
-            # Compute the bounds of new revisions' range, excluding obsoletes.
-            unfi = repo.unfiltered()
-            revs = unfi.revs('%d: and not obsolete()', origrepolen)
+            # Compute the bounds of new visible revisions' range.
+            revs = smartset.spanset(repo, start=origrepolen)
             if not revs:
-                # Got only obsoletes.
                 return
             minrev, maxrev = repo[revs.min()], repo[revs.max()]
 
--- a/tests/test-obsolete-distributed.t	Thu Sep 27 18:06:13 2018 +0200
+++ b/tests/test-obsolete-distributed.t	Thu Sep 27 16:35:10 2018 +0200
@@ -537,5 +537,5 @@
   added 2 changesets with 0 changes to 0 files
   1 new obsolescence markers
   1 new orphan changesets
-  new changesets 95d586532b49 (1 drafts)
+  new changesets 66f7d451a68b:95d586532b49 (2 drafts)
   (run 'hg update' to get a working copy)