##// END OF EJS Templates
status: gather fixup info at comparison time...
marmoute -
r49204:41f40f35 default
parent child Browse files
Show More
@@ -46,6 +46,9 b' from .utils import ('
46 dateutil,
46 dateutil,
47 stringutil,
47 stringutil,
48 )
48 )
49 from .dirstateutils import (
50 timestamp,
51 )
49
52
50 propertycache = util.propertycache
53 propertycache = util.propertycache
51
54
@@ -1814,7 +1817,21 b' class workingctx(committablectx):'
1814 ):
1817 ):
1815 modified.append(f)
1818 modified.append(f)
1816 else:
1819 else:
1817 fixup.append(f)
1820 # XXX note that we have a race windows here since we gather
1821 # the stats after we compared so the file might have
1822 # changed.
1823 #
1824 # However this have always been the case and the
1825 # refactoring moving the code here is improving the
1826 # situation by narrowing the race and moving the two steps
1827 # (comparison + stat) in the same location.
1828 #
1829 # Making this code "correct" is now possible.
1830 s = self[f].lstat()
1831 mode = s.st_mode
1832 size = s.st_size
1833 mtime = timestamp.mtime_of(s)
1834 fixup.append((f, (mode, size, mtime)))
1818 except (IOError, OSError):
1835 except (IOError, OSError):
1819 # A file become inaccessible in between? Mark it as deleted,
1836 # A file become inaccessible in between? Mark it as deleted,
1820 # matching dirstate behavior (issue5584).
1837 # matching dirstate behavior (issue5584).
@@ -1842,13 +1859,13 b' class workingctx(committablectx):'
1842 if dirstate.identity() == oldid:
1859 if dirstate.identity() == oldid:
1843 if fixup:
1860 if fixup:
1844 if dirstate.pendingparentchange():
1861 if dirstate.pendingparentchange():
1845 normal = lambda f: dirstate.update_file(
1862 normal = lambda f, pfd: dirstate.update_file(
1846 f, p1_tracked=True, wc_tracked=True
1863 f, p1_tracked=True, wc_tracked=True
1847 )
1864 )
1848 else:
1865 else:
1849 normal = dirstate.set_clean
1866 normal = dirstate.set_clean
1850 for f in fixup:
1867 for f, pdf in fixup:
1851 normal(f)
1868 normal(f, pdf)
1852 # write changes out explicitly, because nesting
1869 # write changes out explicitly, because nesting
1853 # wlock at runtime may prevent 'wlock.release()'
1870 # wlock at runtime may prevent 'wlock.release()'
1854 # after this block from doing so for subsequent
1871 # after this block from doing so for subsequent
@@ -1890,7 +1907,7 b' class workingctx(committablectx):'
1890 s.deleted.extend(deleted2)
1907 s.deleted.extend(deleted2)
1891
1908
1892 if fixup and clean:
1909 if fixup and clean:
1893 s.clean.extend(fixup)
1910 s.clean.extend((f for f, _ in fixup))
1894
1911
1895 self._poststatusfixup(s, fixup)
1912 self._poststatusfixup(s, fixup)
1896
1913
General Comments 0
You need to be logged in to leave comments. Login now