[PATCH 5 of 5] pullreport: rev duplicated and extinct into account

Boris Feld boris.feld at octobus.net
Fri Sep 28 06:22:22 EDT 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1538060106 -7200
#      Thu Sep 27 16:55:06 2018 +0200
# Node ID 779c6fdd8cf7057f93785f4f653ae2c4860af576
# Parent  cd5d5d6586b124fc7d4476223ccce0bc8eb04c50
# EXP-Topic obsolete-duplicates
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 779c6fdd8cf7
pullreport: rev duplicated and extinct into account

If we already have some obsolete and hidden nodes locally and the server send
them again to you, it seems useful to point it out instead of being silent about
it.

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1632,7 +1632,9 @@ def registersummarycallback(repo, otr, t
                 repo.ui.status(msg)
 
             # search new changesets directly pulled as obsolete
-            obsadded = unfi.revs('%d: and obsolete()', origrepolen)
+            duplicates = tr.changes.get('revduplicates', ())
+            obsadded = unfi.revs('(%d: + %ld) and obsolete()',
+                                 origrepolen, duplicates)
             cl = repo.changelog
             extinctadded = [r for r in obsadded if r not in cl]
             if extinctadded:
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -806,6 +806,7 @@ check hgweb does not explode
   adding file changes
   added 62 changesets with 63 changes to 9 files (+60 heads)
   new changesets 50c51b361e60:c15e9edfca13 (62 drafts)
+  (2 other changesets obsolete on arrival)
   (run 'hg heads .' to see heads, 'hg merge' to merge)
   $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
   > do


More information about the Mercurial-devel mailing list