util: make filestat.avoidambig() return whether ambiguity is avoided or not
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 09 Jun 2017 12:58:17 +0900
changeset 32746 77f354ae1123
parent 32745 23734c0e361f
child 32747 1a79de471d56
util: make filestat.avoidambig() return whether ambiguity is avoided or not
mercurial/util.py
--- a/mercurial/util.py	Fri Jun 09 10:42:19 2017 -0700
+++ b/mercurial/util.py	Fri Jun 09 12:58:17 2017 +0900
@@ -1568,7 +1568,10 @@
         'old' should be previous filestat of 'path'.
 
         This skips avoiding ambiguity, if a process doesn't have
-        appropriate privileges for 'path'.
+        appropriate privileges for 'path'. This returns False in this
+        case.
+
+        Otherwise, this returns True, as "ambiguity is avoided".
         """
         advanced = (old.stat.st_mtime + 1) & 0x7fffffff
         try:
@@ -1577,8 +1580,9 @@
             if inst.errno == errno.EPERM:
                 # utime() on the file created by another user causes EPERM,
                 # if a process doesn't have appropriate privileges
-                return
+                return False
             raise
+        return True
 
     def __ne__(self, other):
         return not self == other