habnabit / vcversioner

take version numbers from version control
ISC License
28 stars 16 forks source link

issue with hg bookmarks #12

Open nihlaeth opened 7 years ago

nihlaeth commented 7 years ago

Apparently hg bookmarks are also seen as tags, which results in the following version string:

$ hg log -r . --template '{latesttag}-{latesttagdistance}-hg{node|short}'
default/master-1-hga61ca3b970ea

A more helpful default hg command would be:

$ hg log -r . --template "{latesttag('re:^v[0-9\.]+((a|b|rc)[0-9]*)?$') % '{tag}-{distance}'}-hg{node|short}"
v1.0a6-38-hga61ca3b970ea

I was going to override it in setup.py, only then I noticed I would lose the ability to also use git, and that is a dealbreaker since I use both hg and git. Would you be open to a pull request that changes the default, or maybe allows you to overwrite default commands for hg or git exclusively?

nihlaeth commented 7 years ago

I have a pull request ready if that helps