Patchwork [2,of,5,V2] pullreport: skip filtered revs instead of obsolete ones

login
register
mail settings
Submitter Boris Feld
Date Sept. 28, 2018, 5:49 p.m.
Message ID <c2ac56afe1e26620a0c3.1538156948@localhost.localdomain>
Download mbox | patch
Permalink /patch/35173/
State Accepted
Headers show

Comments

Boris Feld - Sept. 28, 2018, 5:49 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1538058910 -7200
#      Thu Sep 27 16:35:10 2018 +0200
# Node ID c2ac56afe1e26620a0c38a0f006902102dae9f19
# Parent  78ef4cda114aabd21835d7bc08b0a7c04040d80f
# EXP-Topic obsolete-duplicates
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r c2ac56afe1e2
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.

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -38,6 +38,7 @@  from . import (
     pycompat,
     revsetlang,
     similar,
+    smartset,
     url,
     util,
     vfs,
@@ -1605,11 +1606,9 @@  def registersummarycallback(repo, otr, t
             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()]
 
diff --git a/tests/test-obsolete-distributed.t b/tests/test-obsolete-distributed.t
--- a/tests/test-obsolete-distributed.t
+++ b/tests/test-obsolete-distributed.t
@@ -537,5 +537,5 @@  Actual test
   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)