# HG changeset patch
# User Christophe de Vienne <cdevienne@gmail.com>
# Date 1414589547 -3600
# Node ID 354188b0eca027b5845fe6ca82af22d81f68f656
# Parent  f305fba940c08d94680a4a84d8aa590450e216a7
Allow signoff to be added when one already exists on a precursor.

The current obsolescence support makes little difference between
comments/signoff from a cset and the ones from its predecessors.

This patch avoid a signoff from a precursor to be seen as changeable, and allow
the user to re-signoff on the latest version of the changeset.

diff -r f305fba940c0 -r 354188b0eca0 review/api.py
--- a/review/api.py	Tue Oct 28 11:16:39 2014 +0100
+++ b/review/api.py	Wed Oct 29 14:32:27 2014 +0100
@@ -482,7 +482,8 @@
         self.signoffs.sort(key=operator.attrgetter('local_datetime'))
 
     def signoffs_for_user(self, username):
-        return filter(lambda s: s.author == username, self.signoffs)
+        return filter(lambda s: s.node == self.node
+                      and s.author == username, self.signoffs)
 
     def signoffs_for_current_user(self):
         return self.signoffs_for_user(fromlocal(self.ui.username()))