Subject: | Mercurial::Tag implementation is probably incorrect |
Hi,
Current Mercurial::Tag plugin implementation parses .hgtags file. I think it is not correct implementation for two reasons:
1. It does not respect local tags (which are stored in .hg/localtags file).
2. It does not see "back-to-the-future tags".
"back-to-the-future tags" is not an official Mercurial term. Let me show it in example. Let us assume we have a project with a dozen of releases, and so, tags: 0.001, 0.002, ... 0.012. Let us also assume the working dir is clean (i. e. there are no modified files, all the files are committed) to avoid conflicts. Now run "hg update -r 0.007" and look at .hgtags file. It contains tags from 0.001 up to 0.006, *not* including tag 0.007 and later tags, because .hgtag file is versioned, while we checked out an old version.
In such a case, Mercurial::Tag plugin will allows tags/versions 0.007, 0.008, etc because they are not listed in .hgtags.
However, "hg tags" command lists all the tags from 0.001 to 0.012. BTW, it also lists all local tags.
Thus, I think it would be better to run "hg tags" and grep its output rather than scan file ".hgtags" directly.