From c1fc4595171fa6eec802eb65a0fde0b53878a077 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 30 Nov 2009 06:26:49 -0500 Subject: [PATCH] Avoid redundant Comment.alt_ids --- libbe/comment.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libbe/comment.py b/libbe/comment.py index 9502adf..c5f1cc9 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -366,7 +366,7 @@ class Comment(Tree, settings_object.SavedSettingsObject): elif verbose == True: print >> sys.stderr, 'Ignoring unknown tag %s in %s' \ % (child.tag, comment.tag) - if self.alt_id == None: + if uuid != self.uuid and self.alt_id == None: self.explicit_attrs.append('alt_id') self.alt_id = uuid if body != None: @@ -437,6 +437,8 @@ class Comment(Tree, settings_object.SavedSettingsObject): raise ValueError, \ 'Merge would change %s "%s"->"%s" for comment %s' \ % (attr, old, new, self.uuid) + if self.alt_id == self.uuid: + self.alt_id = None for estr in other.extra_strings: if not estr in self.extra_strings: if accept_extra_strings == True: -- 2.26.2