[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH] git-p4: avoid syncing duplicate changes
From:       Simon Hausmann <simon () lst ! de>
Date:       2009-02-05 15:24:51
Message-ID: 200902051624.51636.simon () lst ! de
[Download RAW message or body]

On Wednesday 28 January 2009 Pete Wyckoff, wrote:
> When a particular changeset affects multiple depot paths, it
> will appear multiple times in the output of "p4 changes".
> Filter out the duplicates to avoid the extra empty commits that
> this would otherwise create.
> 
> Signed-off-by: Pete Wyckoff <pw@padd.com>
> ---
>  contrib/fast-import/git-p4 |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index a85a7b2..63c8eca 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -444,8 +444,9 @@ def p4ChangesForPaths(depotPaths, changeRange):
>  
>      changes = []
>      for line in output:
> -        changeNum = line.split(" ")[1]
> -        changes.append(int(changeNum))
> +	changeNum = int(line.split(" ")[1])
> +	if changeNum not in changes:
> +	    changes.append(changeNum)

Hmm, isn't this a potentially quadratic operation?

I agree about the problem in general though.

Simon
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic