D3439: templatefilters: add commonprefix

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Wed May 9 08:46:46 EDT 2018


yuja added a comment.


  Please add tests of edge cases.
  
  - `str|commonprefix`
  - infinite loop (e.g. `["/foo", "bar"]`)
  - exact match (e.g. `["/foo"]` and `["/foo", "/foo"]`)
  - empty list
  
  `os.path.commonprefix()` will provide some hints to avoid comparison of
  all list elements by using min()/max().

REPOSITORY
  rHG Mercurial

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

To: joerg.sonnenberger, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list