Fix merging of weight systems

Linus Torvalds torvalds at
Mon Oct 29 11:27:14 PDT 2012

I just tried downloading some duplicate dives I had on my second dive
computer, and it all "just worked" and subsurface merged them for me.
Almost perfectly.

I say "almost", because in merging them, it threw my old weightsystem
data away, due to that not being merged.

Also, it was a perfect merge only because the computers are so similar
that they just line everything up - same water activation logic, same
sample interval, same pretty much everything. So while I know the
sample merging is not really the right thing to do (it was designed to
get the "merge the exact same dive from the same computer" case
right), it worked well enough for this particular case. I'll look at
something better later.

Signed-off-by: Linus Torvalds <torvalds at>

There might be better ways to merge weights if both dives have weight
information, but this is "good enough" for the sane cases of having
*one* of the dives have weigth information, and picking it from there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 1628 bytes
Desc: not available
URL: <>

More information about the subsurface mailing list