[PATCH] auto rename: best matches and speed improvement UPDATE5

Herbert Griebel herbertg at gmx.at
Fri Aug 22 14:25:39 CDT 2008


Matt Mackall wrote:
> On Fri, 2008-08-22 at 19:59 +0200, Herbert Griebel wrote:
>> Matt Mackall wrote:
>>> On Fri, 2008-08-22 at 14:47 +0200, Herbert Griebel wrote:
>>>> The current
>>>> checked file is displayed to give the user feedback about the
>>>> progress.
>>> That's another. Not sure I want this - Mercurial commands are quite
>>> quiet by default.
>> The matching is quite fast now, but it could still last a long time.
>> Then you would want some progress feedback otherwise its hard to
>> know how long will take or whats going on.
>> Maybe enabling output for longer durations could be
>> done, like 30s?
> 
> There's some work to make a generic status bar that's almost done. The
> last person to touch it I think was Stefano. Until that happens, it's
> probably a bad idea to have individual methods invent their own methods.
> 
Then I will remove the output and we can add the progress feedback later
when the status bar is ready.

>>>> Added files with the same similarity for a removed file are also
>>>> matched against the pathname so directory structure can be preserved
>>>> with regard to renaming identical files in multiple directories.
>>> Huh?
>> x/z
>> y/z
>> both files are identical
>>
>> move to a:
>>
>> a/x/z
>> a/y/z
>>
>> you expect:
>> rename x/z to a/x/z
>> rename y/z to a/y/z
> 
> Ok, that makes sense. How does it work? What if you have x/z and x/x/z?
It compares two pathnames starting from the end, the score is simply
the number of equal characters. So the full path is matched. This works
very good if you are just moving. If you rename the file name too and
move it, things get much more complicated and you need a more sophisticated
matching algorithm which matches all parts of two pathes. So you need a
basic string comparer which gives a similarity measure. Found one but
this would add another C file to hg for the matching.


More information about the Mercurial-devel mailing list