util: make filestat.__eq__ return True if both of self and old have None stat
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 09 Jun 2017 13:07:48 +0900
changeset 32769 b5524fd9a4e3
parent 32768 ed66ec39933f
child 32770 b698921ee137
util: make filestat.__eq__ return True if both of self and old have None stat For convenience to compare two filestat objects regardless of None-ness of stat field.
mercurial/util.py
--- a/mercurial/util.py	Fri Jun 09 12:58:18 2017 +0900
+++ b/mercurial/util.py	Fri Jun 09 13:07:48 2017 +0900
@@ -1525,6 +1525,10 @@
                     self.stat.st_ctime == old.stat.st_ctime and
                     self.stat.st_mtime == old.stat.st_mtime)
         except AttributeError:
+            pass
+        try:
+            return self.stat is None and old.stat is None
+        except AttributeError:
             return False
 
     def isambig(self, old):