[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb dc517a1 067/350: More fixes to merging logic in eb

From: Eric Abrahamsen
Subject: [elpa] externals/ebdb dc517a1 067/350: More fixes to merging logic in ebdb-db-load
Date: Mon, 14 Aug 2017 11:46:04 -0400 (EDT)

branch: externals/ebdb
commit dc517a13a96418ff742c48098aa8d6dff8803de5
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    More fixes to merging logic in ebdb-db-load
    * ebdb.el (ebdb-db-load): Need to make sure right record ends up
      getting hashed against the uuid. Also, probably a bad idea to be
      let-binding the symbol 'equal.
 ebdb.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index 6fcd836..dcba11e 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2863,8 +2863,8 @@ overwrite data somewhere."
        ;; newly-loaded record ("rec").
        (let* ((double (cadr err))
              (delete-double t)
-             (equal (equal (clone rec :cache nil)
-                           (clone double :cache nil)))
+             (recs-equal (equal (clone rec :cache nil)
+                                (clone double :cache nil)))
              deleter keeper)
         ;; If any of the double's databases are read-only, we should
@@ -2877,7 +2877,7 @@ overwrite data somewhere."
         ;; If the records are the same, it doesn't matter which we
         ;; delete, so don't change our assumption.
-        (unless equal
+        (unless recs-equal
           ;; But if double is newer, we still need to keep it.
           (unless (ebdb-record-compare rec double 'timestamp)
@@ -2889,9 +2889,12 @@ overwrite data somewhere."
         ;; Merge the records, either automatically or
         ;; interactively, depending on the value of
         ;; `ebdb-auto-merge-records'.
-        (unless equal
+        (unless recs-equal
           (setq keeper (ebdb-merge keeper deleter ebdb-auto-merge-records)))
+        ;; Make sure the right record is hashed against the duplicate uuid.
+        (ebdb-puthash (ebdb-record-uuid keeper) keeper)
         (dolist (d (slot-value (ebdb-record-cache deleter) 'database))
           ;; Use low-level functions for this so we don't set the
           ;; database dirty.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]