<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="im" style="font-size:12.8px">> +        if p2 and p2 not in nodemap:<br></span><span class="im" style="font-size:12.8px">> +            self.ui.warn(_("setting parent to node %s non-existing "<br></span><span class="im" style="font-size:12.8px">> +                           "in the local repository\n")<br></span><span class="im" style="font-size:12.8px">> +                         % nodemod.hex(p2))</span><span class="im" style="font-size:12.8px"><br></span><span style="font-size:12.8px">Maybe this should be an 'elif'.</span></blockquote><div><br></div><div>Good point, the question is if it should raise two warning messages if both parents doesnt exist or not. In Patch V2 I preserve this patch behaviour, but im still looking forward what others think about it.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-24 19:21 GMT+01:00 Sean Farley <span dir="ltr"><<a href="mailto:sean@farley.io" target="_blank">sean@farley.io</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
liscju <<a href="mailto:piotr.listkiewicz@gmail.com">piotr.listkiewicz@gmail.com</a>> writes:<br>
<br>
> # HG changeset patch<br>
> # User liscju <<a href="mailto:piotr.listkiewicz@gmail.com">piotr.listkiewicz@gmail.com</a>><br>
> # Date 1458719722 -3600<br>
> #      Wed Mar 23 08:55:22 2016 +0100<br>
> # Node ID 54c0e66ee49f08806488a591f32fa18581fde717<br>
> # Parent  78e4e558fa74aa4489609953328cbcecf1a8a428<br>
> bundle: warn when update to revision existing only in a bundle (issue5004)<br>
><br>
> Now its done silently, so unless user really knows what he is doing<br>
> will be suprised to find that after update 'hg status' doesn't work.<br>
<br>
</span>Nice idea. I like idea. Only nit-picks below.<br>
<span class=""><br>
> diff -r 78e4e558fa74 -r 54c0e66ee49f mercurial/bundlerepo.py<br>
> --- a/mercurial/bundlerepo.py Sat Mar 19 08:27:54 2016 -0700<br>
> +++ b/mercurial/bundlerepo.py Wed Mar 23 08:55:22 2016 +0100<br>
> @@ -32,6 +32,7 @@ from . import (<br>
>      localrepo,<br>
>      manifest,<br>
>      mdiff,<br>
> +    node as nodemod,<br>
>      pathutil,<br>
>      phases,<br>
>      revlog,<br>
> @@ -385,6 +386,18 @@ class bundlerepository(localrepo.localre<br>
>      def getcwd(self):<br>
>          return os.getcwd() # always outside the repo<br>
><br>
> +    def setparents(self, p1, p2=nullid):<br>
> +        c = changelog.changelog(self.svfs)<br>
> +        nodemap = c.nodemap<br>
> +        if p1 not in nodemap:<br>
> +            self.ui.warn(_("setting parent to node %s non-existing "<br>
> +                           "in the local repository\n")<br>
> +                         % nodemod.hex(p1))<br>
<br>
</span>We should probably bikeshed on the wording a little. Maybe something<br>
like:<br>
<br>
"updating to HEXNODE which does not exist in PATH/TO/REPO"<br>
<br>
I'm a little unsure how we should word the local repo.<br>
<span class=""><br>
> +        if p2 and p2 not in nodemap:<br>
> +            self.ui.warn(_("setting parent to node %s non-existing "<br>
> +                           "in the local repository\n")<br>
> +                         % nodemod.hex(p2))<br>
<br>
</span>Maybe this should be an 'elif'.<br>
</blockquote></div><br></div>