yuja added a comment.

  >   So I was working on it, but the way I tried to correct "wdir()" is by 
handling it as a special case, so introducing an "if" block again similar to 
this.
  >   But you were asking to eliminate the if/else block altogether, I wonder 
if there is way ?
  
  IIRC, my point was to avoid adding *big* if/else branch which will be likely
  to introduce untested code paths.
  
  I don't think there would be a way to go without if/else or try/except as
  long as we use the low-level filelog API for performance reasons. Perhaps,
  we'll have to catch WdirUnsupported error to fall back to the filectx API.
  
    try:
        flog.read(fnode)
    except error.WdirUnsupported:
        ctx[fn].data()

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2938

To: sangeet259, #hg-reviewers
Cc: av6, yuja, pulkit, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to