pulkit added a comment.
In https://phab.mercurial-scm.org/D4788#72714, @martinvonz wrote: > In https://phab.mercurial-scm.org/D4788#72444, @pulkit wrote: > > > I am not sure about this one. I was unable to think of a reason why we need to do this dirstate dance in non-ellipses cases. @martinvonz @durin42 do you know why we do this? > > > What I usually do when I can't understand why something is needed: remove the code and run tests :) That will often tell you there there was in fact a reason for the code and give you some hints what that reason is. Of course, in some cases it won't tell you that and then you'll have to figure out if it's just untested or actually useless. Do you mean lines 279-280 of `hgext/narrow/narrowcommands.py` before this patch? If you remove those lines, you will see that `test-narrow{,patterns,widen,widen-no-ellipsis}.t` fail. You were right about the reason for the first `setparent()` call, btw. The reason for the code is so we move back to the old commit once we've restored the temporarily stripped commits. And in non-ellipses cases, we are not stripping commits, so we can easily make this only execute when ellipses is enabled. INLINE COMMENTS > martinvonz wrote in narrowcommands.py:254-260 > You have add the requirement earlier in the series, so you can just use that > here? (I suspect this is a leftover from an earlier version of this patch.) I think it's getting confusing for me and suspect bit hard for you too as the series tries to do two quite different yet related things. I will drop the ellipses requirement patch from this series and will first concentrate on the introducing wireprotocol command and the ellipses requirement thing as a seperate series when the wireprotocol one is reviewed and pushed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D4788 To: pulkit, durin42, #hg-reviewers Cc: martinvonz, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel