cdatapack: move meta parsing to a function

Authored by durham.

Description

cdatapack: move meta parsing to a function

In a future diff we'll be doing metadata parsing in another function as well, so
let's move it to a separate function.

Differential Revision: https://phab.mercurial-scm.org/D1686

Details