<div dir="ltr">Hi peoples,<br>I think/hope I&#39;ve now implemented what you wanted.<br>Sjo, what a workout!<br><br><div class="gmail_quote">2008/9/29 Marius Kruger <span dir="ltr">&lt;<a href="mailto:amanic@gmail.com" target="_blank">amanic@gmail.com</a>&gt;</span><br>
...<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I thought about it a little more and read Robert comments on the bug (<a href="https://bugs.launchpad.net/bugs/230903" target="_blank">https://bugs.launchpad.net/bugs/230903</a>). <br>And I think I finally understand what you have been saying:<br>


<blockquote><span></span>Robert Collins wrote:<br>Some notes -<br>
&nbsp;- implicit nicks should be drawing from the branch anyway</blockquote></div></blockquote><div>Done: checkouts without explicit nicks, use the nick of their master <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><blockquote><br>
&nbsp;- the implicit nick of a bound branch should draw from the url of the<br>
master</blockquote></div></blockquote><div>This seems contradictory to the first note: I&#39;m using the nick of the master, and if the master does not have an explicit nick, then it uses its folder name. I might be misunderstanding what you are trying to say.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><blockquote><br>
&nbsp;- if there is an explicit nick of a bound branch, it should be changed<br>
to the nick of the new master when switching </blockquote></div></blockquote><div>Done <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><blockquote>(and probably done at<br>
bind() time for consistency)</blockquote></div></blockquote><div>Done, at no extra charge.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><blockquote><br>&nbsp;- switching should not create an explicit nick where there was none<br>
before</blockquote></div></blockquote><div>Done <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><blockquote><br></blockquote>
<div>So if and only if there is an explicit nick already set, it should it set the nick explicitly again.<br>Is there a way to unset the nick?<br><br>
</div></div>
</blockquote></div>this question remains ^^^. Maybe we can add `nick --unset`, but I&#39;ll leave that for another<br>bundle, this one is getting bloated already.<br><br><br><br>When running the test suite the following failed since when committing on bound branches we<br>
now need to hit the master to obtain the nick first:<br>self.assertEquals(1, len(self.connections))<br><br>Vincent Ladeuil&#39;s comment on a previous review, helped me to understand why this happens, and why to fix it:<br>
<br>...<br>The purpose of the test is to check that a single<br>connection to the server is used, for performance reasons but<br>also because the user will be prompted for its password again<br>otherwise.<br>..<br><br><br>
 I would not have had to jump through so many hoops if we were memoising the master<br>as this comment suggests:<br>&nbsp;&nbsp;&nbsp; def get_master_branch(self, possible_transports=None):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;Return the branch we are bound to.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :return: Either a Branch, or None<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This could memoise the branch, but if thats done<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it must be revalidated on each new lock.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So for now we just don&#39;t memoise it.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # RBC 20060304 review this decision.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;<br><br><br><br>With that sorted, I had a bigger problem: <br>Because for checkouts we now always need to hit the master<br>to obtain the nick, we couldn&#39;t do truly local commits any more,<br>
which was fortunately caught by the following test:<br><br>&nbsp;&nbsp;&nbsp; def test_local_commit_ignores_master(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # a --local commit does not require access to the master branch<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # at all, or even for it to exist.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # we test this by setting up a bound branch and then corrupting<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the master.<br clear="all"><br>I solved this by silently falling back to the normal implicit nick if we <br>can&#39;t connect to the master. I think this is a good solution given<br>
the alternatives. I wanted to only catch BoundBranchConnectionFailure,<br>but our test suite forces a UnknownFormatError, which made me <br>think that there might be other cases where we might want to<br>be able to recover for nick&#39;s sake.<br>
<br><br>-- <br>regards<br>Marius<br>&lt;&gt;&lt; <br><a href="http://amanica.blogspot.com/" target="_blank"></a>Its 03:27 already, its becoming a bad habbit.<br>

</div>