Versioning builds from repos

Gilles Moris gilles.moris at free.fr
Mon Jul 13 18:17:32 CDT 2009


On Mon July 13 2009 02:37:46 Mads Kiilerich wrote:
> > diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> > --- a/mercurial/cmdutil.py
> > +++ b/mercurial/cmdutil.py
> > @@ -741,6 +741,43 @@
> >                                            'manifest': '{rev}:{node|formatnode}',
> >                                            'filecopy': '{name} ({source})'})
> >
> > +    @util.propertycache
> > +    def ltmap(self):
> > +        '''get an array[rev] of latest tag tuple, each tuple being
> > +        (date of the latest tag, the [first] tag, distance to that tag).
> > +        Exclude "tip" and MQ tags from the search.
> > +        '''
> > +        defvalue = 0, '', -1
> > +        ltmap = [defvalue] * len(self.repo)
> >    
> 
> Using the methods name in local scope seems quite confusing to me.

I will fix that.

> 
> > +
> > +        try:
> > +            qbase = self.repo['qbase'].rev()
> > +            qtip = self.repo['qtip'].rev()
> > +            excltags = frozenset(['tip', 'qparent'])
> > +        except error.RepoError:
> > +            excltags = ['tip']
> > +            qbase = qtip = -1
> >    
> 
> We probably don't want any mq references in core Mercurial. If special 
> handling of mq still is needed then mq should monkey-patch it somehow.
> 
> > +
> > +        for r in range(len(self.repo)):
> >    
> 
> This always loops over all revisions, even though we typically only 
> needs this information for one changeset, and once the tag is found we 
> don't have to go further back in history. Could the traversal perhaps be 
> done on demand?
> 

Actually, my first implementation did the traversal on demand.
However, if somebody has the idea to log the whole repo with this keyword,
the performances are terrible. The forward traversal of the entire repo
is not that bad compared to the backward traversal of few changeset, anyway.


More information about the Mercurial-devel mailing list