Yuya Nishihara committed e3d3048

thgrepo: update timestamp only if changes detected successfully (fixes #1728)

This fixes the following case:

1. hg: change dirstate
2. hg: unlock
3. thgrepo: detect change of .hg directory
4. hg: another lock
5. thgrepo: update _dirstatemtime
6. thgrepo: exit by lock still held
7. hg: unlock
8. thgrepo: detect change of .hg directory
9. thgrepo: ignore change because _dirstatemtime is already up-to-date

Comments (0)

Files changed (1)


             return False
         if mtime <= self._dirstatemtime:
             return False
+        changed = self._checkparentchanges() or self._checkbranch()
         self._dirstatemtime = mtime
-        return self._checkparentchanges() or self._checkbranch()
+        return changed
     def _checkparentchanges(self):
         nodes = self._getrawparents()
             return False
         if mtime <= self._branchmtime:
             return False
+        changed = self._checkbranchcontent()
         self._branchmtime = mtime
-        return self._checkbranchcontent()
+        return changed
     def _checkbranchcontent(self):