auto rename patches

Herbert Griebel herbertg at gmx.at
Wed Feb 11 08:24:06 CST 2009


Martin Geisler wrote:
> Hi Herbert and hi list!
> 
> Christian Boos asked me on IRC if I could take a look at the old auto
> rename patch. It was last discussed back in September and November.
> 
>   http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/17639/
>   http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/18271/
> 
> With the help of Christian I was able to find a version that applied
> with only a little fuzz to the current crew tip:
> 
>   http://article.gmane.org/gmane.comp.version-control.mercurial.devel/18351
> 
> There is some problems with the patch as it is now:
> 
> * It adds a great deal of C code without providing a Python version as
>   well. Matt said at some point that he preferred to see this feature in
>   Python code first:
> 
>     http://article.gmane.org/gmane.comp.version-control.mercurial.devel/18365/
> 
>   It is also important to have pure Python code as a fallback in case
>   the C extensions are not compiled. You can use the --pure flag for
>   run-tests.py to test Mercurial without any C extensions enabled.
> 
>   In the threads above there are some talk about a pure Python version
>   of the patch, but the link given is now dead.
I will upload my repo on bitbucket to make it available in the best way,
but currently have very little time since I am on a extended business trip.
It should be up in 2-3 weeks.

> 
> * The patch is still big:
> 
>     % hg qdiff | diffstat
>     mercurial/bdiff.c                |  153 ++++++++++++++
>     mercurial/cmdutil.py             |   29 --
>     mercurial/haddremove.py          |  355 +++++++++++++++++++++++++++++++++
>     tests/test-addremove-similar.out |    3
>     tests/test-import.out            |    2
>     5 files changed, 510 insertions(+), 32 deletions(-)
> 
>   This is after moving the changes to the test cases out of the main
>   patch.
> 
> Mercurial 1.2 will be released on March 1st and the feature freeze
> begins on Febrary 14th.
> 
> Herbert, do you think you can refactor the patch and submit a pure
> Python code version before that date?

Hi Martin,

currently I will not break it up in smaller patches, instead I will
wait for feedback if the code can be understood. I already put some
effort in it to make the code easy to read and I do not think that
splitting it up will make it much easier to read it. To understand
the code the comments should be improved, and explanations should not
go into commit messages, since explanation should be versioned too.
Splitting the code up is a lot of work, and I do not know if all of it will be accepted
for integration, so I want to know it in advance which parts are good
or not good.
To split it up, I would suggest 3 patches:
P1. correct similarity equation (1 line patch)
P2. not best matches (~20 line patch)
P3. rest (speed and name matching and devered compares)


Patch 2 is completely re-written in the last version, so I am not sure about this one, it
does not help to understand the latest version. Due to the devered compares the code is
very intertwined and cannot be torn apart easily, tearing this apart is major effort.


More information about the Mercurial-devel mailing list