Comment 2 for bug 893470

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 893470] Re: BzrDir.list_branches lists same branch twice when a branch reference exists

On 22 November 2011 18:49, Neil Martinsen-Burrell <email address hidden> wrote:
> Oops, we can't list(set(...)) to remove duplicates because apparently
> branches don't compare equal based on their base attribute.  Should
> they?

No. It's tempting, but adding __cmp__ to complex non-value-like
objects tends to get in to trouble when people make different
assumptions about what equality means: is a locked Branch equal to an
unlocked Branch pointing to the same thing?

Better just to use has_same_location, or get the base locations and
uniquify on that.

--
Martin