D4788: narrow: don't do the dirstate dance if ellipses is not enabled

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Mon Oct 1 11:03:53 EDT 2018


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


More information about the Mercurial-devel mailing list