changeset 32749:b5524fd9a4e3

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.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 09 Jun 2017 13:07:48 +0900
parents ed66ec39933f
children b698921ee137
files mercurial/util.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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):