D3439: templatefilters: add commonprefix

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Wed Jun 13 08:31:22 EDT 2018


yuja added a comment.


  >   > `commondir()` would be fine as well. `commonpath()` doesn't feel better. I'm ambivalent about either nam>
  >   I'd vote for changing it then. Both because I think it might make it clearer that it's the common prefix of "foo/bar" and "food" is not "foo" and because, as I said, we might want such a function later and it would be unfortunate if the name was taken. Btw, I just checked and we already have `dirname()` and `stripdir()` functions that would match `commondir()`.
  
  +1 for `commondir()`. It matches the actual behavior, which is the last filename
  part is always stripped.

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list