[PATCH 2 of 2 convert backouts] convert: backout 81cf597dafa9 and a3545c3104aa -closemap

Mads Kiilerich mads at kiilerich.com
Thu Apr 17 06:26:37 CDT 2014


On 04/17/2014 11:16 AM, Simon King wrote:
> On Wed, Apr 16, 2014 at 5:05 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1397603408 -7200
>> #      Wed Apr 16 01:10:08 2014 +0200
>> # Node ID c0c12f7dbe25a3b8294905b072f6f27291ad26b4
>> # Parent  319a4229e58fba95bea881cba07a62a726723227
>> convert: backout 81cf597dafa9 and a3545c3104aa -closemap
>>
>> Closemap solves a very specific use case. It would be better to have a more
>> generic solution than to have to maintain this forever.
>>
>> Closemap has not been released yet and removing it now will not break any
>> backward compatibility contract.
>>
>> There is no test coverage for closemap but it seems like the same can be
>> achieved with a simple and much more powerful custom extension:
>>
>> import hgext.convert.hg
>> class source(hgext.convert.hg.mercurial_source):
>>      def getcommit(self, rev):
>>          c = super(source, self).getcommit(rev)
>>          if rev in ['''
>> d643f67092ff123f6a192d52f12e7d123dae229f
>> 9117c6561b0bd7792fa13b50d28239d51b78e51f
>> f368a1c302d5b87506f7edb13769e591e063d7ea
>> ''']:
> This doesn't look quite right to me (a list containing a single
> string).

Yes, that was a bug in an "obviously correct" change, last minute and 
after testing ...

> Shouldn't it be:
>
>          if rev in '''
> d643f67092ff123f6a192d52f12e7d123dae229f
> 9117c6561b0bd7792fa13b50d28239d51b78e51f
> f368a1c302d5b87506f7edb13769e591e063d7ea
> '''.split():

almost - except for the .split which in this case (fixed length elements 
with separators) isn't necessary.

I have updated the wiki. Thanks!

/Mads



More information about the Mercurial-devel mailing list