addEntries(entries, entryFilter = () => true, mapEntry = e => e) {
    const root = new TreeEntry([])
    const nodeStack = [root]
    for (const entry of entries) {
      if (!entryFilter(entry)) {
        continue
      }

      const path = this.pathMapper(entry)
      const node = this._pushNode(nodeStack, path)

      const firstFilename = entry.files[0].filename
      node.addChild({type: 'entry', name: firstFilename, hash: entry.hash, data: mapEntry(entry)})
    }

    return this._popNode(nodeStack)
  }
Create tree by path of entry's date with year/month

We reuse the fact that the database entries are ordered by date,
latest entry first. So we can iterate linar through the entries
list and build the tree nodes.