Use integer comparison for patchsets
When checking for a new version of a change, compare patchsets
as integers.
Change-Id: Ic5ceae9e89cd28a9f391896bcdbf68313d70adc4
Reviewed-on: https://review.openstack.org/36734
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
diff --git a/zuul/model.py b/zuul/model.py
index 6b83feb..b4bc5eb 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -604,7 +604,10 @@
def isUpdateOf(self, other):
if ((hasattr(other, 'number') and self.number == other.number) and
- (hasattr(other, 'patchset') and self.patchset > other.patchset)):
+ (hasattr(other, 'patchset') and
+ self.patchset is not None and
+ other.patchset is not None and
+ int(self.patchset) > int(other.patchset))):
return True
return False