[PATCH 1 of 1 stable] log: do not --follow file that is deleted and recreated later (issue732)

Benoit Boissinot bboissin at gmail.com
Sat Jun 12 11:49:45 CDT 2010


On Fri, Jun 11, 2010 at 8:48 AM, Nicolas Dumazet <nicdumz at gmail.com> wrote:
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1051,8 +1051,12 @@
>                 revs = []
>                 for j in xrange(i - window, i + 1):
>                     n = filelog.node(j)
> -                    revs.append((filelog.linkrev(j),
> -                                 follow and filelog.renamed(n)))
> +                    copied = created = False
> +                    if follow:
> +                        if filelog.parents(n)[0] == nullid:

you should check if parents[1] == nullid as well (case where you merge
a renamed file)

And looking at the code, I'm not sure it handles the following case well.


1 - 2 - 3 - 4 - 8
 \           /
   5 - 6 - 7

where the file is created in 2 and 6 (and merged in 8).

with your code wouldn't is stop at 6, while it should still explore
the other branch?

Cheers,

Benoit


More information about the Mercurial-devel mailing list