<div dir="ltr"><div dir="ltr">On Tue, Apr 16, 2019 at 4:54 AM Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Sat, Apr 13, 2019 at 5:56 PM Pierre-Yves David <<a href="mailto:pierre-yves.david@ens-lyon.org" target="_blank">pierre-yves.david@ens-lyon.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"># HG changeset patch<br>
# User Pierre-Yves David <<a href="mailto:pierre-yves.david@octobus.net" target="_blank">pierre-yves.david@octobus.net</a>><br>
# Date 1554472565 -7200<br>
#      Fri Apr 05 15:56:05 2019 +0200<br>
# Node ID 0adcfded9b03fff84190594ef29e37110967419f<br>
# Parent  d5f42ea7b06825ee86620cdc18aaa3a53504bff5<br>
# EXP-Topic hgweb-obsolete<br>
# Available At <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a><br>
#              hg pull <a href="https://bitbucket.org/octobus/mercurial-devel/" rel="noreferrer" target="_blank">https://bitbucket.org/octobus/mercurial-devel/</a> -r 0adcfded9b03<br>
pull: deal with locally filtered changeset passed into --rev<br>
<br>
Nowadays, it is possible to explicitly pull a remote revision that end up being<br>
hidden locally (eg: obsoleted locally). However before this patch, some<br>
internal processing where crashing trying to resolve a filtered revision.<br>
<br>
Without this patches, the pull output result a confusing output:<br>
<br>
  $ hg pull ../repo-Bob --rev 956063ac4557<br>
  pulling from ../repo-Bob<br>
  searching for changes<br>
  adding changesets<br>
  adding manifests<br>
  adding file changes<br>
  added 2 changesets with 0 changes to 2 files (+1 heads)<br>
  (2 other changesets obsolete on arrival)<br>
  abort: 00changelog.i@956063ac4557828781733b2d5677a351ce856f59: filtered node!<br></blockquote><div><br></div><div>The existing abort message is bad and should be improved because typical users won't have a clue what it means.<br></div><div><br></div><div>But I have reservations about this patch because it isn't clear what will happen with `pull -u -r <hidden>`. If the working directory will be updated to a hidden revision without --hidden specified, this feels wrong to me.<br></div></div></div></blockquote><div><br></div><div>Oh - maybe part 5 (and later?) address my concerns?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div><br></div><div>Could we get test coverage showing what happens in this case? Please also check for behavior with `hg clone -r <hidden>` and `hg clone -u <rev>` as well.<br></div><div><br></div><div>Also, I'm a little confused about "checkout" and "brev" both doing similar things. It seems that "checkout" is used internally and "brev" is used for user-facing output. I wish this code were better documented. But that is scope bloat...<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/mercurial/commands.py b/mercurial/commands.py<br>
--- a/mercurial/commands.py<br>
+++ b/mercurial/commands.py<br>
@@ -4488,7 +4488,7 @@ def pull(ui, repo, source="default", **o<br>
             brev = None<br>
<br>
             if checkout:<br>
-                checkout = repo.changelog.rev(checkout)<br>
+                checkout = repo.unfiltered().changelog.rev(checkout)<br>
<br>
                 # order below depends on implementation of<br>
                 # hg.addbranchrevs(). opts['bookmark'] is ignored,<br>
diff --git a/tests/test-obsolete-distributed.t b/tests/test-obsolete-distributed.t<br>
--- a/tests/test-obsolete-distributed.t<br>
+++ b/tests/test-obsolete-distributed.t<br>
@@ -488,6 +488,22 @@ decision is made in that case, so receiv<br>
   d33b0a3a64647d79583526be8107802b1f9fedfa 5b5708a437f27665db42c5a261a539a1bcb2a8c2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'bob'}<br>
   ef908e42ce65ef57f970d799acaddde26f58a4cc 5ffb9e311b35f6ab6f76f667ca5d6e595645481b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'bob'}<br>
<br>
+<br>
+Same tests, but with --rev, this prevent regressing case where `hg pull --rev<br>
+X` has to process a X that is filtered locally.<br>
+<br>
+  $ hg rollback<br>
+  repository tip rolled back to revision 4 (undo unbundle)<br>
+  $ hg pull ../repo-Bob --rev 956063ac4557<br>
+  pulling from ../repo-Bob<br>
+  searching for changes<br>
+  adding changesets<br>
+  adding manifests<br>
+  adding file changes<br>
+  added 2 changesets with 0 changes to 2 files (+1 heads)<br>
+  (2 other changesets obsolete on arrival)<br>
+  (run 'hg heads' to see heads)<br>
+<br>
   $ cd ..<br>
<br>
 Test pull report consistency<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div></div>
</blockquote></div></div>