[PATCH 1 of 1] Add tags-match option to convert for filtering tags

Brett Carter brett at rdnzl.net
Mon Apr 6 14:12:05 CDT 2009


> This looks reasonable, but in practice I think the use of this will be 
> cumbersome -- expect some very long commandlines.
> 
> Looking forward, I think we should consider adding one or more hooks 
> that allow arbitrary user code to be run during the conversion process 
> -- perhaps arbitrary so long as it is Python code.
> 
> Certainly I've done this myself and I have read of others on the mailing 
> list doing the same.
> 
> Is there a convenient mechanism for calling arbitrary Python modules 
> named in the configuration?
> 
> Frank

I've had to write custom code as well.  My thought with the tags-match 
option was to deal with a system like CVS where tags are per-file.  The 
first time cvsps sees a tag, it gets applied to every changeset after 
that, leading to a bunch of spurious tags after the conversion process. 
    Providing a filter like this solves the problem for me, since all my 
tags follow the same format.

As far as hooks, perhaps we should allow custom source/sink converters? 
      The converter code is already setup to be extensible, and this 
would provide the ultimate flexibility - I could just subclass the 
converter_source of my choice and add any custom hacks I wanted.

One could just add a "converter_{source, sink}_klass" to the convert 
section of .hgrc, and this class would be used instead of the -d option 
or the auto-detection code..

-Brett


More information about the Mercurial-devel mailing list