ANN nearest extension
Gilles Moris
gilles.moris at free.fr
Tue Dec 2 02:54:02 CST 2008
Hello,
Here is the nearest extension, which is much a complete rewrite of the describe
extension. Its goal is to find the nearest tag(s) from a given changeset,
either backward or forward in the changesets history tree.
The general usage is:
hg nearest [-c] [-a] [revs]
Code can be found here:
http://freehg.org/u/morisgi/nearest/file/33ef01aff84f/nearest.py
Here are the specificity of this extension:
- the revs are searched ordered by date, so that 1.0.2 will appear first, even
if there is a shorter path to go to the 1.0.1 tag
- the default output format is "tag+dist", and "tag-dist" with the --contains
option, where "dist" is the longest path to the tag. The longest path better
matches the efforts between the revision, as merges and backouts in
particular, can create artificial shortcuts.
- customizable output format with % characters
- better performance, so that a --limit option is not (hopefully) needed
- the --contains flag searches the history forward to answer the question:
which release contains this given revision ? This is my original use case.
- a shell pattern match is used instead of regexp, because it's simpler and
because the dot "." character usually used in tags is not interpreted. regexp
can be added later.
- branch selection dropped as tag matching is probably sufficient to fill the
use case.
Regards.
Gilles.
More information about the Mercurial
mailing list